Commit Graph

1122 Commits

Author SHA1 Message Date
Arnav Gupta f1d5c050b0 set correct max size for mega2560
Signed-off-by: Arnav Gupta <championswimmer@gmail.com>
2014-09-20 03:09:54 +05:30
Cristian Maglie 99fa1b0cbb Merge branch 'master' into ide-1.5.x
Conflicts:
	app/src/processing/app/Base.java
	build/build.xml
	todo.txt
2014-09-16 12:19:39 +02:00
Cristian Maglie 60e6ec22f1 Fixed trivial include error introduced in previous commit 2e3e539b... oops... 2014-09-12 16:58:05 +02:00
Cristian Maglie 8440f53364 Merge pull request #2299 from cmaglie/ide-1.5.x-spi-updates
Missing SPI Transaction API methods on Due (SAM3X)
2014-09-12 14:07:03 +02:00
Cristian Maglie b70269a303 Added license to USBAPI.h
Close #1847
2014-09-12 12:27:39 +02:00
Cristian Maglie 3155eeeae9 Merge pull request #1937 from matthijskooijman/stringindex
String index fixes and cleanups
2014-09-12 11:56:12 +02:00
Matthijs Kooijman fde95cf5b5 Fix off-by-one in String::substring
When checking the `left` argument, it previously allowed having
left == len. However, this means the substring starts one past the last
character in the string and should return the empty string. In practice,
this already worked correctly, because buffer[len] contains the trailing
nul, so it would (re)assign the empty string to `out`.

However, fixing this check makes it a bit more logical, and prevents a
fairly unlikely out-of-buffer write (to address 0x0) when calling
substring on an invalidated String:

	String bar = (char*)NULL;
	bar.substring(0, 0);
2014-09-10 13:42:06 +02:00
Cristian Maglie 0b094167de Merge pull request #2279 from cmaglie/fix-leo-upload-osx10.9.4
Fix for upload problems on Arduino Leonardo (and derivatives) on OSX 10.9
2014-09-10 12:58:10 +02:00
Matthijs Kooijman 35a84769d4 Simplify String::remove(unsigned int)
Previously, this method calculated the length of the string from the
given index onwards. However, the other remove() method called already
contains code for this calculation, which is used when the count passed
in is too big. This means we can just pass in a very big count that is
guaranteed to point past the end of the string, shrinking the remove
method by a few bytes.
2014-09-10 12:33:25 +02:00
Matthijs Kooijman b2729a5156 Fix bounds check in String::remove()
Previously, if you passed in a very big index and/or count, the
`index + count` could overflow, making the count be used as-is instead
of being truncated (causing the string to be updated wrongly and
potentially writing to arbitrary memory locations).

We can rewrite the comparison to use `len - index` instead. Since we
know that index < len, we are sure this subtraction does not overflow,
regardless of what values of index and count we pass in.

As an added bonus, the `len - index` value already needed be calculated
inside the if, so this saves a few instructions in the generated code.

To illustrate this problem, consider this code:

String foo = "foo";
Serial.println(foo.length()); // Prints 3
foo.remove(1, 65535); // Should remove all but first character
Serial.println(foo.length()); // Prints 4 without this patch

Not shown in this is example is that some arbitrary memory is written
as well.
2014-09-10 12:33:25 +02:00
Matthijs Kooijman dfb0dee773 Remove unneeded check in String::remove(unsigned int)
This check already happens in the remove(unsigned int, unsigned int)
method that is caled, so there is no need to also check this here.
2014-09-10 12:33:24 +02:00
Cristian Maglie f02d637a89 Fixed license for new.cpp and small cosmetic changes 2014-09-06 12:44:53 +02:00
Cristian Maglie a4496b927b Correct implementation of gcc specific internal functions
The following empty stubs has been replaced by the gcc
flag -fno-threadsafe-static:

  int __cxa_guard_acquire(__guard *);
  void __cxa_guard_release (__guard *);
  void __cxa_guard_abort (__guard *);

The following empty stubs has been moved into their specific
module abi.cpp:

  void __cxa_pure_virtual(void) __attribute ((noreturn));
  void __cxa_deleted_virtual(void) __attribute ((noreturn));

Fix #107
2014-09-06 12:42:25 +02:00
Cristian Maglie df778925a8 Printable.h doesn't need new.h but only stdlib.h for size_t.
Probalby new.h may be removed completely.
2014-09-06 12:37:57 +02:00
Cristian Maglie 4801801ef9 Updated version to 1.5.8 2014-09-05 10:11:47 +02:00
Cristian Maglie 1d0f3510f6 Fix for upload problems on Arduino Leonardo (and derivatives) with OSX 10.9.4 2014-09-01 12:16:41 +02:00
qperez42@gmail.com 4d5358d307 fix Descriptor.c 2014-08-25 09:52:10 +02:00
Cristian Maglie 5d87f9e8e2 Merge branch 'master' into ide-1.5.x 2014-08-08 15:44:41 +02:00
Christopher Andrews 28acfd7d9d Added replacement stub for cstdlib atexit() funciton.
This is an empty stub to simply allow use of complex types with a
non global static lifetime. For more complex handling the function
'atexit' can be redefined in user code.

For more information see:

