Commit Graph

34 Commits

Author SHA1 Message Date
David A. Mellis 77cdeb5b93 Fixing more warnings (Paul Stoffregen). 2011-10-10 11:28:44 -04:00
Zach Eveland c0ad36ad43 Merge branch 'new-extension' of https://github.com/arduino/Arduino into new-extension
Conflicts:
	build/linux/dist/tools/avrdude.conf
2011-09-08 20:26:47 -04:00
David A. Mellis 3c66dc1b8d Changing to a simpler mental model for serialEvent (Paul Stoffregen).
http://code.google.com/p/arduino/issues/detail?id=626
2011-09-07 17:47:17 -04:00
Zach Eveland 95fd39090e changed baudrate for auto-reset-and-upload back to 1200 bps. specified arduino protocol for Leonardo avrdude upload. 2011-09-05 13:08:05 -04:00
Zach Eveland 280f381265 Merge branch 'new-extension' of https://github.com/arduino/Arduino into new-extension
Conflicts:
	build/macosx/dist/tools-universal.zip
	build/windows/avr_tools.zip
	hardware/arduino/cores/arduino/HardwareSerial.cpp
2011-09-05 12:53:45 -04:00
David A. Mellis 7b0d88b954 Moving serialEvent() calls from RX interrupts to main for() loop (after loop()).
http://code.google.com/p/arduino/issues/detail?id=584
2011-08-31 15:52:56 -04:00
Zach Eveland 4ce1dea595 Merge branch 'mainline' into new-extension 2011-08-30 08:38:06 -04:00
David A. Mellis 5130a13294 Moving write errors out of return value into separate API methods.
write(), print(), println() now return size_t (and don't use negative values to signal errors).
Print adds writeError() for checking for write errors, clearWriteError() to reset the flag to false, and a protected setWriteError() for signalling errors.

http://code.google.com/p/arduino/issues/detail?id=598
2011-08-26 16:08:14 -04:00
David A. Mellis 0635790dd1 Changing from long to ssize_t (int) for write(), print(), println() return. 2011-08-26 14:20:41 -04:00
David A. Mellis f282cbaf96 write(), print(), and println() now return number of bytes written.
The type is long, and negative values indicate errors.  Needs more testing.
http://code.google.com/p/arduino/issues/detail?id=551
2011-08-23 19:12:03 -04:00
Zach Eveland 7d575222af HW Serial on pins 0 and 1 works. Accessed by Serial1.* methods 2011-08-18 19:40:04 -04:00
Zach Eveland 4c537c1b6d committed USB API, initial HardwareSerial-USBSerial integration 2011-08-11 14:08:38 -04:00
David A. Mellis 664e9af2cd Fixing 300 baud communication for serial.
Because UBBR is only 12 bits, we were overflowing it at 300 baud because of the use of the U2X bit.  Now we turn off U2X if it would yield a UBBR value that would overflow.

Note that this breaks 300 baud communication with the computer on the Uno and Mega 2560 because the 8U2 USB-serial firmware has this same bug (and previously they cancelled each other out).  Since, however, it seems more likely that people will need to use 300 baud to communicate with other (legacy) hardware than with the computer, I'm making this change.  Issue for 8U2 firmware bug: http://code.google.com/p/arduino/issues/detail?id=542

http://code.google.com/p/arduino/issues/detail?id=522
2011-05-20 13:29:13 -04:00
David A. Mellis 90c487402c Small optimization in HardwareSerial.
begin(long) -> begin(unsigned long)

Conflicts:

	hardware/arduino/cores/arduino/HardwareSerial.h
2011-05-12 16:58:56 -04:00
David A. Mellis ac5defcea6 Adding serialEvent(), serialEvent1(), etc.
Called from within the serial receive interrupt.  These are implemented as an empty weak function in the core that be overridden by the user's sketch.

http://code.google.com/p/arduino/issues/detail?id=263
2011-05-07 13:04:13 -04:00
David A. Mellis 111c55581b Refactoring the UART0 / USART0 receive interrupt handler. 2011-05-07 12:47:43 -04:00
David A. Mellis c7c7302d9d Changing Serial.flush() to write outgoing data, not drop incoming data.
This brings it in line with most other uses of flush(), both in and out of Arduino.
http://code.google.com/p/arduino/issues/detail?id=497
2011-05-07 12:05:27 -04:00
David A. Mellis 0ba1f0ec50 Flushing outgoing and incoming data in Serial.end().
That is, waiting for outgoing data to transmit and dropping any received data.
2011-03-06 12:20:42 -05:00
David A. Mellis 01d82d8277 Fixing race condition in Serial write (Brian Cook). 2011-03-06 11:47:18 -05:00
David A. Mellis d8d233ad3e Implemented serial transmit buffering.
Now Serial.write() places characters in the transmit buffer, and the data register empty interrupt reads and transmit them.  Based loosely on the implementation here: ftp://wookey.org.uk/arduino.

http://code.google.com/p/arduino/issues/detail?id=262
2011-03-05 14:17:26 -05:00
David A. Mellis 218eb5e807 Moving wiring.h contents into Arduino.h. 2011-03-01 20:00:16 -05:00
David A. Mellis 407d6bbc6f Cast to encourage optimization of Serial ring buffer index calculations.
http://code.google.com/p/arduino/issues/detail?id=391
2010-11-11 23:29:21 -05:00
David A. Mellis 08102b6370 Changing baud rate calculation to always use double speed mode except for 57600 baud at 16 MHz.
http://code.google.com/p/arduino/issues/detail?id=394
2010-11-11 23:28:21 -05:00
David A. Mellis 8b09b6be80 Making HardwareSerial tests register-based, not CPU-based.
Mark Sproul's patches, via Christian Maglie.
http://code.google.com/p/arduino/issues/detail?id=315
2010-10-17 13:36:02 -04:00
David A. Mellis f9a3b5cfa9 1280 -> 1280/2560. 2010-09-08 22:33:33 +00:00
David A. Mellis 2b1c9aea35 changing available() to return an int (because the Ethernet Client class or another stream might need more than 255 bytes). 2010-08-02 22:23:48 +00:00
David A. Mellis d3cb43c1c9 Adding a peek() function to Stream and HardwareSerial (Serial). 2010-07-04 23:31:55 +00:00
David A. Mellis 2c32369685 Adding support for printing Strings to the Print class. 2010-07-04 23:22:34 +00:00
David A. Mellis fe28586154 Adding Serial.end(). 2009-12-23 00:00:17 +00:00
David A. Mellis 35f5f6e99f Improving third-party hardware support:
- moving back to multple cores per platform
- using target instead of platform
- moving per-board and per-programmer preferences out of Preferences.java and into a new Target class
- adding a new "target" preference
- support for platform:value values in board preferences for bootloader path and core
- XXX: need to support platform:value syntax for board upload.using preferences.
2009-11-21 23:23:43 +00:00
David A. Mellis 584dece7b0 Moving things around. 2009-11-07 17:05:21 +00:00
David A. Mellis 12ea12d14c Adding improved baud rate calculation, including use (or not) of the U2X bit. (Code from gabebear). 2009-07-12 02:58:59 +00:00
David A. Mellis 2fc32fc341 Clearing the U2Xn bit in Serial.begin() (because it is set on the Pro / Pro Mini 328). Fixing some indentation. 2009-07-12 01:58:15 +00:00
David A. Mellis db605dd18b First integration of the Arduino code in Processing 5503: PreProcessor and Compiler have been integrated with changes to the Sketch.
Compilation still has problems (Thread error on success, and can't handle non-pde files in a sketch).
Modified the Mac OS X make.sh to copy the hardware, avr tools, and example over.
Removing some of the antlr stuff.  
Disabling the Commander (command-line execution) for now.
Added Library, LibraryManager, and Target.
Added support for prefixed preferences (e.g. for boards and programmers).
2009-06-01 08:32:11 +00:00