/* Yield the processor to another task */
void
-ao_yield(void) _naked;
+ao_yield(void) __naked;
/* Add a task to the run queue */
void
/* Timer interrupt */
void
-ao_timer_isr(void) interrupt 9;
+ao_timer_isr(void) __interrupt 9;
/* Initialize the timer */
void
/* The A/D interrupt handler */
void
-ao_adc_isr(void) interrupt 1;
+ao_adc_isr(void) __interrupt 1;
/* Initialize the A/D converter */
void
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
*/
/* USB interrupt handler */
void
-ao_usb_isr(void) interrupt 6;
+ao_usb_isr(void) __interrupt 6;
/* Enable the USB controller */
void
/* DMA interrupt routine */
void
-ao_dma_isr(void) interrupt 8;
+ao_dma_isr(void) __interrupt 8;
/*
* ao_mutex.c
uint8_t year;
uint8_t month;
uint8_t day;
+ uint8_t extra;
} gps_date;
struct {
uint16_t d0;
};
/* 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
#if HAS_SERIAL_1
void
-ao_serial_rx1_isr(void) interrupt 3;
+ao_serial_rx1_isr(void) __interrupt 3;
void
-ao_serial_tx1_isr(void) interrupt 14;
+ao_serial_tx1_isr(void) __interrupt 14;
char
ao_serial_getchar(void) __critical;
uint8_t c_n_1;
};
+#define AO_MAX_GPS_TRACKING 12
+
struct ao_gps_tracking_data {
uint8_t channels;
- struct ao_gps_sat_data sats[12];
+ struct ao_gps_sat_data sats[AO_MAX_GPS_TRACKING];
};
extern __xdata uint8_t ao_gps_mutex;
*/
#define AO_MAX_CALLSIGN 8
-#define AO_TELEMETRY_VERSION 2
+#define AO_TELEMETRY_VERSION 3
struct ao_telemetry {
uint8_t addr;
extern __xdata uint8_t ao_radio_mutex;
void
-ao_radio_general_isr(void) interrupt 16;
+ao_radio_general_isr(void) __interrupt 16;
void
ao_radio_get(void);
* 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[];
* Packet-based command interface
*/
-#define AO_PACKET_MAX 8
+#define AO_PACKET_MAX 64
#define AO_PACKET_SYN (uint8_t) 0xff
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 {