Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/master'
Former-commit-id: 9908f4e
  • Loading branch information
ricklon committed Mar 6, 2011
2 parents 6344571 + f76fdbd commit dcda09e
Show file tree
Hide file tree
Showing 24 changed files with 201 additions and 79 deletions.
25 changes: 22 additions & 3 deletions build/build.xml
@@ -1,17 +1,23 @@
<?xml version="1.0"?>
<project name="Arduino" default="build">
<!--echo message="os.name = ${os.name}" /-->
<!--echo message="os.arch = ${os.arch}" /-->
<!--echo message="os.version = ${os.version}" /-->

<!-- Sets properties for macosx/windows/linux depending on current system -->
<condition property="macosx"><os family="mac" /></condition>
<condition property="windows"><os family="windows" /></condition>
<condition property="linux"><os family="unix" /></condition>
<condition property="linux64"><os family="unix" arch="amd64" /></condition>

<condition property="platform"
value="macosx"><os family="mac" /></condition>
<condition property="platform"
value="windows"><os family="windows" /></condition>
<condition property="platform"
value="linux"><os family="unix" /></condition>
value="linux"><os family="unix" arch="i386" /></condition>
<condition property="platform"
value="linux64"><os family="unix" arch="amd64" /></condition>

<!-- Libraries required for running arduino -->
<fileset dir=".." id="runtime.jars">
Expand Down Expand Up @@ -317,13 +323,23 @@
<copy todir="linux/work" file="linux/dist/arduino" />
<chmod perm="755" file="linux/work/arduino" />
</target>

<target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
<copy tofile="linux/work/hardware/tools/avrdude" file="linux/dist/tools/avrdude64" overwrite="true" />
<copy tofile="linux/work/lib/librxtxSerial.so" file="linux/dist/lib/librxtxSerial64.so" overwrite="true" />
</target>

<target name="linux-run" depends="linux-build"
description="Run Linux version">
description="Run Linux (32-bit) version">
<exec executable="./linux/work/arduino" spawn="false"/>
</target>

<target name="linux-dist" depends="linux-build"
<target name="linux64-run" depends="linux64-build"
description="Run Linux (64-bit) version">
<exec executable="./linux/work/arduino" spawn="false"/>
</target>

<target name="linux-dist" depends="build"
description="Build .tar.gz of linux version">

<!--get src="http://dev.processing.org/build/jre-tools-6u18-linux-i586.tgz"
Expand Down Expand Up @@ -358,7 +374,10 @@
=======================================================
</echo>
</target>


<target name="linux64-dist" depends="linux-dist"
description="Build .tar.gz of linux version" />

<!-- - - - - - - - -->
<!-- Windows -->
Expand Down
Binary file added build/linux/dist/lib/librxtxSerial64.so
Binary file not shown.
Binary file added build/linux/dist/tools/avrdude64
Binary file not shown.
Expand Up @@ -38,7 +38,7 @@ void loop()
// prints value unaltered, i.e. the raw binary version of the
// byte. The serial monitor interprets all bytes as
// ASCII, so 33, the first number, will show up as '!'
Serial.print(thisByte, BYTE);
Serial.write(thisByte);

