Commit Graph

36 Commits

Author SHA1 Message Date
Martino Facchin 8dfa9dfb9e pulseIn: add alternative implementation based on micros()
pulseInLong is suitable for long pulses in interrupt context
2015-05-29 15:01:38 +02:00
Chris--A 9dc724b9d9 Modified randomSeed, now uses unsigned long. 2015-05-21 16:52:42 +10:00
Cristian Maglie 17db7a7843 Arduino custom type boolean is now mapped to bool type
Fixes #2151
Fixes #2147
2015-01-07 14:56:19 +01: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
Cristian Maglie b4fc466b47 initVariant() is now declared as external "C" function.
See #2080 for more details.
2014-06-27 14:26:32 +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
Matthijs Kooijman 3a48c9240d Support TIMER1C
Some devices, such as the atmega2560 or the atmega256rfr2 have a timer1c
output. It seems this output is not connected to anything on the Arduino
Mega, but this allows using it on third party hardware nonetheless.
2014-05-16 18:57:04 +02:00
Matthijs Kooijman a2408d154e Instead of #defining true and false, include stdbool.h
In C++, true and false are language keywords, so there is no need to
define them as macros. Including stdbool.h in C++ effectively changes
nothing. In C, true, false and also the bool type are not available, but
including stdbool.h will make them available.

Using stdbool.h means that we get true, false and the bool type in
whatever way the compiler thinks is best, which seems like a good idea
to me.

This also fixes the following compiler warnings if a .c file includes
both stdbool.h and Arduino.h:

	warning: "true" redefined [enabled by default]
	 #define true 0x1

	warning: "false" redefined [enabled by default]
	#define false 0x0

This fixes #1570 and helps toward fixing #1728.

