Revision 1658
wireless: fixed debug statements and flash memory
serial.c | ||
---|---|---|
141 | 141 |
* @return 0 if init succesfull, an error code otherwise |
142 | 142 |
**/ |
143 | 143 |
int usb_puts_P (PGM_P s) { |
144 |
char buf; |
|
145 |
|
|
146 | 144 |
if(!usb_initd) |
147 | 145 |
return ERROR_LIBRARY_NOT_INITD; |
148 |
|
|
149 |
while (memcpy_P (&buf, s, sizeof (char)), buf!=0) { |
|
150 |
usb_putc (buf); |
|
151 |
s++; |
|
146 |
|
|
147 |
while (pgm_read_byte(s) != 0x00) { |
|
148 |
// Wait until buffer is clear for sending |
|
149 |
loop_until_bit_is_set(UCSR0A, UDRE0); |
|
150 |
|
|
151 |
// Load buffer with your character |
|
152 |
UDR0 = pgm_read_byte(s++); |
|
152 | 153 |
} |
153 | 154 |
|
154 | 155 |
return 0; |
Also available in: Unified diff