summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile2
-rw-r--r--src/Makefile.proto5
-rw-r--r--src/Version.in1
-rw-r--r--src/ao.h38
-rw-r--r--src/ao_adc.c2
-rw-r--r--src/ao_cmd.c3
-rw-r--r--src/ao_config.c10
-rw-r--r--src/ao_dma.c2
-rw-r--r--src/ao_gps_report.c4
-rw-r--r--src/ao_gps_skytraq.c14
-rw-r--r--src/ao_gps_test.c4
-rw-r--r--src/ao_gps_test_skytraq.c4
-rw-r--r--src/ao_log.c5
-rw-r--r--src/ao_packet_master.c13
-rw-r--r--src/ao_product.c3
-rw-r--r--src/ao_radio.c2
-rw-r--r--src/ao_romconfig.c32
-rw-r--r--src/ao_serial.c4
-rw-r--r--src/ao_timer.c2
-rw-r--r--src/ao_usb.c7
-rw-r--r--src/cc1111.h108
-rw-r--r--src/teledongle-v0.1/.gitignore2
-rw-r--r--src/teledongle-v0.1/Makefile.defs2
-rw-r--r--src/teledongle-v0.2/.gitignore2
-rw-r--r--src/teledongle-v0.2/Makefile.defs2
-rw-r--r--src/telemetrum-v0.1-sirf/.gitignore2
-rw-r--r--src/telemetrum-v0.1-sirf/Makefile.defs2
-rw-r--r--src/telemetrum-v0.1-sky/.gitignore2
-rw-r--r--src/telemetrum-v0.1-sky/.sdcdbrc1
-rw-r--r--src/telemetrum-v0.1-sky/Makefile.defs2
-rw-r--r--src/telemetrum-v1.0/.gitignore2
-rw-r--r--src/telemetrum-v1.0/.sdcdbrc1
-rw-r--r--src/telemetrum-v1.0/Makefile.defs2
-rw-r--r--src/tidongle/.gitignore2
-rw-r--r--src/tidongle/Makefile.defs2
35 files changed, 176 insertions, 115 deletions
diff --git a/src/Makefile b/src/Makefile
index 24f562e1..95d24425 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,6 +4,8 @@
#
CC=sdcc
+include Version
+
SUBDIRS=telemetrum-v1.0 teledongle-v0.2 telemetrum-v0.1-sky telemetrum-v0.1-sirf teledongle-v0.1 tidongle test
all: all-recursive
diff --git a/src/Makefile.proto b/src/Makefile.proto
index eedb878a..b23eb257 100644
--- a/src/Makefile.proto
+++ b/src/Makefile.proto
@@ -10,7 +10,7 @@ vpath ao-make-product.5c ..
CC=sdcc
ifndef VERSION
-VERSION=$(shell git describe)
+include ../Version
endif
CFLAGS=--model-small --debug --opt-code-speed
@@ -35,6 +35,7 @@ ALTOS_SRC = \
ao_panic.c \
ao_task.c \
ao_timer.c \
+ ao_romconfig.c \
_bp.c
#
@@ -213,7 +214,7 @@ all: ../$(PROG)
../altitude.h: make-altitude
nickle $< > $@
-ao_product.h: ao-make-product.5c
+ao_product.h: ao-make-product.5c ../Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
ao_product.rel: ao_product.c ao_product.h
diff --git a/src/Version.in b/src/Version.in
new file mode 100644
index 00000000..aff9490b
--- /dev/null
+++ b/src/Version.in
@@ -0,0 +1 @@
+VERSION=@VERSION@
diff --git a/src/ao.h b/src/ao.h
index 5f2b8339..5b174947 100644
--- a/src/ao.h
+++ b/src/ao.h
@@ -79,7 +79,7 @@ ao_alarm(uint16_t delay);
/* Yield the processor to another task */
void
-ao_yield(void) _naked;
+ao_yield(void) __naked;
/* Add a task to the run queue */
void
@@ -139,7 +139,7 @@ ao_timer_set_adc_interval(uint8_t interval) __critical;
/* Timer interrupt */
void
-ao_timer_isr(void) interrupt 9;
+ao_timer_isr(void) __interrupt 9;
/* Initialize the timer */
void
@@ -198,7 +198,7 @@ ao_adc_get(__xdata struct ao_adc *packet);
/* The A/D interrupt handler */
void
-ao_adc_isr(void) interrupt 1;
+ao_adc_isr(void) __interrupt 1;
/* Initialize the A/D converter */
void
@@ -290,6 +290,18 @@ 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
*/
@@ -313,7 +325,7 @@ ao_usb_flush(void);
/* USB interrupt handler */
void
-ao_usb_isr(void) interrupt 6;
+ao_usb_isr(void) __interrupt 6;
/* Enable the USB controller */
void
@@ -413,7 +425,7 @@ ao_dma_abort(uint8_t id);
/* DMA interrupt routine */
void
-ao_dma_isr(void) interrupt 8;
+ao_dma_isr(void) __interrupt 8;
/*
* ao_mutex.c
@@ -552,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;
@@ -561,7 +574,7 @@ struct ao_log_record {
};
/* Write a record to the eeprom log */
-void
+uint8_t
ao_log_data(__xdata struct ao_log_record *log) __reentrant;
/* Flush the log */
@@ -709,10 +722,10 @@ ao_dbg_init(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;
@@ -768,9 +781,11 @@ struct ao_gps_sat_data {
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;
@@ -848,7 +863,7 @@ extern __xdata uint8_t ao_radio_done;
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);
@@ -997,8 +1012,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[];
diff --git a/src/ao_adc.c b/src/ao_adc.c
index 50f96848..49d2519e 100644
--- a/src/ao_adc.c
+++ b/src/ao_adc.c
@@ -41,7 +41,7 @@ ao_adc_get(__xdata struct ao_adc *packet)
}
void
-ao_adc_isr(void) interrupt 1
+ao_adc_isr(void) __interrupt 1
{
uint8_t sequence;
uint8_t __xdata *a;
diff --git a/src/ao_cmd.c b/src/ao_cmd.c
index 4a68fba4..a54a2316 100644
--- a/src/ao_cmd.c
+++ b/src/ao_cmd.c
@@ -263,13 +263,12 @@ ao_cmd_register(__code struct ao_cmds *cmds)
}
void
-ao_cmd(void *parameters)
+ao_cmd(void)
{
__xdata char c;
__xdata uint8_t cmd, cmds;
__code struct ao_cmds * __xdata cs;
void (*__xdata func)(void);
- (void) parameters;
lex_echo = 1;
for (;;) {
diff --git a/src/ao_config.c b/src/ao_config.c
index cbd639a5..88b52dc0 100644
--- a/src/ao_config.c
+++ b/src/ao_config.c
@@ -27,16 +27,6 @@ __xdata uint8_t ao_config_mutex;
#define AO_CONFIG_DEFAULT_CALLSIGN "N0CALL"
#define AO_CONFIG_DEFAULT_ACCEL_ZERO_G 16000
#define AO_CONFIG_DEFAULT_APOGEE_DELAY 0
-/*
- * For 434.550MHz, the frequency value is:
- *
- * 434.550e6 / (24e6 / 2**16) = 1186611.2
- *
- * This value is stored in a const variable so that
- * ao-load can change it during programming for
- * devices that have no eeprom for config data.
- */
-const uint32_t ao_radio_cal = 1186611;
#if HAS_EEPROM
static void
diff --git a/src/ao_dma.c b/src/ao_dma.c
index 110138b5..946666ab 100644
--- a/src/ao_dma.c
+++ b/src/ao_dma.c
@@ -112,7 +112,7 @@ ao_dma_abort(uint8_t id)
}
void
-ao_dma_isr(void) interrupt 8
+ao_dma_isr(void) __interrupt 8
{
uint8_t id, mask;
diff --git a/src/ao_gps_report.c b/src/ao_gps_report.c
index cceb79ff..7abc93f5 100644
--- a/src/ao_gps_report.c
+++ b/src/ao_gps_report.c
@@ -51,12 +51,12 @@ ao_gps_report(void)
gps_log.u.gps_altitude.unused = 0xffff;
ao_log_data(&gps_log);
if (!date_reported && (gps_data.flags & AO_GPS_DATE_VALID)) {
- date_reported = 1;
gps_log.type = AO_LOG_GPS_DATE;
gps_log.u.gps_date.year = gps_data.year;
gps_log.u.gps_date.month = gps_data.month;
gps_log.u.gps_date.day = gps_data.day;
- ao_log_data(&gps_log);
+ gps_log.u.gps_date.extra = 0;
+ date_reported = ao_log_data(&gps_log);
}
}
}
diff --git a/src/ao_gps_skytraq.c b/src/ao_gps_skytraq.c
index ae8c7ef7..2d3d464c 100644
--- a/src/ao_gps_skytraq.c
+++ b/src/ao_gps_skytraq.c
@@ -333,14 +333,19 @@ ao_gps(void) __reentrant
ao_gps_skip_field(); /* sats in view */
while (ao_gps_char != '*' && ao_gps_char != '\n' && ao_gps_char != '\r') {
i = ao_gps_tracking_next.channels;
- ao_gps_tracking_next.sats[i].svid = ao_gps_decimal(2); /* SVID */
+ c = ao_gps_decimal(2); /* SVID */
+ if (i < AO_MAX_GPS_TRACKING)
+ ao_gps_tracking_next.sats[i].svid = c;
ao_gps_lexchar();
ao_gps_skip_field(); /* elevation */
ao_gps_lexchar();
ao_gps_skip_field(); /* azimuth */
- if (!(ao_gps_tracking_next.sats[i].c_n_1 = ao_gps_decimal(2))) /* C/N0 */
- ao_gps_tracking_next.sats[i].svid = 0;
- ao_gps_tracking_next.channels = i + 1;
+ c = ao_gps_decimal(2); /* C/N0 */
+ if (i < AO_MAX_GPS_TRACKING) {
+ if (!(ao_gps_tracking_next.sats[i].c_n_1 = c))
+ ao_gps_tracking_next.sats[i].svid = 0;
+ ao_gps_tracking_next.channels = i + 1;
+ }
}
if (ao_gps_char == '*') {
uint8_t cksum = ao_gps_cksum ^ '*';
@@ -422,6 +427,7 @@ gps_dump(void) __reentrant
printf ("Time: %02d:%02d:%02d\n", ao_gps_data.hour, ao_gps_data.minute, ao_gps_data.second);
printf ("Lat/Lon: %ld %ld\n", ao_gps_data.latitude, ao_gps_data.longitude);
printf ("Alt: %d\n", ao_gps_data.altitude);
+ printf ("Flags: 0x%x\n", ao_gps_data.flags);
ao_mutex_put(&ao_gps_mutex);
}
diff --git a/src/ao_gps_test.c b/src/ao_gps_test.c
index cdcc6f4c..edb51304 100644
--- a/src/ao_gps_test.c
+++ b/src/ao_gps_test.c
@@ -62,9 +62,11 @@ struct ao_gps_sat_data {
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];
};
void
diff --git a/src/ao_gps_test_skytraq.c b/src/ao_gps_test_skytraq.c
index 7fa10eaa..4010e09c 100644
--- a/src/ao_gps_test_skytraq.c
+++ b/src/ao_gps_test_skytraq.c
@@ -63,9 +63,11 @@ struct ao_gps_sat_data {
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];
};
void
diff --git a/src/ao_log.c b/src/ao_log.c
index d550d408..18bdb8c8 100644
--- a/src/ao_log.c
+++ b/src/ao_log.c
@@ -33,14 +33,16 @@ ao_log_csum(__xdata uint8_t *b) __reentrant
return -sum;
}
-void
+uint8_t
ao_log_data(__xdata struct ao_log_record *log) __reentrant
{
+ uint8_t wrote = 0;
/* set checksum */
log->csum = 0;
log->csum = ao_log_csum((__xdata uint8_t *) log);
ao_mutex_get(&ao_log_mutex); {
if (ao_log_running) {
+ wrote = 1;
ao_ee_write(ao_log_current_pos,
(uint8_t *) log,
sizeof (struct ao_log_record));
@@ -51,6 +53,7 @@ ao_log_data(__xdata struct ao_log_record *log) __reentrant
ao_log_running = 0;
}
} ao_mutex_put(&ao_log_mutex);
+ return wrote;
}
void
diff --git a/src/ao_packet_master.c b/src/ao_packet_master.c
index 72bb908a..641b49f4 100644
--- a/src/ao_packet_master.c
+++ b/src/ao_packet_master.c
@@ -29,6 +29,8 @@ ao_packet_getchar(void) __critical
ao_wake_task(&ao_packet_task);
ao_usb_flush();
ao_sleep(&ao_stdin_ready);
+ if (!ao_packet_enable)
+ break;
}
return c;
}
@@ -121,12 +123,15 @@ ao_packet_forward(void) __reentrant
if (c == '\r') c = '\n';
ao_packet_putchar(c);
}
+
+ /* Wait for a second if there is any pending data */
+ for (c = 0; (ao_packet_tx_used || ao_tx_packet.len) && c < 10; c++)
+ ao_delay(AO_MS_TO_TICKS(100));
ao_packet_enable = 0;
- ao_radio_abort();
while (ao_packet_echo_task.wchan || ao_packet_task.wchan) {
- ao_wake_task(&ao_packet_echo_task);
- ao_wake_task(&ao_packet_task);
- ao_yield();
+ if (ao_packet_echo_task.wchan)
+ ao_wake_task(&ao_packet_echo_task);
+ ao_delay(AO_MS_TO_TICKS(10));
}
}
diff --git a/src/ao_product.c b/src/ao_product.c
index 2bd0b59c..82d6298f 100644
--- a/src/ao_product.c
+++ b/src/ao_product.c
@@ -21,7 +21,6 @@
/* Defines which mark this particular AltOS product */
-const uint16_t ao_serial_number = AO_iSerial_NUMBER;
const char ao_version[] = AO_iVersion_STRING;
const char ao_manufacturer[] = AO_iManufacturer_STRING;
const char ao_product[] = AO_iProduct_STRING;
@@ -29,7 +28,7 @@ const char ao_product[] = AO_iProduct_STRING;
#define LE_WORD(x) ((x)&0xFF),((uint8_t) (((uint16_t) (x))>>8))
/* USB descriptors in one giant block of bytes */
-const uint8_t ao_usb_descriptors [] =
+__code __at(0x00aa) uint8_t ao_usb_descriptors [] =
{
/* Device descriptor */
0x12,
diff --git a/src/ao_radio.c b/src/ao_radio.c
index 0849349e..f4a9d3b2 100644
--- a/src/ao_radio.c
+++ b/src/ao_radio.c
@@ -275,7 +275,7 @@ __xdata uint8_t ao_radio_done;
__xdata uint8_t ao_radio_mutex;
void
-ao_radio_general_isr(void) interrupt 16
+ao_radio_general_isr(void) __interrupt 16
{
S1CON &= ~0x03;
if (RFIF & RFIF_IM_TIMEOUT) {
diff --git a/src/ao_romconfig.c b/src/ao_romconfig.c
new file mode 100644
index 00000000..f3fe61b1
--- /dev/null
+++ b/src/ao_romconfig.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2010 Keith Packard <keithp@keithp.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include "ao.h"
+
+__code __at (0x00a0) uint16_t ao_romconfig_version = AO_ROMCONFIG_VERSION;
+__code __at (0x00a2) uint16_t ao_romconfig_check = ~AO_ROMCONFIG_VERSION;
+__code __at (0x00a4) uint16_t ao_serial_number = 0;
+/*
+ * For 434.550MHz, the frequency value is:
+ *
+ * 434.550e6 / (24e6 / 2**16) = 1186611.2
+ *
+ * This value is stored in a const variable so that
+ * ao-load can change it during programming for
+ * devices that have no eeprom for config data.
+ */
+__code __at (0x00a6) uint32_t ao_radio_cal = 1186611;
diff --git a/src/ao_serial.c b/src/ao_serial.c
index 3f103766..a48734c2 100644
--- a/src/ao_serial.c
+++ b/src/ao_serial.c
@@ -21,7 +21,7 @@ volatile __xdata struct ao_fifo ao_usart1_rx_fifo;
volatile __xdata struct ao_fifo ao_usart1_tx_fifo;
void
-ao_serial_rx1_isr(void) interrupt 3
+ao_serial_rx1_isr(void) __interrupt 3
{
if (!ao_fifo_full(ao_usart1_rx_fifo))
ao_fifo_insert(ao_usart1_rx_fifo, U1DBUF);
@@ -42,7 +42,7 @@ ao_serial_tx1_start(void)
}
void
-ao_serial_tx1_isr(void) interrupt 14
+ao_serial_tx1_isr(void) __interrupt 14
{
UTX1IF = 0;
ao_serial_tx1_started = 0;
diff --git a/src/ao_timer.c b/src/ao_timer.c
index d1731475..c977fbc8 100644
--- a/src/ao_timer.c
+++ b/src/ao_timer.c
@@ -41,7 +41,7 @@ volatile __data uint8_t ao_adc_interval = 1;
volatile __data uint8_t ao_adc_count;
#endif
-void ao_timer_isr(void) interrupt 9
+void ao_timer_isr(void) __interrupt 9
{
++ao_tick_count;
#if HAS_ADC
diff --git a/src/ao_usb.c b/src/ao_usb.c
index f6e0fcf9..b4e3f1fe 100644
--- a/src/ao_usb.c
+++ b/src/ao_usb.c
@@ -43,7 +43,7 @@ ao_usb_set_interrupts(void)
* so when we hook that up, fix this
*/
void
-ao_usb_isr(void) interrupt 6
+ao_usb_isr(void) __interrupt 6
{
USBIF = 0;
ao_usb_iif |= USBIIF;
@@ -383,8 +383,11 @@ ao_usb_pollchar(void) __critical
if ((USBCSOL & USBCSOL_OUTPKT_RDY) == 0)
return AO_READ_AGAIN;
ao_usb_out_bytes = (USBCNTH << 8) | USBCNTL;
- if (ao_usb_out_bytes == 0)
+ if (ao_usb_out_bytes == 0) {
+ USBINDEX = AO_USB_OUT_EP;
+ USBCSOL &= ~USBCSOL_OUTPKT_RDY;
return AO_READ_AGAIN;
+ }
}
--ao_usb_out_bytes;
c = USBFIFO[AO_USB_OUT_EP << 1];
diff --git a/src/cc1111.h b/src/cc1111.h
index e8302df2..20ed052a 100644
--- a/src/cc1111.h
+++ b/src/cc1111.h
@@ -40,16 +40,16 @@
#include <cc1110.h>
#include <stdint.h>
-sfr at 0xA8 IEN0; /* Interrupt Enable 0 Register */
+sfr __at 0xA8 IEN0; /* Interrupt Enable 0 Register */
-sbit at 0xA8 RFTXRXIE; /* RF TX/RX done interrupt enable */
-sbit at 0xA9 ADCIE; /* ADC interrupt enable */
-sbit at 0xAA URX0IE; /* USART0 RX interrupt enable */
-sbit at 0xAB URX1IE; /* USART1 RX interrupt enable (shared with I2S RX) */
-sbit at 0xAB I2SRXIE; /* I2S RX interrupt enable (shared with USART1 RX) */
-sbit at 0xAC ENCIE; /* AES encryption/decryption interrupt enable */
-sbit at 0xAD STIE; /* Sleep Timer interrupt enable */
-sbit at 0xAF EA; /* Enable All */
+sbit __at 0xA8 RFTXRXIE; /* RF TX/RX done interrupt enable */
+sbit __at 0xA9 ADCIE; /* ADC interrupt enable */
+sbit __at 0xAA URX0IE; /* USART0 RX interrupt enable */
+sbit __at 0xAB URX1IE; /* USART1 RX interrupt enable (shared with I2S RX) */
+sbit __at 0xAB I2SRXIE; /* I2S RX interrupt enable (shared with USART1 RX) */
+sbit __at 0xAC ENCIE; /* AES encryption/decryption interrupt enable */
+sbit __at 0xAD STIE; /* Sleep Timer interrupt enable */
+sbit __at 0xAF EA; /* Enable All */
#define IEN0_EA (1 << 7)
#define IEN0_STIE (1 << 5)
@@ -60,7 +60,7 @@ sbit at 0xAF EA; /* Enable All */
#define IEN0_ADCIE (1 << 1)
#define IEN0_RFTXRXIE (1 << 0)
-sfr at 0xB8 IEN1; /* Interrupt Enable 1 Register */
+sfr __at 0xB8 IEN1; /* Interrupt Enable 1 Register */
#define IEN1_P0IE (1 << 5) /* Port 0 interrupt enable */
#define IEN1_T4IE (1 << 4) /* Timer 4 interrupt enable */
@@ -70,7 +70,7 @@ sfr at 0xB8 IEN1; /* Interrupt Enable 1 Register */
#define IEN1_DMAIE (1 << 0) /* DMA transfer interrupt enable */
/* IEN2 */
-sfr at 0x9A IEN2; /* Interrupt Enable 2 Register */
+sfr __at 0x9A IEN2; /* Interrupt Enable 2 Register */
#define IEN2_WDTIE (1 << 5) /* Watchdog timer interrupt enable */
#define IEN2_P1IE (1 << 4) /* Port 1 interrupt enable */
@@ -82,7 +82,7 @@ sfr at 0x9A IEN2; /* Interrupt Enable 2 Register */
#define IEN2_RFIE (1 << 0) /* RF general interrupt enable */
/* CLKCON 0xC6 */
-sfr at 0xC6 CLKCON; /* Clock Control */
+sfr __at 0xC6 CLKCON; /* Clock Control */
#define CLKCON_OSC32K_RC (1 << 7)
#define CLKCON_OSC32K_XTAL (0 << 7)
@@ -126,20 +126,20 @@ sfr at 0xC6 CLKCON; /* Clock Control */
#define SLEEP_MODE_MASK (3 << 0)
/* PCON 0x87 */
-sfr at 0x87 PCON; /* Power Mode Control Register */
+sfr __at 0x87 PCON; /* Power Mode Control Register */
#define PCON_IDLE (1 << 0)
/*
* TCON
*/
-sfr at 0x88 TCON; /* CPU Interrupt Flag 1 */
+sfr __at 0x88 TCON; /* CPU Interrupt Flag 1 */
-sbit at 0x8F URX1IF; /* USART1 RX interrupt flag. Automatically cleared */
-sbit at 0x8F I2SRXIF; /* I2S RX interrupt flag. Automatically cleared */
-sbit at 0x8D ADCIF; /* ADC interrupt flag. Automatically cleared */
-sbit at 0x8B URX0IF; /* USART0 RX interrupt flag. Automatically cleared */
-sbit at 0x89 RFTXRXIF; /* RF TX/RX complete interrupt flag. Automatically cleared */
+sbit __at 0x8F URX1IF; /* USART1 RX interrupt flag. Automatically cleared */
+sbit __at 0x8F I2SRXIF; /* I2S RX interrupt flag. Automatically cleared */
+sbit __at 0x8D ADCIF; /* ADC interrupt flag. Automatically cleared */
+sbit __at 0x8B URX0IF; /* USART0 RX interrupt flag. Automatically cleared */
+sbit __at 0x89 RFTXRXIF; /* RF TX/RX complete interrupt flag. Automatically cleared */
#define TCON_URX1IF (1 << 7)
#define TCON_I2SRXIF (1 << 7)
@@ -150,10 +150,10 @@ sbit at 0x89 RFTXRXIF; /* RF TX/RX complete interrupt flag. Automatically cleare
/*
* S0CON
*/
-sfr at 0x98 S0CON; /* CPU Interrupt Flag 2 */
+sfr __at 0x98 S0CON; /* CPU Interrupt Flag 2 */
-sbit at 0x98 ENCIF_0; /* AES interrupt 0. */
-sbit at 0x99 ENCIF_1; /* AES interrupt 1. */
+sbit __at 0x98 ENCIF_0; /* AES interrupt 0. */
+sbit __at 0x99 ENCIF_1; /* AES interrupt 1. */
#define S0CON_ENCIF_1 (1 << 1)
#define S0CON_ENCIF_0 (1 << 0)
@@ -161,7 +161,7 @@ sbit at 0x99 ENCIF_1; /* AES interrupt 1. */
/*
* S1CON
*/
-sfr at 0x9B S1CON; /* CPU Interrupt Flag 3 */
+sfr __at 0x9B S1CON; /* CPU Interrupt Flag 3 */
#define S1CON_RFIF_1 (1 << 1)
#define S1CON_RFIF_0 (1 << 0)
@@ -169,15 +169,15 @@ sfr at 0x9B S1CON; /* CPU Interrupt Flag 3 */
/*
* IRCON
*/
-sfr at 0xC0 IRCON; /* CPU Interrupt Flag 4 */
+sfr __at 0xC0 IRCON; /* CPU Interrupt Flag 4 */
-sbit at 0xC0 DMAIF; /* DMA complete interrupt flag */
-sbit at 0xC1 T1IF; /* Timer 1 interrupt flag. Automatically cleared */
-sbit at 0xC2 T2IF; /* Timer 2 interrupt flag. Automatically cleared */
-sbit at 0xC3 T3IF; /* Timer 3 interrupt flag. Automatically cleared */
-sbit at 0xC4 T4IF; /* Timer 4 interrupt flag. Automatically cleared */
-sbit at 0xC5 P0IF; /* Port0 interrupt flag */
-sbit at 0xC7 STIF; /* Sleep Timer interrupt flag */
+sbit __at 0xC0 DMAIF; /* DMA complete interrupt flag */
+sbit __at 0xC1 T1IF; /* Timer 1 interrupt flag. Automatically cleared */
+sbit __at 0xC2 T2IF; /* Timer 2 interrupt flag. Automatically cleared */
+sbit __at 0xC3 T3IF; /* Timer 3 interrupt flag. Automatically cleared */
+sbit __at 0xC4 T4IF; /* Timer 4 interrupt flag. Automatically cleared */
+sbit __at 0xC5 P0IF; /* Port0 interrupt flag */
+sbit __at 0xC7 STIF; /* Sleep Timer interrupt flag */
#define IRCON_DMAIF (1 << 0) /* DMA complete interrupt flag */
#define IRCON_T1IF (1 << 1) /* Timer 1 interrupt flag. Automatically cleared */
@@ -190,15 +190,15 @@ sbit at 0xC7 STIF; /* Sleep Timer interrupt flag */
/*
* IRCON2
*/
-sfr at 0xE8 IRCON2; /* CPU Interrupt Flag 5 */
+sfr __at 0xE8 IRCON2; /* CPU Interrupt Flag 5 */
-sbit at 0xE8 USBIF; /* USB interrupt flag (shared with Port2) */
-sbit at 0xE8 P2IF; /* Port2 interrupt flag (shared with USB) */
-sbit at 0xE9 UTX0IF; /* USART0 TX interrupt flag */
-sbit at 0xEA UTX1IF; /* USART1 TX interrupt flag (shared with I2S TX) */
-sbit at 0xEA I2STXIF; /* I2S TX interrupt flag (shared with USART1 TX) */
-sbit at 0xEB P1IF; /* Port1 interrupt flag */
-sbit at 0xEC WDTIF; /* Watchdog timer interrupt flag */
+sbit __at 0xE8 USBIF; /* USB interrupt flag (shared with Port2) */
+sbit __at 0xE8 P2IF; /* Port2 interrupt flag (shared with USB) */
+sbit __at 0xE9 UTX0IF; /* USART0 TX interrupt flag */
+sbit __at 0xEA UTX1IF; /* USART1 TX interrupt flag (shared with I2S TX) */
+sbit __at 0xEA I2STXIF; /* I2S TX interrupt flag (shared with USART1 TX) */
+sbit __at 0xEB P1IF; /* Port1 interrupt flag */
+sbit __at 0xEC WDTIF; /* Watchdog timer interrupt flag */
#define IRCON2_USBIF (1 << 0) /* USB interrupt flag (shared with Port2) */
#define IRCON2_P2IF (1 << 0) /* Port2 interrupt flag (shared with USB) */
@@ -225,8 +225,8 @@ sbit at 0xEC WDTIF; /* Watchdog timer interrupt flag */
* Priority = (IP1 << 1) | IP0. Higher priority interrupts served first
*/
-sfr at 0xB9 IP1; /* Interrupt Priority 1 */
-sfr at 0xA9 IP0; /* Interrupt Priority 0 */
+sfr __at 0xB9 IP1; /* Interrupt Priority 1 */
+sfr __at 0xA9 IP0; /* Interrupt Priority 0 */
#define IP1_IPG5 (1 << 5)
#define IP1_IPG4 (1 << 4)
@@ -286,13 +286,13 @@ sfr at 0xA9 IP0; /* Interrupt Priority 0 */
*/
/* Timer count */
-sfr at 0xCA T3CNT;
-sfr at 0xEA T4CNT;
+sfr __at 0xCA T3CNT;
+sfr __at 0xEA T4CNT;
/* Timer control */
-sfr at 0xCB T3CTL;
-sfr at 0xEB T4CTL;
+sfr __at 0xCB T3CTL;
+sfr __at 0xEB T4CTL;
#define TxCTL_DIV_1 (0 << 5)
#define TxCTL_DIV_2 (1 << 5)
@@ -312,10 +312,10 @@ sfr at 0xEB T4CTL;
/* Timer 4 channel 0 compare control */
-sfr at 0xCC T3CCTL0;
-sfr at 0xCE T3CCTL1;
-sfr at 0xEC T4CCTL0;
-sfr at 0xEE T4CCTL1;
+sfr __at 0xCC T3CCTL0;
+sfr __at 0xCE T3CCTL1;
+sfr __at 0xEC T4CCTL0;
+sfr __at 0xEE T4CCTL1;
#define TxCCTLy_IM (1 << 6)
#define TxCCTLy_CMP_SET (0 << 3)
@@ -328,16 +328,16 @@ sfr at 0xEE T4CCTL1;
#define TxCCTLy_CMP_MODE_ENABLE (1 << 2)
/* Timer compare value */
-sfr at 0xCD T3CC0;
-sfr at 0xCF T3CC1;
-sfr at 0xED T4CC0;
-sfr at 0xEF T4CC1;
+sfr __at 0xCD T3CC0;
+sfr __at 0xCF T3CC1;
+sfr __at 0xED T4CC0;
+sfr __at 0xEF T4CC1;
/*
* Peripheral control
*/
-sfr at 0xf1 PERCFG;
+sfr __at 0xf1 PERCFG;
#define PERCFG_T1CFG_ALT_1 (0 << 6)
#define PERCFG_T1CFG_ALT_2 (1 << 6)
#define PERCFG_T1CFG_ALT_MASK (1 << 6)
diff --git a/src/teledongle-v0.1/.gitignore b/src/teledongle-v0.1/.gitignore
index 96c802bd..9826814b 100644
--- a/src/teledongle-v0.1/.gitignore
+++ b/src/teledongle-v0.1/.gitignore
@@ -1,2 +1,2 @@
-teledongle-v0.1
+teledongle-v0.1*
ao_product.h
diff --git a/src/teledongle-v0.1/Makefile.defs b/src/teledongle-v0.1/Makefile.defs
index be7741d8..ceb80b7a 100644
--- a/src/teledongle-v0.1/Makefile.defs
+++ b/src/teledongle-v0.1/Makefile.defs
@@ -1,4 +1,4 @@
-PROG = teledongle-v0.1.ihx
+PROG = teledongle-v0.1-$(VERSION).ihx
SRC = \
$(TD_SRC) \
diff --git a/src/teledongle-v0.2/.gitignore b/src/teledongle-v0.2/.gitignore
index af79a766..f6ea8c6c 100644
--- a/src/teledongle-v0.2/.gitignore
+++ b/src/teledongle-v0.2/.gitignore
@@ -1,2 +1,2 @@
-teledongle-v0.2
+teledongle-v0.2*
ao_product.h
diff --git a/src/teledongle-v0.2/Makefile.defs b/src/teledongle-v0.2/Makefile.defs
index cbec7805..ea9713b6 100644
--- a/src/teledongle-v0.2/Makefile.defs
+++ b/src/teledongle-v0.2/Makefile.defs
@@ -1,4 +1,4 @@
-PROG = teledongle-v0.2.ihx
+PROG = teledongle-v0.2-$(VERSION).ihx
SRC = \
$(TD_SRC) \
diff --git a/src/telemetrum-v0.1-sirf/.gitignore b/src/telemetrum-v0.1-sirf/.gitignore
index 6d584f36..7698f5aa 100644
--- a/src/telemetrum-v0.1-sirf/.gitignore
+++ b/src/telemetrum-v0.1-sirf/.gitignore
@@ -1,2 +1,2 @@
-telemetrum-v0.1-sirf
+telemetrum-v0.1-sirf*
ao_product.h
diff --git a/src/telemetrum-v0.1-sirf/Makefile.defs b/src/telemetrum-v0.1-sirf/Makefile.defs
index 2ce6e6ed..a7310fbc 100644
--- a/src/telemetrum-v0.1-sirf/Makefile.defs
+++ b/src/telemetrum-v0.1-sirf/Makefile.defs
@@ -1,4 +1,4 @@
-PROG = telemetrum-v0.1-sirf.ihx
+PROG = telemetrum-v0.1-sirf-$(VERSION).ihx
SRC = \
$(TM_BASE_SRC) \
diff --git a/src/telemetrum-v0.1-sky/.gitignore b/src/telemetrum-v0.1-sky/.gitignore
index 5a9fafb5..d25d7ad9 100644
--- a/src/telemetrum-v0.1-sky/.gitignore
+++ b/src/telemetrum-v0.1-sky/.gitignore
@@ -1,2 +1,2 @@
-telemetrum-v0.1-sky
+telemetrum-v0.1-sky*
ao_product.h
diff --git a/src/telemetrum-v0.1-sky/.sdcdbrc b/src/telemetrum-v0.1-sky/.sdcdbrc
new file mode 100644
index 00000000..710b4a2f
--- /dev/null
+++ b/src/telemetrum-v0.1-sky/.sdcdbrc
@@ -0,0 +1 @@
+--directory=..
diff --git a/src/telemetrum-v0.1-sky/Makefile.defs b/src/telemetrum-v0.1-sky/Makefile.defs
index 098ac547..000287ba 100644
--- a/src/telemetrum-v0.1-sky/Makefile.defs
+++ b/src/telemetrum-v0.1-sky/Makefile.defs
@@ -1,4 +1,4 @@
-PROG = telemetrum-v0.1-sky.ihx
+PROG = telemetrum-v0.1-sky-$(VERSION).ihx
SRC = \
$(TM_BASE_SRC) \
diff --git a/src/telemetrum-v1.0/.gitignore b/src/telemetrum-v1.0/.gitignore
index 76228093..c2212151 100644
--- a/src/telemetrum-v1.0/.gitignore
+++ b/src/telemetrum-v1.0/.gitignore
@@ -1,2 +1,2 @@
-telemetrum-v0.2
+telemetrum-*
ao_product.h
diff --git a/src/telemetrum-v1.0/.sdcdbrc b/src/telemetrum-v1.0/.sdcdbrc
new file mode 100644
index 00000000..710b4a2f
--- /dev/null
+++ b/src/telemetrum-v1.0/.sdcdbrc
@@ -0,0 +1 @@
+--directory=..
diff --git a/src/telemetrum-v1.0/Makefile.defs b/src/telemetrum-v1.0/Makefile.defs
index 624ce6e8..010578df 100644
--- a/src/telemetrum-v1.0/Makefile.defs
+++ b/src/telemetrum-v1.0/Makefile.defs
@@ -1,4 +1,4 @@
-PROG = telemetrum-v1.0.ihx
+PROG = telemetrum-v1.0-$(VERSION).ihx
SRC = \
$(TM_BASE_SRC) \
diff --git a/src/tidongle/.gitignore b/src/tidongle/.gitignore
index 3323f640..3888a0f9 100644
--- a/src/tidongle/.gitignore
+++ b/src/tidongle/.gitignore
@@ -1,2 +1,2 @@
-tidongle
+tidongle*
ao_product.h
diff --git a/src/tidongle/Makefile.defs b/src/tidongle/Makefile.defs
index fdd51732..0e13cb20 100644
--- a/src/tidongle/Makefile.defs
+++ b/src/tidongle/Makefile.defs
@@ -1,4 +1,4 @@
-PROG = tidongle.ihx
+PROG = tidongle-$(VERSION).ihx
SRC = \
$(TI_SRC)