aboutsummaryrefslogtreecommitdiff
path: root/cores
AgeCommit message (Collapse)Author
2022-02-22Merge tag '1.8.4' into upstream-1.8.4David Madison
2021-10-01Merge pull request #383 from DanielGibson/disable-cdcMartino Facchin
Allow disabling CDC with -DCDC_DISABLED
2021-05-26Correct typos in comments and documentationper1234
2021-01-06Allow disabling CDC with -DCDC_DISABLEDDaniel Gibson
Sometimes Arduino-based USB devices don't work because some hardware (like KVM switches) gets confused by the CDC sub-devices. This change makes it relatively easy to disable CDC at compiletime. Disabling it of course means that the serial console won't work anymore, so you need to use the reset button when flashing. CDC_DISABLED is also used in ArduinoCore-samd for the same purpose. based on https://github.com/gdsports/usb-metamorph/tree/master/USBSerPassThruLine See also https://github.com/NicoHood/HID/issues/225 and https://github.com/arduino/Arduino/issues/6387 and https://forum.arduino.cc/index.php?topic=545288.msg3717028#msg3717028
2020-11-02Merge pull request #345 from Vitve4/pr_344Martino Facchin
Improve reading ADC result
2020-11-01Improve reading ADC resultVitaly Shmagun
7.3.0-atmel3.6.1-arduino7 gcc fails to optimize separate reading from ADCL and ADCH. It produces additionally three eor commands or in some cases two mov commands in the assembly code (see discussion #344). These commands swap register contents before store them to data area. So they are completely unnecessary. Reading ADC result with ADC macro fixes it and gcc generates the right code..
2020-09-17Use std::size_t in new/deleteMatthijs Kooijman
The standard dictates that `std::size_t` is used, rather than the plain `size_t` type. Even though these types are usually, if not always, exactly the same type, other code might assume that `std::size_t` is actually used and thus also available under that name after including `<new>`. This fixes that by using the right type. One challenge is that it is usually declared in headers that we do not have available, so this just defines the `std::size_t` type in the `<new>` header to work around that.
2020-09-17Optionally let new terminate on allocation failureMatthijs Kooijman
This is currently disabled, keeping the old behavior of returning NULL on failure, but should probably be enabled in the future as code that does want to do a null check has had a chance to switch to the more portable nothrow versions. When enabled, allocation failure calls the weak `std::terminate()`, which calls `abort()` by default, but can be replaced by user code to do more specific handling. To enable this, a macro must be defined (in new.cpp or on the compiler commandline). This fixes part of #287.
2020-09-17Make zero-sized new standards-compliantMatthijs Kooijman
This fixes part of #287.
2020-09-17Call std::terminate on pure or deleted virtual functionsMatthijs Kooijman
These are special functions that are presumably put into vtables for deleted or pure virtual functions. Previously, this would call `abort()` directly, but calling `std::terminate()` achieves the same effect, but allows user code to change the behavior (e.g. to print to serial, blink leds or whatever makes sense).
2020-09-17Add weak `std::terminate()` implementationMatthijs Kooijman
This allows calling it from other places later. The default implementation calls `abort()`, but making it weak allows user code to override this function (either directly, or by including a library like uclibc++ that implements `std::set_terminate()`). Note that this does not add a declaration for this function, since the standard dictates this to be in `<exception>`, but we cannot meaningfully or completely implement that header, so better leave it to be overridden by e.g. libraries like uclibc++.
2020-09-17Allow overriding selected operator new and delete functionsMatthijs Kooijman
This makes these functions weak, so that a sketch or library can replace them. This does not apply to all of these operators, only for the ones that the C++ standard specifies as replaceable.
2020-09-17Clean up and complete `<new>` headerMatthijs Kooijman
This makes this header complete up to including C++14, except two exception classes that cannot be defined without `<exception>`. The functions related to the "new_handler" are declared but not actually defined, to prevent overhead and complexity. They are still declared to allow implementing them in user code if needed. This makes the implementation of all operator new and delete functions comply with the C++11/C++14 specification in terms of which should be actually implemented and which should be delegate to other functions. There are still some areas where these implementations are not entirely standards-compliant, which will be fixed in subsequent commits. This fixes part of #287 and fixes #47.
2020-09-17Swap new and new.h header filesMatthijs Kooijman
Originally, the Arduino core used "new.h", rather than the standard "new", probably because the implementation was incomplete, and for the most commonly used new and delete operators, no include is needed at all (they are defined implicitly by the compiler). However, now Arduino does expose the "new" name, as an alias for the older "new.h". Given that the standard name is "new", it makes more sense to put the actual content in "new", and make "new.h" a compatibility header that includes "new" instead of the other way around.
2020-07-23Merge tag '1.8.3' into upstream-updatesDavid Madison
Release 1.8.3
2020-05-13Add "new" proxy header for compatibility with c++-standard #include<new>eudoxos
2020-05-02Update comment on wiring_analog.cMaximilian Leopold
2020-03-18Fix sine -> since typo in HardwareSerial filesDaniel Jackson
2020-02-01Merge ArduinoCore-avr Release 1.8.2David Madison
2019-09-25Interrupt ordering for 32u2 and 16u2 MCU (#66)Manuel Reimer
* Interrupt ordering for 32u2 and 16u2 MCU * Added missing chip variants
2019-09-16Merge pull request #4 from awatterott/masterAlexander Entinger
No fixed value for USB power current.
2019-09-16Merge pull request #82 from luco5826/masterAlexander Entinger
Minor optimization in shiftOut function
2019-09-16Merge pull request #95 from jrowberg/masterAlexander Entinger
Cast pins to signed integers to avoid Wtype-limits compile warning
2019-09-16Merge pull request #92 from matthijskooijman/cdc-no-prototocol-atAlexander Entinger
Do not claim AT-protocol in CDC interface descriptor
2019-09-16Merge branch 'master' into patch-1Alexander Entinger
2019-09-16Merge pull request #33 from Pharap/add-placement-newAlexander Entinger
Add placement new operator
2019-09-16Merge pull request #64 from paulrnash/paulrnash-intellisenseAlexander Entinger
Add parameter names to common prototypes
2019-09-16Adding parenthesis around 'bitvalue' allowing correct macro expansion when ↵Alexander Entinger
using with ternary operator such as bitWrite(value, bit, some_computed_value == 5 ? 1: 0);'
2019-09-16Merge pull request #76 from dmadison/pluggable-unusedAlexander Entinger
Fix unused variable warning for non-pluggable USB in SendDescriptor
2019-09-04remove unnecessary if branchAkihiro YAMAZAKI
checking `length` in below while statement
2019-07-29Add null pointer test to String destructorJeff Rowberg
2019-06-08Do not claim AT-protocol in CDC interface descriptorMatthijs Kooijman
The CDC code presents itself as a virtual serial port. However, it also sets the "bFunctionProtocol" value to 1, which means it supports AT-commands, which is not actually the case. This might cause problems with some software, such as ModemManager. Originally, ModemManager would be very liberal with probing serial devices, using a blacklist to prevent probing non-modems such as Arduinos. Since version 1.7.990, it has supported a "strict" mode where it tries to be more restrained in what devices it probes. For CDC ACM devices, this means it will only probe devices that claim to support AT-commands. However, it also stopped applying the blacklist (intending to eventually remove the blacklist), meaning it would again probe Arduinos. This new strict policy is not the upstream default, but is enabled in Debian (since Buster) and Ubuntu (since bionic 18.04.2). The proper way to fix this, is to not claim AT comand support in the USB device descriptor, which is what this commit does. The Arduino will still show up as a virtual serial port, just not be probed by ModemManager in strict mode. For the commit that introduced the strict mode in ModemManager, see https://cgit.freedesktop.org/ModemManager/ModemManager/commit/src?id=ee570d44dc117dc69f23e83313dd877f76c5e3e0
2019-04-26Fixed shiftOut in MSBFIRST mode HIGH/LOWluca
2019-04-26Minor optimization in shiftOut functionluca
2019-03-09Change endpoint comments to use send/recvDavid Madison
Much better than in/out, since using the controller's perspective meant the inverted "in/out" was confusing
2019-03-09Switch 'available' return type to uint8_tDavid Madison
This function never returns an error (-1), and the number of bytes available will never be a negative number.
2019-03-09Moved send above recv in Xinput API headerDavid Madison
Logical reordering, no functional change
2019-02-21Add USB connected API supportDavid Madison
Returns true if the device USB is configured. Although will still return true if the device has been configured and the USB data pins disconnected...
2019-02-21Change receive endpoint to double-bankedDavid Madison
No reason not to take advantage of this feature, although with the interrupt in place I doubt it will be useful.
2019-02-21Use endpoint number defines for ep allocationDavid Madison
2019-02-21Add USB receive callback to USB ISRDavid Madison
Using the OUT endpoint interrupt
2019-02-21Add XInput USB APIDavid Madison
2019-02-19Change VID and PID in boards.txtDavid Madison
Better to set these where intended so they can be easily overridden if need be.
2019-02-19Add XInput endpoint number definesDavid Madison
2019-02-19Allocate XInput endpoint memoryDavid Madison
2019-02-19Modify endpoint numbers to be sequentialDavid Madison
Easier for the AVR to deal with the memory if the in/out numbers aren't paired.
2019-02-19Add XInput string descriptorsDavid Madison
2019-02-19Add XInput device and config descriptorsDavid Madison
2019-02-17Removed USB CDC SerialDavid Madison
This will compile but will NOT enumerate properly without a config descriptor. You've been warned...
2019-02-17Define descriptor return var in pluggable blockDavid Madison
Avoids unused variable warning if USB is enabled but pluggable USB is not