This only changed the AVR core, the SAM core already doesn't define true
and false (but doesn't include stdbool.h either).
2014-02-19 16:09:29 +01:00
Cristian Maglie 291f5493ec Added license for Arduino.h, binary.h and main.cpp (master branch)
See #1847 and #1117
2014-02-13 17:48:47 +01:00
Cristian Maglie dfde3ec99f Added license for Arduino.h, binary.h and main.cpp
See #1847
2014-02-10 12:55:16 +01:00
Matthijs Kooijman 99f7ef7c67 Centrally decide which hardware UARTS are available
Before, this decision was made in few different places, based on
sometimes different register defines.

Now, HardwareSerial.h decides wich UARTS are available, defines
USE_HWSERIALn macros and HardwareSerial.cpp simply checks these macros
(together with some #ifs to decide which registers to use for UART 0).
For consistency, USBAPI.h also defines a HAVE_CDCSERIAL macro when
applicable.

For supported targets, this should change any behaviour. For unsupported
targets, the error messages might subtly change because some checks are
moved or changed.

Additionally, this moves the USBAPI.h include form HardareSerial.h into
Arduino.h and raises an error when both CDC serial and UART0 are
available (previously this would silently use UART0 instead of CDC, but
there is not currently any Atmel chip available for which this would
occur).
2014-01-22 09:38:34 +01:00
Matthijs Kooijman 494929495e Define a _NOP() macro
Recent avr-libc releases define one, but this allows using it also on
older avr-libc releases.
2014-01-16 16:29:41 +01:00
Federico Fissore 1c99bf0e83 Removed = char from #define. See https://github.com/arduino/Arduino/issues/1792#issuecomment-31650586 2014-01-06 18:20:37 +01:00
Federico Fissore 64a9681935 Added new EULER constant. Fixes #1792 2014-01-06 09:48:34 +01:00
Cristian Maglie 9b4562c4c5 Using NOT_AN_INTERRUPT defined constant 2013-10-31 12:44:24 +01:00
Cristian Maglie 7207108255 Merged 1.0.5
Still missing:
- updates to WiFi lib for sam.
- updates to examples of Ehternet and WiFi for sam.

Merge remote-tracking branch 'arduino/master' into ide-1.5.x

Conflicts:
	app/src/processing/app/Base.java
	app/src/processing/app/Editor.java
	app/src/processing/app/helpers/FileUtils.java
	app/src/processing/app/i18n/Resources_fr.po
	app/src/processing/app/i18n/Resources_fr.properties
	build/shared/revisions.txt
	hardware/arduino/avr/libraries/Ethernet/examples/DnsWebClient/DnsWebClient.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiChatServer/WifiChatServer.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiPachubeClient/WifiPachubeClient.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiPachubeClientString/WifiPachubeClientString.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiTwitterClient/WifiTwitterClient.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiUdpSendReceiveString/WifiUdpSendReceiveString.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiWebClient/WifiWebClient.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiWebClientRepeating/WifiWebClientRepeating.ino
	hardware/arduino/avr/libraries/WiFi/examples/WifiWebServer/WifiWebServer.ino
	libraries/WiFi/examples/WiFiChatServer/WiFiChatServer.ino
	libraries/WiFi/examples/WiFiPachubeClient/WiFiPachubeClient.ino
	libraries/WiFi/examples/WiFiPachubeClientString/WiFiPachubeClientString.ino
	libraries/WiFi/examples/WiFiTwitterClient/WiFiTwitterClient.ino
	libraries/WiFi/examples/WiFiUdpSendReceiveString/WiFiUdpSendReceiveString.ino
	libraries/WiFi/examples/WiFiWebClient/WiFiWebClient.ino
	libraries/WiFi/examples/WiFiWebClientRepeating/WiFiWebClientRepeating.ino
	libraries/WiFi/examples/WiFiWebServer/WiFiWebServer.ino
	libraries/WiFi/examples/WifiChatServer/WifiChatServer.ino
	libraries/WiFi/examples/WifiPachubeClient/WifiPachubeClient.ino
	libraries/WiFi/examples/WifiPachubeClientString/WifiPachubeClientString.ino
	libraries/WiFi/examples/WifiTwitterClient/WifiTwitterClient.ino
	libraries/WiFi/examples/WifiUdpSendReceiveString/WifiUdpSendReceiveString.ino
	libraries/WiFi/examples/WifiWebClient/WifiWebClient.ino
	libraries/WiFi/examples/WifiWebClientRepeating/WifiWebClientRepeating.ino
	libraries/WiFi/examples/WifiWebServer/WifiWebServer.ino
2013-05-11 14:37:25 +02:00
Kristian Sloth Lauszus ed42d95412 Added support for all variants of Sanguino 2013-04-04 20:55:15 +02:00
Federico Fissore c453e0a32e fixed permissions on a lot of text files. see #1116 2012-12-10 10:42:49 +01:00
Cristian Maglie 69aead513d Added general yield()-hook for cooperative scheduling development (part 2) 2012-11-02 18:12:21 +01:00
Cristian Maglie 6e2b0e8755 Added general yield()-hook for cooperative scheduling development 2012-10-31 01:37:37 +01:00
David A. Mellis 6d296e0fab Adding ATmega644P check to ATmega1284P check. 2012-10-09 13:53:09 -04:00
David A. Mellis 1a0f22225b Moving ATmega32U4 Timer 2 #undef's to Leonardo pins_arduino.h file. 2012-09-13 09:19:52 -04:00
Shigeru KANEMOTO 4293079076 Fix for tone() on Leonardo. 2012-08-08 18:27:40 +09:00
David A. Mellis 6c00397e22 Adding INPUT_PULLUP option pinMode(). (Paul Stoffregen).
This also changes pinMode(pin, INPUT); to explicitly disable the pull-up resistor, even if it was previously set.

http://code.google.com/p/arduino/issues/detail?id=246
2012-01-02 14:20:28 -05:00
David A. Mellis 3ece2827a4 Simplifying microseconds <-> clock cycles conversions. (Rob Tillaart)
This should fix problems with overflows in pulseIn().  It may make millis() slightly less precise for clock speeds that aren't multiple of 1 million, but we don't really support those anyway.

http://code.google.com/p/arduino/issues/detail?id=675
2011-12-30 18:05:12 -05:00
David A. Mellis a9d1368e4c Updated reference voltage defines for ATmega1284P.
http://code.google.com/p/arduino/issues/detail?id=728
2011-12-02 17:18:15 -05:00
David A. Mellis 8d48010edf Moving ARDUINO_MAIN from main.cpp to wiring_digital.c and hiding PA, PB, etc.
http://code.google.com/p/arduino/issues/detail?id=677
http://code.google.com/p/arduino/issues/detail?id=691
2011-10-24 16:50:15 -04:00
David A. Mellis 85f10a7150 Correcting analogReference() constants for ATtiny24/44/84 and 25/45/85.
DEFAULT, EXTERNAL, and INTERNAL have different values on those processors.
2011-10-24 15:44:01 -04:00
Zach Eveland 5bbe2a63e4 added support for TIMER4D used for PWM on Leonardo and Micro D6 2011-09-16 16:36:42 -04:00
David A. Mellis a19a23ff92 Factoring pin definitions out of the core.
That is, there's now a pins/ directory in a platform, which includes multiple directories, each of which has its own pins_arduino.h.  The boards.txt gets a new preferences, <BOARD>.build.pins, whose values is a sub-directory of the pins/ directory (possibly with a "platform:" prefix).  That sub-directory is then placed in the include path during compilation.
2011-03-04 21:05:05 -05:00
David A. Mellis 6cd58c57db Moving all pin definitions into pins_arduino.h.
This is a step towards providing portability across AVR's by simply including an appropriate header file.
2011-03-03 23:54:33 -05:00
David A. Mellis 58d683239d Removing optimized digitalWrite(), digitalRead(), pinMode(). 2011-03-03 18:46:45 -05:00
David A. Mellis d7a87f18f0 Re-arranging header files and small fixes to optimized core functions. 2011-03-02 23:05:25 -05:00
David A. Mellis 218eb5e807 Moving wiring.h contents into Arduino.h. 2011-03-01 20:00:16 -05:00
David A. Mellis e009c5c6c6 Renamed WProgram.h to Arduino.h. 2011-03-01 19:52:13 -05:00