1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00
Commit Graph

4106 Commits

Author SHA1 Message Date
Cristian Maglie
974613a0a2 [sam] Fixed architecture specific macro digitalPinToTimer, added comment to uninplemented portModeRegister
Fix #1833
2014-09-22 00:38:02 +02:00
Arnav Gupta
4dd931a99a set correct max size for mega2560 (to address issue #2277)
Signed-off-by: Arnav Gupta <championswimmer@gmail.com>
2014-09-21 17:10:06 +05:30
Cristian Maglie
0d86acc274 Update revision log 2014-09-20 19:47:29 +02:00
Arnav Gupta
15064ad96a set correct max size for mega2560
Signed-off-by: Arnav Gupta <championswimmer@gmail.com>
2014-09-20 03:09:54 +05:30
Cristian Maglie
7531a3571d update revision log 2014-09-16 12:53:46 +02:00
Cristian Maglie
84518e442c Fixed attribution rights for SAM delayMicroseconds function 2014-09-16 12:31:16 +02:00
Cristian Maglie
44bcd2040b 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
90bd172f30 Updated revision log. Version upped to 1.0.6. 2014-09-16 12:16:06 +02:00
Cristian Maglie
88b487f480 Removed todo.txt (leftover) and updated build.xml accordingly 2014-09-16 12:14:03 +02:00
Cristian Maglie
5f67650b80 Fixed trivial include error introduced in previous commit 2e3e539b... oops... 2014-09-12 16:58:05 +02:00
Cristian Maglie
8018a26e3d 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
2e3e539b71 Added license to USBAPI.h
Close #1847
2014-09-12 12:27:39 +02:00
Cristian Maglie
69e37647a6 Ported #1397 to SAM. 2014-09-12 12:06:00 +02:00
Cristian Maglie
3d222cc372 Merge pull request #1937 from matthijskooijman/stringindex
String index fixes and cleanups
2014-09-12 11:56:12 +02:00
Cristian Maglie
6a5b82f062 [sam] Implementation of SPI multibyte transfer 2014-09-11 17:50:00 +02:00
Cristian Maglie
5f88564b2b [sam] Simplified formula for SPI speed 2014-09-11 13:57:08 +02:00
Cristian Maglie
848dd39313 [sam] SPI library: added SPI_HAS_EXTENDED_CS_PIN_HANDLING flag
This allows to check if SPI provides extended API to allow automatic
CS pin handling.
2014-09-11 13:57:07 +02:00
Cristian Maglie
11cf45d6d6 Fix indent and small cosmetic changes 2014-09-10 18:22:02 +02:00
Matthijs Kooijman
04dba1e46f 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
6f9674288b 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
86015f441e 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
2068f88a21 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
2b90124e3d 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
82e04ba325 Merge pull request #2284 from cmaglie/ide-1.5.x-cxx-abi-compat
Correct implementation of gcc specific internal functions (take 2)
2014-09-08 19:14:04 +02:00
Cristian Maglie
9a8b9c5c58 Fixed license for new.cpp and small cosmetic changes 2014-09-06 12:44:53 +02:00
Cristian Maglie
37ee800abd 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
b0b83625c1 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
07e3e83424 Added new/delete stubs for Arduino Due
Fix #1485
A better implementation may be desirable as discussed in #108
2014-09-06 10:26:59 +02:00
Cristian Maglie
b7b9da7710 Updated version to 1.5.8 2014-09-05 10:11:47 +02:00
Cristian Maglie
aa776b30ba Fix for upload problems on Arduino Leonardo (and derivatives) with OSX 10.9.4 2014-09-01 12:16:41 +02:00
Cristian Maglie
fd3ec2531c Merge pull request #2268 from arduino/ide-1.5.x-slowed-down-consoleread
Bridge: slowing down ConsoleRead a bit
2014-08-28 15:54:26 +02:00
Federico Fissore
98da28a3ce Bridge: slowing down ConsoleRead a bit to keep the python side of the Bridge from consuming 100% of the CPU 2014-08-28 13:25:57 +02:00
Cristian Maglie
b50cfb9f06 Merge pull request #2260 from arduino/ide-1.5.x-autobuild-pr
Automatically build pull requests
2014-08-26 10:01:50 +02:00
Cristian Maglie
e9e257bcdf Merge pull request #2258 from QuentinPerez/fix-descriptor-firmware
fix Descriptor.c
2014-08-25 22:14:57 +02:00
Federico Fissore
a62dcc2804 PR Autobuild: removed useless final echos 2014-08-25 18:19:05 +02:00
Federico Fissore
b12e659c7c PR Autobuild: fixed artifact name 2014-08-25 18:18:03 +02:00
Federico Fissore
a5ea0a9d01 Script used by the Jenkins Github Pull Request Builder plugin 2014-08-25 18:00:25 +02:00
qperez42@gmail.com
70bc56275d fix Descriptor.c 2014-08-25 09:52:10 +02:00
Cristian Maglie
ec1310e1bd Removed --no-op from CLI. Preferences now not-saved by default.
See https://github.com/arduino/Arduino/pull/2000 for details.

Close #2000
2014-08-22 15:39:33 +02:00
Cristian Maglie
e3dc5e75e3 Removed unused variables. Small cosmetic changes. 2014-08-22 14:24:21 +02:00
Matthijs Kooijman
83ede8fdb4 Fix preference directory opening in the GUI with --preferences-file
In the preferences dialog, the name of the preferences file is shown for
advanced editing. If the filename is clicked, the folder containing the
file is opened. However, this always used Base.getSettingsFolder, which
is the folder where the settings file _normally_ resides. But when the
--preferences-file option is used, the actual preferences file might be
somewhere else.

This commit makes sure to always open up the parent directory of the
actual preferences file in use, instead of always the default one.
2014-08-19 09:16:49 +02:00
Matthijs Kooijman
f47ec35ebe If build.path is specified, create it if needed
When no build.path preference is present, a temporary directory is
automatically created (and deleted). When a build.path was specified,
but the directory does not exist, the IDE would show an error and fail
to build, which is unexpected and not so friendly.

This commit makes sure that the build directory is automatically
created.
2014-08-19 09:16:49 +02:00
Matthijs Kooijman
c959388b37 Let Editor::statusError print to stderr
Before, these were only shown in the GUI, which makes a failing
commandline build a bit puzzling. As a side effect, the error is now
shown in the log area in addition to the status line above the log
area, but that should be ok.
2014-08-19 09:16:49 +02:00
Matthijs Kooijman
cc773fb1e0 Take into account --curdir for all relative paths
In a lot of places, (potentially) relative paths were passed to File
without any processing, making them be resolved without taking into
account --curdir. By passing them through Base.absoluteFile instead,
these paths are resolved relative to the working directory before
starting arduino (at least on Linux, which is currently the only
platform supporting --curdir).

This applies --curdir to the --preferences-file option and the
build.path, settings.path, sketchbook.path preferences.

For example, this now works as expected:

  arduino --pref build.path=build_dir --verify Blink.ino
2014-08-19 09:16:49 +02:00
Matthijs Kooijman
4f33d0851c Fix opening a non-primary .ino file
When a sketch looks like this:

    Blink/
        Blink.ino
        Foo.ino

The idea is that opening Foo.ino should open up the sketch. However,
before this would show an error stating "The file Foo.ino needs to be
inside a sketch folder named Foo" instead.

This turned out to be due to a typo, which seems to have been present
for a long time. Note that when the main sketch file was a .pde file,
everything already worked as expected.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman
f96d71f32d Fix --curdir on Windows
On Windows, files are canonicalized to prevent issues with legacy 8.3
filenames. However, this canonicalization includes making the path
absolute and this happened before applying --curdir to the path, making
the latter a noop.

By reversing the operations, this should allow both of them to do their
work.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman
31fe4ac0c2 Add Base.absoluteFile method
This method takes filenames as specified on the commandline and turns
them into the right File object, taking into account the current
directory passed through --curdir by the wrapper script.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman
0798e1cf6f Pass around sketch File objects instead of filenames
This saves a few conversions from File object to String and is generally
cleaner.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman
87bdaa88cd Parse --curdir in Base.main()
This shouldn't change any behaviour, but prepares for upcoming changes.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman
cf4fb7d0e3 Don't re-parse arguments to --preferences-file
Previously, the argument to --preferences-file would be interpreted as a
filename, but then also checked as an option as well (in the next loop
iteration). This didn't really matter in practice (unless you would be
using a file called "--preferences-file"), but better skip the argument
anyway.
2014-08-19 09:16:48 +02:00