Is serail.write() blocking?

Do I need to worry about over running buffers when calling serial.write()? Or will it block 'till it has room for the data I called it with? I can't find any info on how this works.

Thanks!

-jim lee

I can't find any info on how this works.

Why not? You have the source code. Look at it.

If there is no room in the buffer, the function blocks until there is room. On 1.0, the buffer size is 64 bytes. On 0023 and earlier, the buffer size was a bit smaller - 1 byte.

I have the source code? Really? Where?

-jim lee

On my Windows PC, version 0022:

C:\Documents and Settings\Owner\Desktop\arduino-0022\hardware\arduino\cores\arduino\HardwareSerial.h
C:\Documents and Settings\Owner\Desktop\arduino-0022\hardware\arduino\cores\arduino\HardwareSerial.cpp

Depends somewhat on where you installed it. So basically:

<install directory>\arduino\hardware\arduino\cores\arduino\HardwareSerial.h
<install directory>\arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp

Oh cool! Thanks!

-jim lee

On my Mac, version 1.0 it is:

/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.h
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp

Found it and it blocks. Was even a note about what it should be doing.

Thanks again, this will be a great help.

-jim lee