X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_at24c.c;h=16141c735d9b026eef1d6684461f530f6c0cf289;hb=69bdb309f46a28803e93b08921720805b28b18a2;hp=2a23be3a2cd6d841835e58ce76adaa4d6de8fdfd;hpb=5a55501660ebab3b858a48483c5df1cfb4e858e4;p=fw%2Faltos diff --git a/src/drivers/ao_at24c.c b/src/drivers/ao_at24c.c index 2a23be3a..16141c73 100644 --- a/src/drivers/ao_at24c.c +++ b/src/drivers/ao_at24c.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,10 +25,10 @@ #define AO_AT24C_PAGE_LEN 128 /* Total bytes of available storage */ -__pdata ao_pos_t ao_storage_total = 64l * 1024l; +ao_pos_t ao_storage_total = 64l * 1024l; /* Storage unit size - device reads and writes must be within blocks of this size. */ -__pdata uint16_t ao_storage_unit = 128; +uint16_t ao_storage_unit = 128; static void ao_at24c_set_address(uint8_t addr, ao_pos_t pos) @@ -44,7 +45,7 @@ ao_at24c_set_address(uint8_t addr, ao_pos_t pos) * Erase the specified sector */ uint8_t -ao_storage_erase(ao_pos_t pos) __reentrant +ao_storage_erase(ao_pos_t pos) { if (pos >= ao_storage_total || pos + AO_AT24C_PAGE_LEN > ao_storage_total) return 0; @@ -60,7 +61,7 @@ ao_storage_erase(ao_pos_t pos) __reentrant * Write to flash */ uint8_t -ao_storage_device_write(ao_pos_t pos, __xdata void *d, uint16_t len) __reentrant +ao_storage_device_write(ao_pos_t pos, void *d, uint16_t len) { if (pos >= ao_storage_total || pos + len > ao_storage_total) return 0; @@ -76,7 +77,7 @@ ao_storage_device_write(ao_pos_t pos, __xdata void *d, uint16_t len) __reentrant * Read from flash */ uint8_t -ao_storage_device_read(ao_pos_t pos, __xdata void *d, uint16_t len) __reentrant +ao_storage_device_read(ao_pos_t pos, void *d, uint16_t len) { if (pos >= ao_storage_total || pos + len > ao_storage_total) return 0; @@ -88,7 +89,7 @@ ao_storage_device_read(ao_pos_t pos, __xdata void *d, uint16_t len) __reentrant } void -ao_storage_flush(void) __reentrant +ao_storage_flush(void) { }