Serial.print(", dec: ");
// prints value as string as an ASCII-encoded decimal (base 10).
Expand Down
8 changes: 4 additions & 4 deletions build/shared/examples/4.Communication/MIDI/Midi.pde
Expand Up @@ -29,7 +29,7 @@ void setup() {

void loop() {
// play notes from F#-0 (0x1E) to F#-5 (0x5A):
for (intnote = 0x1E; note < 0x5A; note ++) {
for (int note = 0x1E; note < 0x5A; note ++) {
//Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
noteOn(0x90, note, 0x45);
delay(100);
Expand All @@ -42,8 +42,8 @@ void loop() {
// plays a MIDI note. Doesn't check to see that
// cmd is greater than 127, or that data values are less than 127:
void noteOn(int cmd, int pitch, int velocity) {
Serial.print(cmd, BYTE);
Serial.print(pitch, BYTE);
Serial.print(velocity, BYTE);
Serial.write(cmd);
Serial.write(pitch);
Serial.write(velocity);
}

Expand Up @@ -28,6 +28,6 @@ void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.print(inByte, BYTE);
Serial.write(inByte);
}
}
Expand Up @@ -52,15 +52,15 @@ void loop()
// read switch, map it to 0 or 255L
thirdSensor = map(digitalRead(2), 0, 1, 0, 255);
// send sensor values:
Serial.print(firstSensor, BYTE);
Serial.print(secondSensor, BYTE);
Serial.print(thirdSensor, BYTE);
Serial.write(firstSensor);
Serial.write(secondSensor);
Serial.write(thirdSensor);
}
}

void establishContact() {
while (Serial.available() <= 0) {
Serial.print('A', BYTE); // send a capital A
Serial.print('A'); // send a capital A
delay(300);
}
}
Expand Down
2 changes: 1 addition & 1 deletion hardware/arduino/cores/arduino/HardwareSerial.cpp
Expand Up @@ -191,7 +191,7 @@ HardwareSerial::HardwareSerial(ring_buffer *rx_buffer,

// Public Methods //////////////////////////////////////////////////////////////

void HardwareSerial::begin(long baud)
void HardwareSerial::begin(unsigned long baud)
{
uint16_t baud_setting;
bool use_u2x = true;
Expand Down
2 changes: 1 addition & 1 deletion hardware/arduino/cores/arduino/HardwareSerial.h
Expand Up @@ -50,7 +50,7 @@ class HardwareSerial : public Stream
volatile uint8_t *ucsra, volatile uint8_t *ucsrb,
volatile uint8_t *udr,
uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre, uint8_t u2x);
void begin(long);
void begin(unsigned long);
void end();
virtual int available(void);
virtual int peek(void);
Expand Down
2 changes: 1 addition & 1 deletion hardware/arduino/cores/arduino/Print.cpp
Expand Up @@ -45,7 +45,7 @@ void Print::write(const uint8_t *buffer, size_t size)

void Print::print(const String &s)
{
for (int i = 0; i < s.length(); i++) {
for (unsigned int i = 0; i < s.length(); i++) {
write(s[i]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion hardware/arduino/cores/arduino/WString.h
Expand Up @@ -67,7 +67,7 @@ class String
int lastIndexOf( char ch, unsigned int fromIndex ) const;
int lastIndexOf( const String &str ) const;
int lastIndexOf( const String &str, unsigned int fromIndex ) const;
const unsigned int length( ) const { return _length; }
unsigned int length( ) const { return _length; }
void setCharAt(unsigned int index, const char ch);
unsigned char startsWith( const String &prefix ) const;
unsigned char startsWith( const String &prefix, unsigned int toffset ) const;
Expand Down
84 changes: 42 additions & 42 deletions hardware/arduino/cores/arduino/pins_arduino.c
Expand Up @@ -81,50 +81,50 @@
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
&DDRA,
&DDRB,
&DDRC,
&DDRD,
&DDRE,
&DDRF,
&DDRG,
&DDRH,
(uint16_t) &DDRA,
(uint16_t) &DDRB,
(uint16_t) &DDRC,
(uint16_t) &DDRD,
(uint16_t) &DDRE,
(uint16_t) &DDRF,
(uint16_t) &DDRG,
(uint16_t) &DDRH,
NOT_A_PORT,
&DDRJ,
&DDRK,
&DDRL,
(uint16_t) &DDRJ,
(uint16_t) &DDRK,
(uint16_t) &DDRL,
};

const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
&PORTA,
&PORTB,
&PORTC,
&PORTD,
&PORTE,
&PORTF,
&PORTG,
&PORTH,
(uint16_t) &PORTA,
(uint16_t) &PORTB,
(uint16_t) &PORTC,
(uint16_t) &PORTD,
(uint16_t) &PORTE,
(uint16_t) &PORTF,
(uint16_t) &PORTG,
(uint16_t) &PORTH,
NOT_A_PORT,
&PORTJ,
&PORTK,
&PORTL,
(uint16_t) &PORTJ,
(uint16_t) &PORTK,
(uint16_t) &PORTL,
};

const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PIN,
&PINA,
&PINB,
&PINC,
&PIND,
&PINE,
&PINF,
&PING,
&PINH,
(uint16_t) &PINA,
(uint16_t) &PINB,
(uint16_t) &PINC,
(uint16_t) &PIND,
(uint16_t) &PINE,
(uint16_t) &PINF,
(uint16_t) &PING,
(uint16_t) &PINH,
NOT_A_PIN,
&PINJ,
&PINK,
&PINL,
(uint16_t) &PINJ,
(uint16_t) &PINK,
(uint16_t) &PINL,
};

const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
Expand Down Expand Up @@ -358,25 +358,25 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
&DDRB,
&DDRC,
&DDRD,
(uint16_t) &DDRB,
(uint16_t) &DDRC,
(uint16_t) &DDRD,
};

const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
&PORTB,
&PORTC,
&PORTD,
(uint16_t) &PORTB,
(uint16_t) &PORTC,
(uint16_t) &PORTD,
};

const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
&PINB,
&PINC,
&PIND,
(uint16_t) &PINB,
(uint16_t) &PINC,
(uint16_t) &PIND,
};

