X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fao.h;h=8db22799f24df6fca7ec59fb30cc54416572d504;hp=b43f5ecd1132f190bda58524834d6fa8a585f570;hb=68b2b66d7574dfd0bd5e3571b8ffad32ca5d2b73;hpb=84c93bb2fc4558a5e4654794ba90e730a84eaf67 diff --git a/src/ao.h b/src/ao.h index b43f5ecd..8db22799 100644 --- a/src/ao.h +++ b/src/ao.h @@ -43,7 +43,7 @@ struct ao_task { __xdata void *wchan; /* current wait channel (NULL if running) */ uint16_t alarm; /* abort ao_sleep time */ uint8_t stack_count; /* amount of saved stack */ - uint8_t task_id; /* index in the task array */ + uint8_t task_id; /* unique id */ __code char *name; /* task name */ uint8_t stack[AO_STACK_SIZE]; /* saved stack */ }; @@ -110,6 +110,7 @@ ao_start_scheduler(void); #define AO_PANIC_STDIO 7 /* Too many stdio handlers registered */ #define AO_PANIC_REBOOT 8 /* Reboot failed */ #define AO_PANIC_FLASH 9 /* Invalid flash part (or wrong blocksize) */ +#define AO_PANIC_USB 10 /* Trying to send USB packet while busy */ /* Stop the operating system, beeping and blinking the reason */ void @@ -263,8 +264,6 @@ ao_beep_init(void); */ #define AO_LED_NONE 0 -#define AO_LED_GREEN 1 -#define AO_LED_RED 2 /* Turn on the specified LEDs */ void @@ -290,6 +289,18 @@ ao_led_for(uint8_t colors, uint16_t ticks) __reentrant; void ao_led_init(uint8_t enable); +/* + * ao_romconfig.c + */ + +#define AO_ROMCONFIG_VERSION 2 + +extern __code __at (0x00a0) uint16_t ao_romconfig_version; +extern __code __at (0x00a2) uint16_t ao_romconfig_check; +extern __code __at (0x00a4) uint16_t ao_serial_number; +extern __code __at (0x00a6) uint32_t ao_radio_cal; +extern __code __at (0x00aa) uint8_t ao_usb_descriptors []; + /* * ao_usb.c */ @@ -553,6 +564,7 @@ struct ao_log_record { uint8_t year; uint8_t month; uint8_t day; + uint8_t extra; } gps_date; struct { uint16_t d0; @@ -562,8 +574,8 @@ struct ao_log_record { }; /* Write a record to the eeprom log */ -void -ao_log_data(struct ao_log_record *log); +uint8_t +ao_log_data(__xdata struct ao_log_record *log) __reentrant; /* Flush the log */ void @@ -805,7 +817,7 @@ ao_gps_report_init(void); */ #define AO_MAX_CALLSIGN 8 -#define AO_TELEMETRY_VERSION 2 +#define AO_TELEMETRY_VERSION 3 struct ao_telemetry { uint8_t addr; @@ -998,8 +1010,7 @@ ao_rssi_init(uint8_t rssi_led); * each instance of a product */ -extern const uint8_t ao_usb_descriptors []; -extern const uint16_t ao_serial_number; +extern __code __at(0x00aa) uint8_t ao_usb_descriptors []; extern const char ao_version[]; extern const char ao_manufacturer[]; extern const char ao_product[]; @@ -1035,7 +1046,7 @@ struct ao_fifo { * Packet-based command interface */ -#define AO_PACKET_MAX 8 +#define AO_PACKET_MAX 64 #define AO_PACKET_SYN (uint8_t) 0xff struct ao_packet { @@ -1044,6 +1055,7 @@ struct ao_packet { uint8_t seq; uint8_t ack; uint8_t d[AO_PACKET_MAX]; + uint8_t callsign[AO_MAX_CALLSIGN]; }; struct ao_packet_recv {