Sanguino compile patch
@daapp : Sanguino compile serial USART path. Thanks!
This commit is contained in:
parent
5e7a4b3ba8
commit
baf137882b
8
serial.c
8
serial.c
@ -91,7 +91,11 @@ void serial_write(uint8_t data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Data Register Empty Interrupt handler
|
// Data Register Empty Interrupt handler
|
||||||
|
#ifdef __AVR_ATmega644P__
|
||||||
|
ISR(USART0_UDRE_vect)
|
||||||
|
#else
|
||||||
ISR(USART_UDRE_vect)
|
ISR(USART_UDRE_vect)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// Temporary tx_buffer_tail (to optimize for volatile)
|
// Temporary tx_buffer_tail (to optimize for volatile)
|
||||||
uint8_t tail = tx_buffer_tail;
|
uint8_t tail = tx_buffer_tail;
|
||||||
@ -140,7 +144,11 @@ uint8_t serial_read()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __AVR_ATmega644P__
|
||||||
|
ISR(USART0_RX_vect)
|
||||||
|
#else
|
||||||
ISR(USART_RX_vect)
|
ISR(USART_RX_vect)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
uint8_t data = UDR0;
|
uint8_t data = UDR0;
|
||||||
uint8_t next_head;
|
uint8_t next_head;
|
||||||
|
@ -103,7 +103,6 @@ uint8_t settings_read_startup_line(uint8_t n, char *line)
|
|||||||
uint16_t addr = n*(LINE_BUFFER_SIZE+1)+EEPROM_ADDR_STARTUP_BLOCK;
|
uint16_t addr = n*(LINE_BUFFER_SIZE+1)+EEPROM_ADDR_STARTUP_BLOCK;
|
||||||
if (!(memcpy_from_eeprom_with_checksum((char*)line, addr, LINE_BUFFER_SIZE))) {
|
if (!(memcpy_from_eeprom_with_checksum((char*)line, addr, LINE_BUFFER_SIZE))) {
|
||||||
// Reset line with default value
|
// Reset line with default value
|
||||||
// TODO: Need to come up with a method to do this.
|
|
||||||
line[0] = 0;
|
line[0] = 0;
|
||||||
settings_store_startup_line(n, line);
|
settings_store_startup_line(n, line);
|
||||||
return(false);
|
return(false);
|
||||||
@ -219,5 +218,5 @@ void settings_init() {
|
|||||||
report_status_message(STATUS_SETTING_READ_FAIL);
|
report_status_message(STATUS_SETTING_READ_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// NOTE: Startup lines are handled and called by protocol_init().
|
// NOTE: Startup lines are handled and called by main.c at the end of initialization.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user