https://github.com/arduino/Arduino/pull/2229
https://github.com/arduino/Arduino/issues/1919
2014-08-08 15:38:57 +02:00
PaulStoffregen 48f5256789 SPI Transactions for AVR 2014-08-01 05:38:27 -07:00
Cristian Maglie e057236dd6 Merge remote-tracking branch 'arduino/master' into ide-1.5.x 2014-07-24 14:46:05 +02:00
Cristian Maglie b06b62d2f7 Merge pull request #2206 from amulya349/master
Fix of a bug #2199
2014-07-24 14:40:52 +02:00
Amulya Kumar Sahoo 710bd1fa2e Fix of a bug 2014-07-23 01:03:44 +05:30
Cristian Maglie 82a130f833 Merge pull request #2194 from Fede85/ide-1.5.x_lib-description
Ide 1.5.x lib description
2014-07-21 12:16:20 +02:00
Cristian Maglie 38e9fa1a5f Merge pull request #2190 from ribbons/compiler-warnings
Fix two compiler warnings generated by updated toolchain
2014-07-19 09:35:58 +02:00
Fede85 6fb4b2795c missing paragraph field in library.properties 2014-07-18 20:08:01 +02:00
Fede85 2f7cc5ff55 modified sentences in library.properties files 2014-07-18 19:41:34 +02:00
PaulStoffregen bcc5488cbc Add availableForWrite() to HardwareSerial 2014-07-18 07:01:26 -07:00
Matt Robinson cd68a1c52c Cast empty string to char* to fix compiler warning
Stream::find(char *target) passes an empty terminator string to
Stream::findUntil(char *target, char *terminator) which caused a compiler
warning with the updated toolchain, so cast it to a char*.
2014-07-17 16:51:35 +01:00
Cristian Maglie cb4ae51b42 Merge pull request #1912 from Lauszus/issues440
Enable user to change the I2C clock frequency by calling setClock in the Wire library
2014-07-02 15:37:30 +02:00
Cristian Maglie e7c3527a99 Merge pull request #2148 from Lauszus/promini
Arduino Pro and Pro Mini should use eightanaloginputs variant
2014-07-02 15:29:31 +02:00
Fede85 3bef9827bf added support for the ArduinoISP 2014-07-02 15:03:12 +02:00
Cristian Maglie 1bc01d541e Update ArduinoWifiShield_upgrade_mac.sh 2014-07-01 19:11:19 +02:00
Ankit Daftery 684e152fee Update ArduinoWifiShield_upgrade.sh
File path should be updated, is wrong currently, will throw an error saying files missing.
2014-07-01 19:09:49 +02:00
Cristian Maglie f4fad5f1a4 Merge branch 'master' into ide-1.5.x 2014-07-01 19:07:55 +02:00
Cristian Maglie c9329f580a Fixed permission on wifishield upgrade script. 2014-07-01 19:05:03 +02:00
Cristian Maglie eabead0245 Merge pull request #2118 from benoit-artefactlabs/wifishield-upgrade-firmware-mac-path
corrected wrong path to firmware binaries in wifishield upgrade script f...
2014-07-01 18:52:41 +02:00
Cristian Maglie 5c9f875c3f Merge branch 'master' into matthijskooijman-ide-1.5.x-timer-variant
Conflicts:
	app/src/processing/app/debug/Compiler.java
	hardware/arduino/sam/cores/arduino/main.cpp
2014-07-01 18:34:46 +02:00
Cristian Maglie 08f1010230 Merge branch 'ide-1.5.x-timer-variant' of github.com:matthijskooijman/Arduino into matthijskooijman-ide-1.5.x-timer-variant 2014-07-01 18:29:07 +02:00
Cristian Maglie 452cab0593 Merge pull request #2139 from cmaglie/init-variant
Allow variants to define an initVariant() function that is called at startup
2014-07-01 17:28:45 +02:00
Cristian Maglie 84bf36a96e Reverting -flto flag from AVR core until all compatibility problems are worked out.
For more info:
https://groups.google.com/a/arduino.cc/d/msg/developers/21G5w2HbUOg/NRMW6c9OIFUJ
2014-07-01 17:18:04 +02:00
Cristian Maglie a3989a494f Merge branch 'master' into ide-1.5.x 2014-06-30 18:26:56 +02:00
Cristian Maglie 07ef56e3cb Backported digitalPinToInterrupt macro from IDE 1.5.x 2014-06-30 18:24:08 +02:00
Kristian Lauszus 0c3ae05f59 Arduino Pro and Pro Mini should use eightanaloginputs variant, so all 8 analog pins can be used 2014-06-28 22:37:26 +02:00
Cristian Maglie b4fc466b47 initVariant() is now declared as external "C" function.
See #2080 for more details.
2014-06-27 14:26:32 +02:00
Cristian Maglie 1decf99e10 Merge branch 'ide-1.5.7' into ide-1.5.x 2014-06-27 13:44:18 +02:00
Matthijs Kooijman 0d40e5cace Support Atmega8 (and similar that define PE instead of UPE) again
These chips were previously supported, but since parity error checking
was added, this support has broken. Most chips define UPE0 (etc.) for
the parity error bit. Some chips don't have numbered UARTS so only
define UPE and even fewer define PE instead of UPE. This adds support
for those chips again.

Closes: #2137
2014-06-25 17:20:07 +02:00
Matthijs Kooijman 4fdf87c0e8 Allow variants to define an initVariant() function that is called at startup.
See #2080 and #2139.
2014-06-25 16:56:19 +02:00
Cristian Maglie 8cf34fd737 Removed patch for old malloc bug (no more useful with updated toolchain) 2014-06-25 10:14:35 +02:00
Federico Fissore 29fce3601d Fixed compilation error when targetting Mega. Error is caused by #2039 and this fix is just a workaround 2014-06-25 10:14:35 +02:00