const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
Expand Down
4 changes: 2 additions & 2 deletions libraries/Ethernet/examples/PachubeClient/PachubeClient.pde
Expand Up @@ -28,15 +28,15 @@ byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
// assign an IP address for the controller:
byte ip[] = {
192,169,1,20 };
192,168,1,20 };
byte gateway[] = {
192,168,1,1};
byte subnet[] = {
255, 255, 255, 0 };

// The address of the server you want to connect to (pachube.com):
byte server[] = {
209,40,205,190 };
173,203,98,29 };

// initialize the library instance:
Client client(server, 80);
Expand Down
Expand Up @@ -30,15 +30,15 @@ byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
// assign an IP address for the controller:
byte ip[] = {
192,169,1,20 };
192,168,1,20 };
byte gateway[] = {
192,168,1,1};
byte subnet[] = {
255, 255, 255, 0 };

// The address of the server you want to connect to (pachube.com):
byte server[] = {
209,40,205,190 };
173,203,98,29 };

// initialize the library instance:
Client client(server, 80);
Expand Down
1 change: 0 additions & 1 deletion libraries/Ethernet/utility/socket.cpp
Expand Up @@ -9,7 +9,6 @@ static uint16_t local_port;
*/
uint8_t socket(SOCKET s, uint8_t protocol, uint16_t port, uint8_t flag)
{
uint8_t ret;
if ((protocol == SnMR::TCP) || (protocol == SnMR::UDP) || (protocol == SnMR::IPRAW) || (protocol == SnMR::MACRAW) || (protocol == SnMR::PPPOE))
{
close(s);
Expand Down
4 changes: 2 additions & 2 deletions libraries/Ethernet/utility/w5100.cpp
Expand Up @@ -134,7 +134,7 @@ uint8_t W5100Class::write(uint16_t _addr, uint8_t _data)

uint16_t W5100Class::write(uint16_t _addr, uint8_t *_buf, uint16_t _len)
{
for (int i=0; i<_len; i++)
for (uint16_t i=0; i<_len; i++)
{
setSS();
SPI.transfer(0xF0);
Expand All @@ -160,7 +160,7 @@ uint8_t W5100Class::read(uint16_t _addr)

uint16_t W5100Class::read(uint16_t _addr, uint8_t *_buf, uint16_t _len)
{
for (int i=0; i<_len; i++)
for (uint16_t i=0; i<_len; i++)
{
setSS();
SPI.transfer(0x0F);
Expand Down
8 changes: 4 additions & 4 deletions libraries/Firmata/examples/EchoString/EchoString.pde
Expand Up @@ -14,12 +14,12 @@ void stringCallback(char *myString)

void sysexCallback(byte command, byte argc, byte*argv)
{
Serial.print(START_SYSEX, BYTE);
Serial.print(command, BYTE);
Serial.write(START_SYSEX);
Serial.write(command);
for(byte i=0; i<argc; i++) {
Serial.print(argv[i], BYTE);
Serial.write(argv[i]);
}
Serial.print(END_SYSEX, BYTE);
Serial.write(END_SYSEX);
}

void setup()
Expand Down
Expand Up @@ -71,7 +71,7 @@ void loop() {
thisChar = 'a';
}
// print the character
lcd.print(thisChar, BYTE);
lcd.write(thisChar);
// wait a second:
delay(1000);
// increment the letter:
Expand Down
2 changes: 1 addition & 1 deletion libraries/LiquidCrystal/examples/setCursor/setCursor.pde
Expand Up @@ -61,7 +61,7 @@ void loop() {
// set the cursor position:
lcd.setCursor(thisRow,thisCol);
// print the letter:
lcd.print(thisLetter, BYTE);
lcd.write(thisLetter);
delay(200);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/SD/File.cpp
Expand Up @@ -27,7 +27,7 @@ void File::write(const uint8_t *buf, size_t size) {
}

int File::peek() {
char c = SD.file.read();
int c = SD.file.read();
if (c != -1) SD.file.seekCur(-1);
return c;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/SD/SD.h
Expand Up @@ -21,7 +21,7 @@
#include <utility/SdFatUtil.h>

#define FILE_READ O_READ
#define FILE_WRITE (O_READ | O_WRITE | O_CREAT | O_SYNC)
#define FILE_WRITE (O_READ | O_WRITE | O_CREAT)

class File : public Stream {
public:
Expand Down

0 comments on commit dcda09e

Please sign in to comment.