diff options
Diffstat (limited to 'src/drivers')
33 files changed, 239 insertions, 239 deletions
diff --git a/src/drivers/ao_25lc1024.c b/src/drivers/ao_25lc1024.c index a9c897b3..c73f54df 100644 --- a/src/drivers/ao_25lc1024.c +++ b/src/drivers/ao_25lc1024.c @@ -24,16 +24,16 @@ #define EE_DEVICE_SIZE ((uint32_t) 128 * (uint32_t) 1024) /* Total bytes of available storage */ -__pdata uint32_t ao_storage_total; +uint32_t ao_storage_total; /* Block size - device is erased in these units. At least 256 bytes */ -__pdata uint32_t ao_storage_block; +uint32_t ao_storage_block; /* Byte offset of config block. Will be ao_storage_block bytes long */ -__pdata uint32_t ao_storage_config; +uint32_t ao_storage_config; /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */ -__pdata uint16_t ao_storage_unit; +uint16_t ao_storage_unit; /* * Using SPI on USART 0, with P1_2 as the chip select @@ -43,7 +43,7 @@ __pdata uint16_t ao_storage_unit; #define EE_CS P1_2 #define EE_CS_PIN 2 -static __xdata uint8_t ao_ee_mutex; +static uint8_t ao_ee_mutex; #define ao_ee_delay() do { \ _asm nop _endasm; \ @@ -58,7 +58,7 @@ static __xdata uint8_t ao_ee_mutex; struct ao_ee_instruction { uint8_t instruction; uint8_t address[3]; -} __xdata ao_ee_instruction; +} ao_ee_instruction; static void ao_ee_write_enable(void) @@ -92,9 +92,9 @@ ao_ee_wrsr(uint8_t status) #define EE_BLOCK_NONE 0xffff -static __xdata uint8_t ao_ee_data[EE_BLOCK_SIZE]; -static __pdata uint16_t ao_ee_block = EE_BLOCK_NONE; -static __pdata uint8_t ao_ee_block_dirty; +static uint8_t ao_ee_data[EE_BLOCK_SIZE]; +static uint16_t ao_ee_block = EE_BLOCK_NONE; +static uint8_t ao_ee_block_dirty; /* Write the current block to the EEPROM */ static void @@ -157,7 +157,7 @@ ao_ee_fill(uint16_t block) } uint8_t -ao_storage_device_write(uint32_t pos, __xdata void *buf, uint16_t len) __reentrant +ao_storage_device_write(uint32_t pos, void *buf, uint16_t len) { uint16_t block = (uint16_t) (pos >> EE_BLOCK_SHIFT); @@ -176,7 +176,7 @@ ao_storage_device_write(uint32_t pos, __xdata void *buf, uint16_t len) __reentra } uint8_t -ao_storage_device_read(uint32_t pos, __xdata void *buf, uint16_t len) __reentrant +ao_storage_device_read(uint32_t pos, void *buf, uint16_t len) { uint16_t block = (uint16_t) (pos >> EE_BLOCK_SHIFT); @@ -189,7 +189,7 @@ ao_storage_device_read(uint32_t pos, __xdata void *buf, uint16_t len) __reentran } void -ao_storage_flush(void) __reentrant +ao_storage_flush(void) { ao_mutex_get(&ao_ee_mutex); { ao_ee_flush_internal(); @@ -197,7 +197,7 @@ ao_storage_flush(void) __reentrant } uint8_t -ao_storage_erase(uint32_t pos) __reentrant +ao_storage_erase(uint32_t pos) { ao_mutex_get(&ao_ee_mutex); { ao_ee_flush_internal(); @@ -209,7 +209,7 @@ ao_storage_erase(uint32_t pos) __reentrant } static void -ee_store(void) __reentrant +ee_store(void) { } @@ -225,7 +225,7 @@ ao_storage_setup(void) } void -ao_storage_device_info(void) __reentrant +ao_storage_device_info(void) { } diff --git a/src/drivers/ao_74hc165.c b/src/drivers/ao_74hc165.c index 8842801d..b62e0134 100644 --- a/src/drivers/ao_74hc165.c +++ b/src/drivers/ao_74hc165.c @@ -27,7 +27,7 @@ uint8_t ao_74hc165_read(void) { - static __xdata state; + static state; ao_spi_get(AO_74HC165_SPI_BUS); ao_spi_set_speed(AO_74HC165_SPI_BUS, AO_SPI_SPEED_FAST); AO_74HC165_CS = 1; diff --git a/src/drivers/ao_74hc497.c b/src/drivers/ao_74hc497.c index b3fd3c91..e8c39430 100644 --- a/src/drivers/ao_74hc497.c +++ b/src/drivers/ao_74hc497.c @@ -27,7 +27,7 @@ uint8_t ao_74hc497_read(void) { - static __xdata state; + static state; ao_spi_get_bit(AO_74HC497_CS_PORT, AO_74HC497_CS_PIN, AO_74HC497_CS, AO_74HC497_SPI_BUS, AO_SPI_SPEED_FAST); ao_spi_recv(&state, 1, AO_74HC497_SPI_BUS); ao_spi_put_bit(AO_74HC497_CS_PORT, AO_74HC497_CS_PIN, AO_74HC497_CS, AO_74HC497_SPI_BUS); diff --git a/src/drivers/ao_at24c.c b/src/drivers/ao_at24c.c index 8f91e3ca..16141c73 100644 --- a/src/drivers/ao_at24c.c +++ b/src/drivers/ao_at24c.c @@ -25,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) @@ -45,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; @@ -61,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; @@ -77,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; @@ -89,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) { } diff --git a/src/drivers/ao_at45db161d.c b/src/drivers/ao_at45db161d.c index abba3f1f..516811b8 100644 --- a/src/drivers/ao_at45db161d.c +++ b/src/drivers/ao_at45db161d.c @@ -20,23 +20,23 @@ #include "ao_at45db161d.h" /* Total bytes of available storage */ -__pdata uint32_t ao_storage_total; +uint32_t ao_storage_total; /* Block size - device is erased in these units. At least 256 bytes */ -__pdata uint32_t ao_storage_block; +uint32_t ao_storage_block; /* Byte offset of config block. Will be ao_storage_block bytes long */ -__pdata uint32_t ao_storage_config; +uint32_t ao_storage_config; /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */ -__pdata uint16_t ao_storage_unit; +uint16_t ao_storage_unit; #define FLASH_CS P1_1 #define FLASH_CS_INDEX 1 #define FLASH_BLOCK_SIZE_MAX 512 -__xdata uint8_t ao_flash_mutex; +uint8_t ao_flash_mutex; #define ao_flash_delay() do { \ _asm nop _endasm; \ @@ -51,7 +51,7 @@ __xdata uint8_t ao_flash_mutex; struct ao_flash_instruction { uint8_t instruction; uint8_t address[3]; -} __xdata ao_flash_instruction; +} ao_flash_instruction; static void ao_flash_set_pagesize_512(void) @@ -79,17 +79,17 @@ ao_flash_read_status(void) #define FLASH_BLOCK_NONE 0xffff -static __xdata uint8_t ao_flash_data[FLASH_BLOCK_SIZE_MAX]; -static __pdata uint16_t ao_flash_block = FLASH_BLOCK_NONE; -static __pdata uint8_t ao_flash_block_dirty; -static __pdata uint8_t ao_flash_write_pending; -static __pdata uint8_t ao_flash_setup_done; -static __pdata uint8_t ao_flash_block_shift; -static __pdata uint16_t ao_flash_block_size; -static __pdata uint16_t ao_flash_block_mask; +static uint8_t ao_flash_data[FLASH_BLOCK_SIZE_MAX]; +static uint16_t ao_flash_block = FLASH_BLOCK_NONE; +static uint8_t ao_flash_block_dirty; +static uint8_t ao_flash_write_pending; +static uint8_t ao_flash_setup_done; +static uint8_t ao_flash_block_shift; +static uint16_t ao_flash_block_size; +static uint16_t ao_flash_block_mask; void -ao_storage_setup(void) __reentrant +ao_storage_setup(void) { uint8_t status; @@ -234,7 +234,7 @@ ao_flash_fill(uint16_t block) } uint8_t -ao_storage_device_write(uint32_t pos, __xdata void *buf, uint16_t len) __reentrant +ao_storage_device_write(uint32_t pos, void *buf, uint16_t len) { uint16_t block = (uint16_t) (pos >> ao_flash_block_shift); @@ -255,7 +255,7 @@ ao_storage_device_write(uint32_t pos, __xdata void *buf, uint16_t len) __reentra } uint8_t -ao_storage_device_read(uint32_t pos, __xdata void *buf, uint16_t len) __reentrant +ao_storage_device_read(uint32_t pos, void *buf, uint16_t len) { uint16_t block = (uint16_t) (pos >> ao_flash_block_shift); @@ -270,7 +270,7 @@ ao_storage_device_read(uint32_t pos, __xdata void *buf, uint16_t len) __reentran } void -ao_storage_flush(void) __reentrant +ao_storage_flush(void) { ao_mutex_get(&ao_flash_mutex); { ao_flash_flush_internal(); @@ -278,7 +278,7 @@ ao_storage_flush(void) __reentrant } uint8_t -ao_storage_erase(uint32_t pos) __reentrant +ao_storage_erase(uint32_t pos) { ao_mutex_get(&ao_flash_mutex); { ao_flash_flush_internal(); @@ -290,7 +290,7 @@ ao_storage_erase(uint32_t pos) __reentrant } void -ao_storage_device_info(void) __reentrant +ao_storage_device_info(void) { uint8_t status; diff --git a/src/drivers/ao_btm.c b/src/drivers/ao_btm.c index c65a8548..3591f8f2 100644 --- a/src/drivers/ao_btm.c +++ b/src/drivers/ao_btm.c @@ -30,12 +30,12 @@ #endif int8_t ao_btm_stdio; -__xdata uint8_t ao_btm_connected; +uint8_t ao_btm_connected; #define BT_DEBUG 0 #if BT_DEBUG -__xdata char ao_btm_buffer[256]; +char ao_btm_buffer[256]; uint16_t ao_btm_ptr; char ao_btm_dir; @@ -137,7 +137,7 @@ ao_btm_send(void) ao_wakeup((void *) &ao_serial_btm_rx_fifo); } -__code struct ao_cmds ao_btm_cmds[] = { +const struct ao_cmds ao_btm_cmds[] = { { ao_btm_dump, "d\0Dump btm buffer." }, { ao_btm_speed, "s <19200,57600>\0Set btm serial speed." }, { ao_btm_send, "S\0BTM interactive mode. ~ to exit." }, @@ -153,7 +153,7 @@ __code struct ao_cmds ao_btm_cmds[] = { #endif #define AO_BTM_MAX_REPLY 16 -__xdata char ao_btm_reply[AO_BTM_MAX_REPLY]; +char ao_btm_reply[AO_BTM_MAX_REPLY]; /* * Read one bluetooth character. @@ -252,7 +252,7 @@ ao_btm_wait_reply(void) } void -ao_btm_string(__code char *cmd) +ao_btm_string(const char *cmd) { char c; @@ -261,7 +261,7 @@ ao_btm_string(__code char *cmd) } uint8_t -ao_btm_cmd(__code char *cmd) +ao_btm_cmd(const char *cmd) { ao_btm_drain(); @@ -351,7 +351,7 @@ ao_btm_check_link() #endif } -__xdata struct ao_task ao_btm_task; +struct ao_task ao_btm_task; /* * A thread to initialize the bluetooth device and diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c index 2f091485..d581c246 100644 --- a/src/drivers/ao_cc1120.c +++ b/src/drivers/ao_cc1120.c @@ -1066,7 +1066,7 @@ ao_radio_rx_wait(void) } uint8_t -ao_radio_recv(__xdata void *d, uint8_t size, uint8_t timeout) +ao_radio_recv(void *d, uint8_t size, uint8_t timeout) { uint8_t len; uint8_t radio_rssi = 0; diff --git a/src/drivers/ao_cc1200.c b/src/drivers/ao_cc1200.c index de282000..f2f9c372 100644 --- a/src/drivers/ao_cc1200.c +++ b/src/drivers/ao_cc1200.c @@ -988,7 +988,7 @@ ao_radio_dump_state(struct ao_radio_state *s) #endif uint8_t -ao_radio_recv(__xdata void *d, uint8_t size, uint8_t timeout) +ao_radio_recv(void *d, uint8_t size, uint8_t timeout) { uint8_t success = 0; diff --git a/src/drivers/ao_companion.c b/src/drivers/ao_companion.c index 598b5815..3967090b 100644 --- a/src/drivers/ao_companion.c +++ b/src/drivers/ao_companion.c @@ -43,12 +43,12 @@ AO_COMPANION_SPI_BUS); \ } while (0) -__xdata struct ao_companion_command ao_companion_command; -__xdata struct ao_companion_setup ao_companion_setup; +struct ao_companion_command ao_companion_command; +struct ao_companion_setup ao_companion_setup; -__xdata uint16_t ao_companion_data[AO_COMPANION_MAX_CHANNELS]; -__pdata uint8_t ao_companion_running; -__xdata uint8_t ao_companion_mutex; +uint16_t ao_companion_data[AO_COMPANION_MAX_CHANNELS]; +uint8_t ao_companion_running; +uint8_t ao_companion_mutex; static void ao_companion_send_command(uint8_t command) @@ -116,7 +116,7 @@ ao_companion(void) } void -ao_companion_status(void) __reentrant +ao_companion_status(void) { uint8_t i; printf("Companion running: %d\n", ao_companion_running); @@ -134,12 +134,12 @@ ao_companion_status(void) __reentrant printf("\n"); } -__code struct ao_cmds ao_companion_cmds[] = { +const struct ao_cmds ao_companion_cmds[] = { { ao_companion_status, "L\0Companion link status" }, { 0, NULL }, }; -static __xdata struct ao_task ao_companion_task; +static struct ao_task ao_companion_task; void ao_companion_init(void) diff --git a/src/drivers/ao_gps_sirf.c b/src/drivers/ao_gps_sirf.c index 8bebd610..bdd9410e 100644 --- a/src/drivers/ao_gps_sirf.c +++ b/src/drivers/ao_gps_sirf.c @@ -20,11 +20,11 @@ #include "ao.h" #endif -__xdata uint8_t ao_gps_new; -__xdata uint8_t ao_gps_mutex; -__pdata uint16_t ao_gps_tick; -__xdata struct ao_telemetry_location ao_gps_data; -__xdata struct ao_telemetry_satellite ao_gps_tracking_data; +uint8_t ao_gps_new; +uint8_t ao_gps_mutex; +uint16_t ao_gps_tick; +struct ao_telemetry_location ao_gps_data; +struct ao_telemetry_satellite ao_gps_tracking_data; static const char ao_gps_set_nmea[] = "\r\n$PSRF100,0,57600,8,1,0*37\r\n"; @@ -107,7 +107,7 @@ struct sirf_geodetic_nav_data { uint8_t hdop; }; -static __xdata struct sirf_geodetic_nav_data ao_sirf_data; +static struct sirf_geodetic_nav_data ao_sirf_data; struct sirf_measured_sat_data { uint8_t svid; @@ -121,10 +121,10 @@ struct sirf_measured_tracker_data { struct sirf_measured_sat_data sats[12]; }; -static __xdata struct sirf_measured_tracker_data ao_sirf_tracker_data; +static struct sirf_measured_tracker_data ao_sirf_tracker_data; -static __pdata uint16_t ao_sirf_cksum; -static __pdata uint16_t ao_sirf_len; +static uint16_t ao_sirf_cksum; +static uint16_t ao_sirf_len; #ifndef ao_sirf_getchar #define ao_sirf_getchar ao_serial1_getchar @@ -142,11 +142,11 @@ static uint8_t data_byte(void) return c; } -static char __xdata *sirf_target; +static char *sirf_target; static void sirf_u16(uint8_t offset) { - uint16_t __xdata *ptr = (uint16_t __xdata *) (sirf_target + offset); + uint16_t *ptr = (uint16_t *) (sirf_target + offset); uint16_t val; val = data_byte() << 8; @@ -156,16 +156,16 @@ static void sirf_u16(uint8_t offset) static void sirf_u8(uint8_t offset) { - uint8_t __xdata *ptr = (uint8_t __xdata *) (sirf_target + offset); + uint8_t *ptr = (uint8_t *) (sirf_target + offset); uint8_t val; val = data_byte (); *ptr = val; } -static void sirf_u32(uint8_t offset) __reentrant +static void sirf_u32(uint8_t offset) { - uint32_t __xdata *ptr = (uint32_t __xdata *) (sirf_target + offset); + uint32_t *ptr = (uint32_t *) (sirf_target + offset); uint32_t val; val = ((uint32_t) data_byte ()) << 24; @@ -194,7 +194,7 @@ struct sirf_packet_parse { }; static void -ao_sirf_parse(void __xdata *target, const struct sirf_packet_parse *parse) __reentrant +ao_sirf_parse(void *target, const struct sirf_packet_parse *parse) { uint8_t i, offset, j; @@ -258,7 +258,7 @@ static const struct sirf_packet_parse geodetic_nav_data_packet[] = { }; static void -ao_sirf_parse_41(void) __reentrant +ao_sirf_parse_41(void) { ao_sirf_parse(&ao_sirf_data, geodetic_nav_data_packet); } @@ -279,7 +279,7 @@ static const struct sirf_packet_parse measured_sat_data_packet[] = { }; static void -ao_sirf_parse_4(void) __reentrant +ao_sirf_parse_4(void) { uint8_t i; ao_sirf_parse(&ao_sirf_tracker_data, measured_tracker_data_packet); @@ -288,7 +288,7 @@ ao_sirf_parse_4(void) __reentrant } static void -ao_gps_setup(void) __reentrant +ao_gps_setup(void) { uint8_t i, k; ao_sirf_set_speed(AO_SERIAL_SPEED_4800); @@ -309,7 +309,7 @@ static const char ao_gps_set_message_rate[] = { }; void -ao_sirf_set_message_rate(uint8_t msg, uint8_t rate) __reentrant +ao_sirf_set_message_rate(uint8_t msg, uint8_t rate) { uint16_t cksum = 0x00a6; uint8_t i; @@ -337,7 +337,7 @@ static const uint8_t sirf_disable[] = { }; void -ao_gps(void) __reentrant +ao_gps(void) { uint8_t i, k; uint16_t cksum; @@ -443,7 +443,7 @@ ao_gps(void) __reentrant } } -__xdata struct ao_task ao_gps_task; +struct ao_task ao_gps_task; void ao_gps_init(void) diff --git a/src/drivers/ao_gps_skytraq.c b/src/drivers/ao_gps_skytraq.c index 3ecae435..193f20dc 100644 --- a/src/drivers/ao_gps_skytraq.c +++ b/src/drivers/ao_gps_skytraq.c @@ -33,20 +33,20 @@ #define ao_gps_set_speed ao_serial1_set_speed #endif -__xdata uint8_t ao_gps_new; -__xdata uint8_t ao_gps_mutex; -static __data char ao_gps_char; -static __data uint8_t ao_gps_cksum; -static __data uint8_t ao_gps_error; +uint8_t ao_gps_new; +uint8_t ao_gps_mutex; +static char ao_gps_char; +static uint8_t ao_gps_cksum; +static uint8_t ao_gps_error; -__pdata uint16_t ao_gps_tick; -__xdata struct ao_telemetry_location ao_gps_data; -__xdata struct ao_telemetry_satellite ao_gps_tracking_data; +uint16_t ao_gps_tick; +struct ao_telemetry_location ao_gps_data; +struct ao_telemetry_satellite ao_gps_tracking_data; -static __pdata uint16_t ao_gps_next_tick; -static __pdata struct ao_telemetry_location ao_gps_next; -static __pdata uint8_t ao_gps_date_flags; -static __pdata struct ao_telemetry_satellite ao_gps_tracking_next; +static uint16_t ao_gps_next_tick; +static struct ao_telemetry_location ao_gps_next; +static uint8_t ao_gps_date_flags; +static struct ao_telemetry_satellite ao_gps_tracking_next; #define STQ_S 0xa0, 0xa1 #define STQ_E 0x0d, 0x0a @@ -60,7 +60,7 @@ static __pdata struct ao_telemetry_satellite ao_gps_tracking_next; STQ_S, 0,15, id, a,b,c,d,e,f,g,h,i,j,k,l,m,n, \ (id^a^b^c^d^e^f^g^h^i^j^k^l^m^n), STQ_E -static __code uint8_t ao_gps_config[] = { +static const uint8_t ao_gps_config[] = { SKYTRAQ_MSG_8(0x08, 1, 0, 1, 0, 1, 0, 0, 0), /* configure nmea */ /* gga interval */ /* gsa interval */ @@ -107,7 +107,7 @@ ao_gps_skip_sep(void) ao_gps_lexchar(); } -__data static uint8_t ao_gps_num_width; +static uint8_t ao_gps_num_width; static int16_t ao_gps_decimal(uint8_t max_width) @@ -162,11 +162,11 @@ ao_gps_hex(void) } static int32_t -ao_gps_parse_pos(uint8_t deg_width) __reentrant +ao_gps_parse_pos(uint8_t deg_width) { - static __pdata uint16_t d; - static __pdata uint8_t m; - static __pdata uint16_t f; + static uint16_t d; + static uint8_t m; + static uint16_t f; char c; d = ao_gps_decimal(deg_width); @@ -414,7 +414,7 @@ ao_nmea_rmc(void) #define ao_skytraq_sendstruct(s) ao_skytraq_sendbytes((s), sizeof(s)) static void -ao_skytraq_sendbytes(__code uint8_t *b, uint8_t l) +ao_skytraq_sendbytes(const uint8_t *b, uint8_t l) { while (l--) { uint8_t c = *b++; @@ -462,7 +462,7 @@ ao_gps_nmea_parse(void) static uint8_t ao_gps_updating; void -ao_gps(void) __reentrant +ao_gps(void) { ao_gps_set_speed(AO_SERIAL_SPEED_9600); @@ -486,9 +486,9 @@ ao_gps(void) __reentrant } } -__xdata struct ao_task ao_gps_task; +struct ao_task ao_gps_task; -static __code uint8_t ao_gps_115200[] = { +static const uint8_t ao_gps_115200[] = { SKYTRAQ_MSG_3(5,0,5,0) /* Set to 115200 baud */ }; @@ -500,7 +500,7 @@ ao_gps_set_speed_delay(uint8_t speed) { } static void -gps_update(void) __reentrant +gps_update(void) { ao_gps_updating = 1; ao_task_minimize_latency = 1; @@ -517,7 +517,7 @@ gps_update(void) __reentrant ao_gps_putchar(ao_usb_getchar()); } -__code struct ao_cmds ao_gps_cmds[] = { +const struct ao_cmds ao_gps_cmds[] = { { ao_gps_show, "g\0Display GPS" }, { gps_update, "U\0Update GPS firmware" }, { 0, NULL }, diff --git a/src/drivers/ao_gps_ublox.c b/src/drivers/ao_gps_ublox.c index c720f802..f5268aa7 100644 --- a/src/drivers/ao_gps_ublox.c +++ b/src/drivers/ao_gps_ublox.c @@ -26,11 +26,11 @@ #include <stdarg.h> -__xdata uint8_t ao_gps_new; -__xdata uint8_t ao_gps_mutex; -__pdata uint16_t ao_gps_tick; -__xdata struct ao_telemetry_location ao_gps_data; -__xdata struct ao_telemetry_satellite ao_gps_tracking_data; +uint8_t ao_gps_new; +uint8_t ao_gps_mutex; +uint16_t ao_gps_tick; +struct ao_telemetry_location ao_gps_data; +struct ao_telemetry_satellite ao_gps_tracking_data; #undef AO_SERIAL_SPEED_UBLOX @@ -58,8 +58,8 @@ struct ao_ublox_cksum { uint8_t a, b; }; -static __pdata struct ao_ublox_cksum ao_ublox_cksum; -static __pdata uint16_t ao_ublox_len; +static struct ao_ublox_cksum ao_ublox_cksum; +static uint16_t ao_ublox_len; #if AO_UBLOX_DEBUG @@ -152,11 +152,11 @@ static uint8_t data_byte(void) return header_byte(); } -static char __xdata *ublox_target; +static char *ublox_target; static void ublox_u16(uint8_t offset) { - uint16_t __xdata *ptr = (uint16_t __xdata *) (void __xdata *) (ublox_target + offset); + uint16_t *ptr = (uint16_t *) (void *) (ublox_target + offset); uint16_t val; val = data_byte(); @@ -166,16 +166,16 @@ static void ublox_u16(uint8_t offset) static void ublox_u8(uint8_t offset) { - uint8_t __xdata *ptr = (uint8_t __xdata *) (ublox_target + offset); + uint8_t *ptr = (uint8_t *) (ublox_target + offset); uint8_t val; val = data_byte (); *ptr = val; } -static void ublox_u32(uint8_t offset) __reentrant +static void ublox_u32(uint8_t offset) { - uint32_t __xdata *ptr = (uint32_t __xdata *) (void __xdata *) (ublox_target + offset); + uint32_t *ptr = (uint32_t *) (void *) (ublox_target + offset); uint32_t val; val = ((uint32_t) data_byte ()); @@ -203,7 +203,7 @@ struct ublox_packet_parse { }; static void -ao_ublox_parse(void __xdata *target, const struct ublox_packet_parse *parse) __reentrant +ao_ublox_parse(void *target, const struct ublox_packet_parse *parse) { uint8_t i, offset; @@ -610,7 +610,7 @@ ao_gps_set_rate(uint8_t rate) } void -ao_gps(void) __reentrant +ao_gps(void) { uint8_t class, id; struct ao_ublox_cksum cksum; @@ -796,12 +796,12 @@ static void ao_gps_option(void) #define ao_gps_option ao_gps_show #endif -__code struct ao_cmds ao_gps_cmds[] = { +const struct ao_cmds ao_gps_cmds[] = { { ao_gps_option, "g\0Display GPS" }, { 0, NULL }, }; -__xdata struct ao_task ao_gps_task; +struct ao_task ao_gps_task; void ao_gps_init(void) diff --git a/src/drivers/ao_lcd.c b/src/drivers/ao_lcd.c index c35093bc..294361eb 100644 --- a/src/drivers/ao_lcd.c +++ b/src/drivers/ao_lcd.c @@ -20,7 +20,7 @@ static uint16_t ao_lcd_time = 3; -static __xdata uint8_t ao_lcd_mutex; +static uint8_t ao_lcd_mutex; static void ao_lcd_delay(void) diff --git a/src/drivers/ao_lco.c b/src/drivers/ao_lco.c index e892c8c0..86635200 100644 --- a/src/drivers/ao_lco.c +++ b/src/drivers/ao_lco.c @@ -324,7 +324,7 @@ ao_lco_set_debug(void) ao_lco_debug = ao_cmd_lex_i != 0; } -__code struct ao_cmds ao_lco_cmds[] = { +const struct ao_cmds ao_lco_cmds[] = { { ao_lco_set_debug, "D <0 off, 1 on>\0Debug" }, { ao_lco_search, "s\0Search for pad boxes" }, { 0, NULL } diff --git a/src/drivers/ao_lco_cmd.c b/src/drivers/ao_lco_cmd.c index dba9a76a..3fcdc859 100644 --- a/src/drivers/ao_lco_cmd.c +++ b/src/drivers/ao_lco_cmd.c @@ -26,12 +26,12 @@ #define HAS_STATIC_TEST 1 #endif -static __pdata uint16_t lco_box; -static __pdata uint8_t lco_channels; -static __pdata uint16_t tick_offset; +static uint16_t lco_box; +static uint8_t lco_channels; +static uint16_t tick_offset; static void -lco_args(void) __reentrant +lco_args(void) { ao_cmd_decimal(); lco_box = ao_cmd_lex_i; @@ -71,7 +71,7 @@ lco_ignite(uint8_t cmd) } static void -lco_report_cmd(void) __reentrant +lco_report_cmd(void) { int8_t r; uint8_t c; @@ -122,7 +122,7 @@ lco_report_cmd(void) __reentrant } static void -lco_fire_cmd(void) __reentrant +lco_fire_cmd(void) { uint8_t secs; uint8_t i; @@ -156,7 +156,7 @@ lco_fire_cmd(void) __reentrant #if HAS_STATIC_TEST static void -lco_static_cmd(void) __reentrant +lco_static_cmd(void) { uint8_t secs; uint8_t i; @@ -190,7 +190,7 @@ lco_static_cmd(void) __reentrant #endif static void -lco_arm_cmd(void) __reentrant +lco_arm_cmd(void) { uint8_t i; int8_t r; @@ -205,7 +205,7 @@ lco_arm_cmd(void) __reentrant } static void -lco_ignite_cmd(void) __reentrant +lco_ignite_cmd(void) { uint8_t i; lco_args(); @@ -216,13 +216,13 @@ lco_ignite_cmd(void) __reentrant #if HAS_STATIC_TEST static void -lco_endstatic_cmd(void) __reentrant +lco_endstatic_cmd(void) { lco_ignite(AO_PAD_ENDSTATIC); } #endif -static __code struct ao_cmds ao_lco_cmds[] = { +static const struct ao_cmds ao_lco_cmds[] = { { lco_report_cmd, "l <box> <channel>\0Get remote status" }, { lco_fire_cmd, "F <box> <channel> <secs>\0Fire remote igniters" }, #if HAS_STATIC_TEST diff --git a/src/drivers/ao_lco_func.c b/src/drivers/ao_lco_func.c index 92b344ed..06350694 100644 --- a/src/drivers/ao_lco_func.c +++ b/src/drivers/ao_lco_func.c @@ -21,8 +21,8 @@ #include <ao_radio_cmac.h> #include <ao_lco_func.h> -static __xdata struct ao_pad_command command; -static __xdata uint8_t ao_lco_mutex; +static struct ao_pad_command command; +static uint8_t ao_lco_mutex; int8_t ao_lco_query(uint16_t box, struct ao_pad_query *query, uint16_t *tick_offset) diff --git a/src/drivers/ao_lco_two.c b/src/drivers/ao_lco_two.c index 6f2d81ff..12c02e88 100644 --- a/src/drivers/ao_lco_two.c +++ b/src/drivers/ao_lco_two.c @@ -129,7 +129,7 @@ ao_lco_set_debug(void) ao_lco_debug = ao_cmd_lex_i; } -__code struct ao_cmds ao_lco_cmds[] = { +const struct ao_cmds ao_lco_cmds[] = { { ao_lco_set_debug, "D <0 off, 1 on>\0Debug" }, { 0, NULL } }; diff --git a/src/drivers/ao_m25.c b/src/drivers/ao_m25.c index b506b0a7..72617cc4 100644 --- a/src/drivers/ao_m25.c +++ b/src/drivers/ao_m25.c @@ -19,16 +19,16 @@ #include "ao.h" /* Total bytes of available storage */ -__pdata uint32_t ao_storage_total; +uint32_t ao_storage_total; /* Block size - device is erased in these units. At least 256 bytes */ -__pdata uint32_t ao_storage_block; +uint32_t ao_storage_block; /* Byte offset of config block. Will be ao_storage_block bytes long */ -__pdata uint32_t ao_storage_config; +uint32_t ao_storage_config; /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */ -__pdata uint16_t ao_storage_unit; +uint16_t ao_storage_unit; #define M25_DEBUG 0 /* @@ -89,7 +89,7 @@ static uint8_t ao_m25_numchips; /* number of chips detected */ static uint8_t ao_m25_total; /* total sectors available */ static ao_port_t ao_m25_wip; /* write in progress */ -static __xdata uint8_t ao_m25_mutex; +static uint8_t ao_m25_mutex; /* * This little array is abused to send and receive data. A particular @@ -99,7 +99,7 @@ static __xdata uint8_t ao_m25_mutex; * of which touch those last three bytes. */ -static __xdata uint8_t ao_m25_instruction[4]; +static uint8_t ao_m25_instruction[4]; #define M25_SELECT(cs) ao_spi_get_mask(AO_M25_SPI_CS_PORT,cs,AO_M25_SPI_BUS, AO_SPI_SPEED_FAST) #define M25_DESELECT(cs) ao_spi_put_mask(AO_M25_SPI_CS_PORT,cs,AO_M25_SPI_BUS) @@ -239,7 +239,7 @@ ao_m25_scan(void) * Erase the specified sector */ uint8_t -ao_storage_erase(uint32_t pos) __reentrant +ao_storage_erase(uint32_t pos) { ao_port_t cs; @@ -267,7 +267,7 @@ ao_storage_erase(uint32_t pos) __reentrant * Write to flash */ uint8_t -ao_storage_device_write(uint32_t pos, __xdata void *d, uint16_t len) __reentrant +ao_storage_device_write(uint32_t pos, void *d, uint16_t len) { ao_port_t cs; @@ -294,7 +294,7 @@ ao_storage_device_write(uint32_t pos, __xdata void *d, uint16_t len) __reentrant * Read from flash */ uint8_t -ao_storage_device_read(uint32_t pos, __xdata void *d, uint16_t len) __reentrant +ao_storage_device_read(uint32_t pos, void *d, uint16_t len) { ao_port_t cs; @@ -317,7 +317,7 @@ ao_storage_device_read(uint32_t pos, __xdata void *d, uint16_t len) __reentrant } void -ao_storage_flush(void) __reentrant +ao_storage_flush(void) { } @@ -330,7 +330,7 @@ ao_storage_setup(void) } void -ao_storage_device_info(void) __reentrant +ao_storage_device_info(void) { #if M25_DEBUG ao_port_t cs; diff --git a/src/drivers/ao_mma655x.c b/src/drivers/ao_mma655x.c index 5d44bffd..a48c1db2 100644 --- a/src/drivers/ao_mma655x.c +++ b/src/drivers/ao_mma655x.c @@ -259,7 +259,7 @@ ao_mma655x_dump(void) printf ("MMA655X value %d\n", ao_mma655x_current); } -__code struct ao_cmds ao_mma655x_cmds[] = { +const struct ao_cmds ao_mma655x_cmds[] = { { ao_mma655x_dump, "A\0Display MMA655X data" }, { 0, NULL }, }; @@ -277,7 +277,7 @@ ao_mma655x(void) } } -static __xdata struct ao_task ao_mma655x_task; +static struct ao_task ao_mma655x_task; void ao_mma655x_init(void) diff --git a/src/drivers/ao_mr25.c b/src/drivers/ao_mr25.c index 2d355c9f..86dda22a 100644 --- a/src/drivers/ao_mr25.c +++ b/src/drivers/ao_mr25.c @@ -19,16 +19,16 @@ #include "ao.h" /* Total bytes of available storage */ -__pdata uint32_t ao_storage_total; +uint32_t ao_storage_total; /* Block size - device is erased in these units. At least 256 bytes */ -__pdata uint32_t ao_storage_block; +uint32_t ao_storage_block; /* Byte offset of config block. Will be ao_storage_block bytes long */ -__pdata uint32_t ao_storage_config; +uint32_t ao_storage_config; /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */ -__pdata uint16_t ao_storage_unit; +uint16_t ao_storage_unit; /* * MRAM is entirely random access; no erase operations are required, @@ -51,7 +51,7 @@ __pdata uint16_t ao_storage_unit; #define MR25_STATUS_BP_SHIFT (2) #define MR25_STATUS_WEL (1 << 1) /* Write enable latch */ -static __xdata uint8_t ao_mr25_mutex; +static uint8_t ao_mr25_mutex; /* * This little array is abused to send and receive data. A particular @@ -61,7 +61,7 @@ static __xdata uint8_t ao_mr25_mutex; * those last three bytes. */ -static __xdata uint8_t ao_mr25_instruction[4]; +static uint8_t ao_mr25_instruction[4]; #define MR25_SELECT() ao_spi_get_mask(AO_MR25_SPI_CS_PORT,(1 << AO_MR25_SPI_CS_PIN),AO_MR25_SPI_BUS, AO_SPI_SPEED_FAST) #define MR25_DESELECT() ao_spi_put_mask(AO_MR25_SPI_CS_PORT,(1 << AO_MR25_SPI_CS_PIN),AO_MR25_SPI_BUS) @@ -93,7 +93,7 @@ ao_mr25_set_address(uint32_t pos) * Erase the specified sector (no-op for MRAM) */ uint8_t -ao_storage_erase(uint32_t pos) __reentrant +ao_storage_erase(uint32_t pos) { if (pos >= ao_storage_total || pos + ao_storage_block > ao_storage_total) return 0; @@ -104,7 +104,7 @@ ao_storage_erase(uint32_t pos) __reentrant * Write to flash */ uint8_t -ao_storage_device_write(uint32_t pos, __xdata void *d, uint16_t len) __reentrant +ao_storage_device_write(uint32_t pos, void *d, uint16_t len) { if (pos >= ao_storage_total || pos + len > ao_storage_total) return 0; @@ -128,7 +128,7 @@ ao_storage_device_write(uint32_t pos, __xdata void *d, uint16_t len) __reentrant * Read from flash */ uint8_t -ao_storage_device_read(uint32_t pos, __xdata void *d, uint16_t len) __reentrant +ao_storage_device_read(uint32_t pos, void *d, uint16_t len) { if (pos >= ao_storage_total || pos + len > ao_storage_total) return 0; @@ -147,7 +147,7 @@ ao_storage_device_read(uint32_t pos, __xdata void *d, uint16_t len) __reentrant } void -ao_storage_flush(void) __reentrant +ao_storage_flush(void) { } @@ -157,7 +157,7 @@ ao_storage_setup(void) } void -ao_storage_device_info(void) __reentrant +ao_storage_device_info(void) { printf ("Detected chips 1 size %d\n", ao_storage_total >> 8); } diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c index 4bfc17db..a468fee3 100644 --- a/src/drivers/ao_ms5607.c +++ b/src/drivers/ao_ms5607.c @@ -22,8 +22,8 @@ #if HAS_MS5607 || HAS_MS5611 -__xdata struct ao_ms5607_prom ao_ms5607_prom; -static __xdata uint8_t ms5607_configured; +struct ao_ms5607_prom ao_ms5607_prom; +static uint8_t ms5607_configured; #ifndef AO_MS5607_SPI_SPEED #define AO_MS5607_SPI_SPEED AO_SPI_SPEED_FAST @@ -97,12 +97,12 @@ ao_ms5607_prom_valid(uint8_t *prom) } static void -ao_ms5607_prom_read(__xdata struct ao_ms5607_prom *prom) +ao_ms5607_prom_read(struct ao_ms5607_prom *prom) { uint8_t addr; uint16_t *r; - r = (__xdata uint16_t *) prom; + r = (uint16_t *) prom; for (addr = 0; addr < 8; addr++) { uint8_t cmd = AO_MS5607_PROM_READ(addr); ao_ms5607_start(); @@ -138,20 +138,20 @@ ao_ms5607_setup(void) ao_ms5607_prom_read(&ao_ms5607_prom); } -static __xdata volatile uint8_t ao_ms5607_done; +static volatile uint8_t ao_ms5607_done; static void ao_ms5607_isr(void) { ao_exti_disable(AO_MS5607_MISO_PORT, AO_MS5607_MISO_PIN); ao_ms5607_done = 1; - ao_wakeup((__xdata void *) &ao_ms5607_done); + ao_wakeup((void *) &ao_ms5607_done); } static uint32_t ao_ms5607_get_sample(uint8_t cmd) { - __xdata uint8_t reply[3]; - __xdata uint8_t read; + uint8_t reply[3]; + uint8_t read; ao_ms5607_done = 0; @@ -198,7 +198,7 @@ ao_ms5607_get_sample(uint8_t cmd) { #define AO_CONVERT_D2 token_evaluator(AO_MS5607_CONVERT_D2_, AO_MS5607_TEMP_OVERSAMPLE) void -ao_ms5607_sample(__xdata struct ao_ms5607_sample *sample) +ao_ms5607_sample(struct ao_ms5607_sample *sample) { sample->pres = ao_ms5607_get_sample(AO_CONVERT_D1); sample->temp = ao_ms5607_get_sample(AO_CONVERT_D2); @@ -214,7 +214,7 @@ ao_ms5607_sample(__xdata struct ao_ms5607_sample *sample) #define HAS_MS5607_TASK HAS_TASK #endif -__xdata struct ao_ms5607_sample ao_ms5607_current; +struct ao_ms5607_sample ao_ms5607_current; #if HAS_MS5607_TASK static void @@ -233,7 +233,7 @@ ao_ms5607(void) } } -__xdata struct ao_task ao_ms5607_task; +struct ao_task ao_ms5607_task; #endif #if HAS_TASK @@ -253,7 +253,7 @@ ao_ms5607_info(void) static void ao_ms5607_dump(void) { - __xdata struct ao_ms5607_value value; + struct ao_ms5607_value value; ao_ms5607_convert(&ao_ms5607_current, &value); printf ("Pressure: %8lu %8ld\n", ao_ms5607_current.pres, value.pres); @@ -261,7 +261,7 @@ ao_ms5607_dump(void) printf ("Altitude: %ld\n", ao_pa_to_altitude(value.pres)); } -__code struct ao_cmds ao_ms5607_cmds[] = { +const struct ao_cmds ao_ms5607_cmds[] = { { ao_ms5607_dump, "B\0Display MS5607 data" }, { 0, NULL }, }; diff --git a/src/drivers/ao_ms5607.h b/src/drivers/ao_ms5607.h index 18f99bf8..322cc468 100644 --- a/src/drivers/ao_ms5607.h +++ b/src/drivers/ao_ms5607.h @@ -57,8 +57,8 @@ struct ao_ms5607_value { int32_t temp; /* in °C * 100 */ }; -extern __xdata struct ao_ms5607_sample ao_ms5607_current; -extern __xdata struct ao_ms5607_prom ao_ms5607_prom; +extern struct ao_ms5607_sample ao_ms5607_current; +extern struct ao_ms5607_prom ao_ms5607_prom; void ao_ms5607_setup(void); @@ -70,10 +70,10 @@ void ao_ms5607_info(void); void -ao_ms5607_sample(__xdata struct ao_ms5607_sample *sample); +ao_ms5607_sample(struct ao_ms5607_sample *sample); void -ao_ms5607_convert(__xdata struct ao_ms5607_sample *sample, - __xdata struct ao_ms5607_value *value); +ao_ms5607_convert(struct ao_ms5607_sample *sample, + struct ao_ms5607_value *value); #endif /* _AO_MS5607_H_ */ diff --git a/src/drivers/ao_ms5607_convert_8051.c b/src/drivers/ao_ms5607_convert_8051.c index b7081107..e9052b41 100644 --- a/src/drivers/ao_ms5607_convert_8051.c +++ b/src/drivers/ao_ms5607_convert_8051.c @@ -32,8 +32,8 @@ #endif void -ao_ms5607_convert(__xdata struct ao_ms5607_sample *sample, - __xdata struct ao_ms5607_value *value) +ao_ms5607_convert(struct ao_ms5607_sample *sample, + struct ao_ms5607_value *value) { __LOCAL int32_t dT; __LOCAL int32_t TEMP; diff --git a/src/drivers/ao_packet.c b/src/drivers/ao_packet.c index 1c931921..b5a0a4b7 100644 --- a/src/drivers/ao_packet.c +++ b/src/drivers/ao_packet.c @@ -18,20 +18,20 @@ #include "ao.h" -__xdata struct ao_packet_recv ao_rx_packet; -__xdata struct ao_packet ao_tx_packet; -__pdata uint8_t ao_packet_rx_len, ao_packet_rx_used, ao_packet_tx_used; +struct ao_packet_recv ao_rx_packet; +struct ao_packet ao_tx_packet; +uint8_t ao_packet_rx_len, ao_packet_rx_used, ao_packet_tx_used; -static __xdata uint8_t tx_data[AO_PACKET_MAX]; -static __xdata uint8_t rx_data[AO_PACKET_MAX]; -static __pdata uint8_t rx_seq; +static uint8_t tx_data[AO_PACKET_MAX]; +static uint8_t rx_data[AO_PACKET_MAX]; +static uint8_t rx_seq; -__xdata struct ao_task ao_packet_task; -__xdata uint8_t ao_packet_enable; -__xdata uint8_t ao_packet_restart; +struct ao_task ao_packet_task; +uint8_t ao_packet_enable; +uint8_t ao_packet_restart; #if PACKET_HAS_MASTER -__xdata uint8_t ao_packet_master_sleeping; +uint8_t ao_packet_master_sleeping; #endif void @@ -150,7 +150,7 @@ ao_packet_flush(void) #endif /* PACKET_HAS_MASTER */ void -ao_packet_putchar(char c) __reentrant +ao_packet_putchar(char c) { /* No need to block interrupts, all variables here * are only manipulated in task context diff --git a/src/drivers/ao_packet_master.c b/src/drivers/ao_packet_master.c index e63771e5..68a5efef 100644 --- a/src/drivers/ao_packet_master.c +++ b/src/drivers/ao_packet_master.c @@ -39,7 +39,7 @@ ao_packet_getchar(void) } static void -ao_packet_echo(void) __reentrant +ao_packet_echo(void) { int c; while (ao_packet_enable) { @@ -50,9 +50,9 @@ ao_packet_echo(void) __reentrant ao_exit(); } -static __xdata struct ao_task ao_packet_echo_task; -static __xdata uint16_t ao_packet_master_delay; -static __xdata uint16_t ao_packet_master_time; +static struct ao_task ao_packet_echo_task; +static uint16_t ao_packet_master_delay; +static uint16_t ao_packet_master_time; #define AO_PACKET_MASTER_DELAY_SHORT AO_MS_TO_TICKS(100) #define AO_PACKET_MASTER_DELAY_LONG AO_MS_TO_TICKS(1000) @@ -114,7 +114,7 @@ ao_packet_master(void) } static void -ao_packet_forward(void) __reentrant +ao_packet_forward(void) { char c; ao_packet_enable = 1; @@ -152,7 +152,7 @@ ao_packet_signal(void) printf ("RSSI: %d\n", ao_radio_rssi); } -__code struct ao_cmds ao_packet_master_cmds[] = { +const struct ao_cmds ao_packet_master_cmds[] = { { ao_packet_forward, "p\0Remote packet link." }, { ao_packet_signal, "s\0Report signal strength." }, { 0, NULL }, diff --git a/src/drivers/ao_pad.c b/src/drivers/ao_pad.c index 208841fb..7e139c78 100644 --- a/src/drivers/ao_pad.c +++ b/src/drivers/ao_pad.c @@ -22,14 +22,14 @@ #include <ao_74hc165.h> #include <ao_radio_cmac.h> -static __xdata uint8_t ao_pad_ignite; -static __xdata struct ao_pad_command command; -static __xdata struct ao_pad_query query; -static __pdata uint8_t ao_pad_armed; -static __pdata uint16_t ao_pad_arm_time; -static __pdata uint8_t ao_pad_box; -static __xdata uint8_t ao_pad_disabled; -static __pdata uint16_t ao_pad_packet_time; +static uint8_t ao_pad_ignite; +static struct ao_pad_command command; +static struct ao_pad_query query; +static uint8_t ao_pad_armed; +static uint16_t ao_pad_arm_time; +static uint8_t ao_pad_box; +static uint8_t ao_pad_disabled; +static uint16_t ao_pad_packet_time; #ifndef AO_PAD_RSSI_MINIMUM #define AO_PAD_RSSI_MINIMUM -90 @@ -38,7 +38,7 @@ static __pdata uint16_t ao_pad_packet_time; #define DEBUG 1 #if DEBUG -static __pdata uint8_t ao_pad_debug; +static uint8_t ao_pad_debug; #define PRINTD(...) (ao_pad_debug ? (printf(__VA_ARGS__), 0) : 0) #define FLUSHD() (ao_pad_debug ? (flush(), 0) : 0) #else @@ -189,17 +189,17 @@ ao_pad_monitor(void) { uint8_t c; uint8_t sample; - __pdata AO_LED_TYPE prev = 0, cur = 0; - __pdata uint8_t beeping = 0; - __xdata volatile struct ao_data *packet; - __pdata uint16_t arm_beep_time = 0; + AO_LED_TYPE prev = 0, cur = 0; + uint8_t beeping = 0; + volatile struct ao_data *packet; + uint16_t arm_beep_time = 0; sample = ao_data_head; ao_led_set(LEDS_AVAILABLE); ao_delay(AO_MS_TO_TICKS(1000)); ao_led_set(0); for (;;) { - __pdata int16_t pyro; + int16_t pyro; ao_arch_critical( while (sample == ao_data_head) @@ -526,9 +526,9 @@ ao_pad_manual(void) } } -static __xdata struct ao_task ao_pad_task; -static __xdata struct ao_task ao_pad_ignite_task; -static __xdata struct ao_task ao_pad_monitor_task; +static struct ao_task ao_pad_task; +static struct ao_task ao_pad_ignite_task; +static struct ao_task ao_pad_monitor_task; #if DEBUG void @@ -560,7 +560,7 @@ ao_pad_alarm_debug(void) } #endif -__code struct ao_cmds ao_pad_cmds[] = { +const struct ao_cmds ao_pad_cmds[] = { { ao_pad_test, "t\0Test pad continuity" }, { ao_pad_manual, "i <key> <n>\0Fire igniter. <key> is doit with D&I" }, #if DEBUG diff --git a/src/drivers/ao_pca9922.c b/src/drivers/ao_pca9922.c index 09f52a0e..3516f03a 100644 --- a/src/drivers/ao_pca9922.c +++ b/src/drivers/ao_pca9922.c @@ -23,7 +23,7 @@ #include <ao.h> -static __xdata uint8_t ao_led_state; +static uint8_t ao_led_state; static void ao_led_apply(void) @@ -93,7 +93,7 @@ ao_led_toggle(uint8_t colors) } void -ao_led_for(uint8_t colors, uint16_t ticks) __reentrant +ao_led_for(uint8_t colors, uint16_t ticks) { ao_led_on(colors); ao_delay(ticks); diff --git a/src/drivers/ao_pyro_slave.c b/src/drivers/ao_pyro_slave.c index a293d929..8ea6d858 100644 --- a/src/drivers/ao_pyro_slave.c +++ b/src/drivers/ao_pyro_slave.c @@ -33,7 +33,7 @@ static const struct ao_companion_setup ao_telepyro_setup = { struct ao_config ao_config; -extern volatile __data uint16_t ao_tick_count; +extern volatile uint16_t ao_tick_count; uint16_t ao_boost_tick; void ao_spi_slave(void) diff --git a/src/drivers/ao_quadrature.c b/src/drivers/ao_quadrature.c index 250e035f..20781c40 100644 --- a/src/drivers/ao_quadrature.c +++ b/src/drivers/ao_quadrature.c @@ -22,7 +22,7 @@ #include <ao_fast_timer.h> #include <ao_event.h> -__xdata int32_t ao_quadrature_count[AO_QUADRATURE_COUNT]; +int32_t ao_quadrature_count[AO_QUADRATURE_COUNT]; #ifndef AO_QUADRATURE_SINGLE_CODE static int8_t ao_quadrature_step[AO_QUADRATURE_COUNT]; #endif diff --git a/src/drivers/ao_quadrature.h b/src/drivers/ao_quadrature.h index a99e4cc5..ee551f65 100644 --- a/src/drivers/ao_quadrature.h +++ b/src/drivers/ao_quadrature.h @@ -19,7 +19,7 @@ #ifndef _AO_QUADRATURE_H_ #define _AO_QUADRATURE_H_ -extern __xdata int32_t ao_quadrature_count[AO_QUADRATURE_COUNT]; +extern int32_t ao_quadrature_count[AO_QUADRATURE_COUNT]; int32_t ao_quadrature_wait(uint8_t q); diff --git a/src/drivers/ao_radio_master.c b/src/drivers/ao_radio_master.c index 79e4b22b..8b62a4de 100644 --- a/src/drivers/ao_radio_master.c +++ b/src/drivers/ao_radio_master.c @@ -21,15 +21,15 @@ #include <ao_exti.h> #include <ao_radio_cmac.h> -static __xdata struct ao_radio_spi_reply ao_radio_spi_reply; -static __xdata struct ao_radio_spi_request ao_radio_spi_request; -static volatile __xdata uint8_t ao_radio_wait_mode; -static volatile __xdata uint8_t ao_radio_done = 0; -static volatile __xdata uint8_t ao_radio_ready = 1; -static __xdata uint8_t ao_radio_mutex; -static __xdata uint8_t ao_radio_aes_seq; +static struct ao_radio_spi_reply ao_radio_spi_reply; +static struct ao_radio_spi_request ao_radio_spi_request; +static volatile uint8_t ao_radio_wait_mode; +static volatile uint8_t ao_radio_done = 0; +static volatile uint8_t ao_radio_ready = 1; +static uint8_t ao_radio_mutex; +static uint8_t ao_radio_aes_seq; -__xdata int8_t ao_radio_cmac_rssi; +int8_t ao_radio_cmac_rssi; #if 0 #define PRINTD(...) do { printf ("\r%5u %s: ", ao_tick_count, __func__); printf(__VA_ARGS__); flush(); } while(0) @@ -126,7 +126,7 @@ ao_radio_put(void) } static void -ao_radio_get_data(__xdata void *d, uint8_t size) +ao_radio_get_data(void *d, uint8_t size) { PRINTD ("fetch\n"); ao_radio_master_start(); @@ -157,7 +157,7 @@ ao_radio_send(const void *d, uint8_t size) uint8_t -ao_radio_recv(__xdata void *d, uint8_t size, uint8_t timeout) +ao_radio_recv(void *d, uint8_t size, uint8_t timeout) { int8_t ret; uint8_t recv; @@ -198,7 +198,7 @@ ao_radio_cmac_set_key(void) } int8_t -ao_radio_cmac_send(__xdata void *packet, uint8_t len) __reentrant +ao_radio_cmac_send(void *packet, uint8_t len) { if (len > AO_CMAC_MAX_LEN) return AO_RADIO_CMAC_LEN_ERROR; @@ -220,7 +220,7 @@ ao_radio_cmac_send(__xdata void *packet, uint8_t len) __reentrant } int8_t -ao_radio_cmac_recv(__xdata void *packet, uint8_t len, uint16_t timeout) __reentrant +ao_radio_cmac_recv(void *packet, uint8_t len, uint16_t timeout) { int8_t ret; int8_t recv; @@ -296,7 +296,7 @@ ao_radio_test_cmd(void) ao_radio_test(0); } -__code struct ao_cmds ao_radio_cmds[] = { +const struct ao_cmds ao_radio_cmds[] = { { ao_radio_test_cmd, "C <1 start, 0 stop, none both>\0Radio carrier test" }, { 0, NULL }, }; diff --git a/src/drivers/ao_radio_slave.c b/src/drivers/ao_radio_slave.c index 2f1dab29..7859d6b6 100644 --- a/src/drivers/ao_radio_slave.c +++ b/src/drivers/ao_radio_slave.c @@ -20,11 +20,11 @@ #include <ao_radio_spi.h> #include <ao_radio_cmac.h> -static __xdata struct ao_radio_spi_reply ao_radio_spi_reply; +static struct ao_radio_spi_reply ao_radio_spi_reply; -static __xdata struct ao_radio_spi_request ao_radio_spi_request; +static struct ao_radio_spi_request ao_radio_spi_request; -static __xdata uint8_t slave_state; +static uint8_t slave_state; static void ao_radio_slave_low(void) @@ -123,7 +123,7 @@ ao_radio_slave_spi(void) } } -static __xdata struct ao_task ao_radio_slave_spi_task; +static struct ao_task ao_radio_slave_spi_task; void ao_radio_slave_init(void) diff --git a/src/drivers/ao_watchdog.c b/src/drivers/ao_watchdog.c index 1a877fcb..01c3cd0e 100644 --- a/src/drivers/ao_watchdog.c +++ b/src/drivers/ao_watchdog.c @@ -46,7 +46,7 @@ ao_watchdog_set(void) } -static __code struct ao_cmds ao_watchdog_cmds[] = { +static const struct ao_cmds ao_watchdog_cmds[] = { { ao_watchdog_set, "Q <0 off, 1 on>\0Enable or disable watchdog timer" }, { 0, NULL }, }; |