From dc97831e1bee8694c711875a83b62df9132a9f78 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Tue, 10 Nov 2015 01:45:12 +0100 Subject: [PATCH] uart_commands.c: eeprom_update_block() also utilized in avr-libc > 1.8.1 --- src/uart/uart_commands.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/uart/uart_commands.c b/src/uart/uart_commands.c index 6f64d3f..62ed3cc 100644 --- a/src/uart/uart_commands.c +++ b/src/uart/uart_commands.c @@ -50,9 +50,10 @@ extern volatile unsigned char reverseMode; #define CR "\r\n" -#if (!(defined(eeprom_update_block) && \ - ((E2PAGESIZE == 2) || (E2PAGESIZE == 4) || (E2PAGESIZE == 8)))) || \ - !defined(ANIMATION_TESTS) || !(defined(SCROLLTEXT_SUPPORT)) +#if ((__AVR_LIBC_MAJOR__ < 1) || \ + ((__AVR_LIBC_MAJOR__ == 1) && (__AVR_LIBC_MINOR__ < 7))) || \ + ((E2PAGESIZE != 2) && (E2PAGESIZE != 4) && (E2PAGESIZE != 8)) || \ + !defined(ANIMATION_TESTS) || !(defined(SCROLLTEXT_SUPPORT)) char const UART_STR_NOTIMPL[] PROGMEM = "Not implemented."CR; #endif @@ -145,8 +146,9 @@ static void uartcmd_clear_buffer(void) { * Erases the complete EEPROM to reset counters and high score tables. */ static void uartcmd_erase_eeprom(void) { -#if defined(eeprom_update_block) && \ - ((E2PAGESIZE == 2) || (E2PAGESIZE == 4) || (E2PAGESIZE == 8)) +#if ((__AVR_LIBC_MAJOR__ > 1) || \ + ((__AVR_LIBC_MAJOR__ == 1) && (__AVR_LIBC_MINOR__ >= 7))) && \ + ((E2PAGESIZE == 2) || (E2PAGESIZE == 4) || (E2PAGESIZE == 8)) uint8_t const eeclear[] = # if E2PAGESIZE == 8 {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};