More arch-indepdency bits.
GCC stdio is different from SDCC, so create suitable code in
avr/ao_avr_stdio.c
Create macros to initialize the task stack frame and save the task
context.
Add GCC/SDCC type definition compatibility macros
Signed-off-by: Keith Packard <keithp@keithp.com>
--- /dev/null
+#
+# AltOS build
+#
+#
+vpath % ..:../core:../product:../driver
+vpath make-altitude ..
+vpath make-kalman ..
+vpath kalman.5c ../kalman
+vpath kalman_filter.5c ../kalman
+vpath load_csv.5c ../kalman
+vpath matrix.5c ../kalman
+vpath ao-make-product.5c ../util
+
+MCU=atmega32u4
+DUDECPUTYPE=m32u4
+#PROGRAMMER=stk500v2 -P usb
+PROGRAMMER=usbtiny
+LOADCMD=avrdude
+LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w:
+CC=avr-gcc
+OBJCOPY=avr-objcopy
+
+ifndef VERSION
+include ../Version
+endif
+
+INC = \
+ ao.h \
+ ao_pins.h \
+ altitude.h \
+ ao_kalman.h
+
+#
+# Common AltOS sources
+#
+ALTOS_SRC = \
+ ao_cmd.c \
+ ao_mutex.c \
+ ao_panic.c \
+ ao_product.c \
+ ao_serial_avr.c \
+ ao_avr_stdio.c \
+ ao_stdio.c \
+ ao_task.c \
+ ao_timer.c \
+ ao_led.c
+
+PRODUCT=AvrDemo-v0.0
+MCU=atmega32u4
+PRODUCT_DEF=-DAVR_DEMO
+IDPRODUCT=0x000a
+CFLAGS = $(PRODUCT_DEF) -I. -I../avr -I../core -I..
+CFLAGS += -g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues
+
+NICKLE=nickle
+
+PROG=avr-demo
+
+SRC=$(ALTOS_SRC) ao_demo.c ao_debug_avr.c
+OBJ=$(SRC:.c=.o)
+
+V=0
+# The user has explicitly enabled quiet compilation.
+ifeq ($(V),0)
+quiet = @printf " $1 $2 $@\n"; $($1)
+endif
+# Otherwise, print the full command line.
+quiet ?= $($1)
+
+all: $(PROG)
+
+$(PROG): Makefile $(OBJ)
+ $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ)
+
+$(PROG).hex: $(PROG)
+ avr-size $(PROG)
+ $(OBJCOPY) -R .eeprom -O ihex $(PROG) $@
+
+
+load: $(PROG).hex
+ $(LOADCMD) $(LOADARG)$(PROG).hex
+
+../altitude.h: make-altitude
+ nickle $< > $@
+
+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
+ $(call quiet,CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $<
+
+distclean: clean
+
+clean:
+ rm -f $(OBJ)
+ rm -f ao_product.h
+
+install:
+
+uninstall:
+
+$(OBJ): ao.h ao_product.h
\ No newline at end of file
#ifndef _AO_ARCH_H_
#define _AO_ARCH_H_
-#include "avr.h"
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#ifdef AVR_DEMO
+#define TEENSY 1
+#endif
+
+#if TEENSY
+#define F_CPU 16000000UL // 16 MHz
+#else
+#define F_CPU 8000000UL // 8 MHz
+#endif
/*
* AVR definitions and code fragments for AltOS
/* Various definitions to make GCC look more like SDCC */
-#define __naked __attribute__((naked))
+#define ao_arch_naked_declare __attribute__((naked))
+#define ao_arch_naked_define
+#define __pdata
+#define __data
+#define __xdata
+#define __code const
+#define __reentrant
+#define __critical
+#define __interrupt(n)
#define ao_arch_reboot() /* XXX */
+#define ao_arch_nop() asm("nop")
+
+#define ao_arch_interrupt(n) /* nothing */
+
+#undef putchar
+#undef getchar
+#define putchar(c) ao_putchar(c)
+#define getchar ao_getchar
+
+extern void putchar(char c);
+extern char getchar(void);
+
+extern int ao_serial_number;
+
+#define ao_arch_init_stack(task, start) do { \
+ uint8_t *sp = task->stack + AO_STACK_SIZE - 1; \
+ uint16_t a = (uint16_t) start; \
+ int i; \
+ \
+ /* Return address */ \
+ PUSH8(sp, a); \
+ PUSH8(sp, (a >> 8)); \
+ \
+ /* Clear register values */ \
+ i = 32; \
+ while (i--) \
+ PUSH8(sp, 0); \
+ \
+ /* SREG with interrupts enabled */ \
+ PUSH8(sp, 0x80); \
+ task->sp = sp; \
+} while (0);
+
+#define ao_arch_save_context() do { \
+ asm("push r31" "\n\t" "push r30"); \
+ asm("push r29" "\n\t" "push r28" "\n\t" "push r27" "\n\t" "push r26" "\n\t" "push r25"); \
+ asm("push r24" "\n\t" "push r23" "\n\t" "push r22" "\n\t" "push r21" "\n\t" "push r20"); \
+ asm("push r19" "\n\t" "push r18" "\n\t" "push r17" "\n\t" "push r16" "\n\t" "push r15"); \
+ asm("push r14" "\n\t" "push r13" "\n\t" "push r12" "\n\t" "push r11" "\n\t" "push r10"); \
+ asm("push r9" "\n\t" "push r8" "\n\t" "push r7" "\n\t" "push r6" "\n\t" "push r5"); \
+ asm("push r4" "\n\t" "push r3" "\n\t" "push r2" "\n\t" "push r1" "\n\t" "push r0"); \
+ asm("in r0, __SREG__" "\n\t" "push r0"); \
+ sei(); \
+ } while (0)
+
#endif /* _AO_ARCH_H_ */
--- /dev/null
+/*
+ * Copyright © 2011 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"
+
+int
+stdio_put(char c, FILE *stream)
+{
+ if (ao_cur_task && ao_num_stdios)
+ putchar(c);
+ else
+ {
+ if (c == '\n')
+ stdio_put('\r', stream);
+ loop_until_bit_is_set(UCSR1A, UDRE1);
+ UDR1 = c;
+ }
+
+ return 0;
+}
+
+int
+stdio_get(FILE *stream)
+{
+ return (int) getchar() & 0xff;
+}
+
+static FILE mystdout = FDEV_SETUP_STREAM(stdio_put, NULL, _FDEV_SETUP_WRITE);
+
+static FILE mystdin = FDEV_SETUP_STREAM(NULL, stdio_get, _FDEV_SETUP_READ);
+
+void
+ao_stdio_init(void)
+{
+ stdout = &mystdout;
+ stdin = &mystdin;
+ printf("%d stdios registered\n", ao_num_stdios);
+}
--- /dev/null
+/*
+ * Copyright © 2011 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.
+ */
+
+#ifndef _AO_PINS_H_
+#define _AO_PINS_H_
+
+#ifdef AVR_DEMO
+ #define AO_LED_RED (1<<7)
+ #define LEDS_AVAILABLE (AO_LED_RED)
+ #define USE_SERIAL_STDIN 1
+ #define HAS_USB 0
+ #define PACKET_HAS_SLAVE 0
+ #define HAS_SERIAL_1 1
+ #define HAS_BEEP 0
+#endif
+
+#endif /* _AO_PINS_H_ */
#include "cc1111.h"
+/* Convert a __data pointer into an __xdata pointer */
+#define DATA_TO_XDATA(a) ((void __xdata *) ((uint8_t) (a) | 0xff00))
+
+/* Stack runs from above the allocated __data space to 0xfe, which avoids
+ * writing to 0xff as that triggers the stack overflow indicator
+ */
+#define AO_STACK_START 0x90
+#define AO_STACK_END 0xfe
+#define AO_STACK_SIZE (AO_STACK_END - AO_STACK_START + 1)
+
#define ao_arch_reboot() do { \
WDCTL = WDCTL_EN | WDCTL_MODE_WATCHDOG | WDCTL_INT_64; \
ao_delay(AO_SEC_TO_TICKS(2)); \
} while (0)
+#define ao_arch_nop() _asm nop _endasm
+#define ao_arch_interrupt(n) __interrupt n
+
+#define ao_arch_naked_declare __naked
+#define ao_arch_naked_define __naked
+
+/* CC1111-specific drivers */
+
+/*
+ * 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;
+
+#ifndef HAS_USB
+#error Please define HAS_USB
+#endif
+
+#if HAS_USB
+extern __code __at (0x00aa) uint8_t ao_usb_descriptors [];
+#endif
+
+/* Initialize stack */
+#define ao_arch_init_stack(task, start) { \
+ uint8_t __xdata *stack = task->stack; \
+ uint8_t t; \
+ *stack++ = ((uint16_t) start); /* 0 */ \
+ *stack++ = ((uint16_t) start) >> 8; /* 1 */ \
+ \
+ /* and the stuff saved by ao_switch */ \
+ *stack++ = 0; /* 2 acc */ \
+ *stack++ = 0x80; /* 3 IE */ \
+ \
+ /* 4 DPL \
+ * 5 DPH \
+ * 6 B \
+ * 7 R2 \
+ * 8 R3 \
+ * 9 R4 \
+ * 10 R5 \
+ * 11 R6 \
+ * 12 R7 \
+ * 13 R0 \
+ * 14 R1 \
+ * 15 PSW \
+ * 16 BP \
+ */ \
+ for (t = 0; t < 13; t++) \
+ *stack++ = 0; \
+ task->stack_count = 17; \
+ }
+
+
+
+/* Save current context */
+
+#define ao_arch_save_context() \
+ _asm \
+ /* Push ACC first, as when restoring the context it must be restored \
+ * last (it is used to set the IE register). */ \
+ push ACC \
+ /* Store the IE register then enable interrupts. */ \
+ push _IEN0 \
+ setb _EA \
+ push DPL \
+ push DPH \
+ push b \
+ push ar2 \
+ push ar3 \
+ push ar4 \
+ push ar5 \
+ push ar6 \
+ push ar7 \
+ push ar0 \
+ push ar1 \
+ push PSW \
+ _endasm; \
+ PSW = 0; \
+ _asm \
+ push _bp \
+ _endasm
+
+
+
#endif /* _AO_ARCH_H_ */
--- /dev/null
+/*
+ * 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.
+ */
+
+#ifndef _AO_PINS_H_
+#define _AO_PINS_H_
+
+#if defined(TELEMETRUM_V_1_0)
+ #define HAS_FLIGHT 1
+ #define HAS_USB 1
+ #define HAS_BEEP 1
+ #define HAS_GPS 1
+ #define HAS_SERIAL_1 1
+ #define HAS_ADC 1
+ #define USE_SERIAL_STDIN 0
+ #define HAS_EEPROM 1
+ #define USE_INTERNAL_FLASH 0
+ #define HAS_DBG 1
+ #define DBG_ON_P1 1
+ #define DBG_ON_P0 0
+ #define IGNITE_ON_P2 1
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 0
+ #define PACKET_HAS_SLAVE 1
+
+ #define HAS_COMPANION 1
+ #define COMPANION_CS_ON_P1 1
+ #define COMPANION_CS_MASK 0x4 /* CS1 is P1_2 */
+ #define COMPANION_CS P1_2
+
+ #define AO_LED_RED 1
+ #define LEDS_AVAILABLE (AO_LED_RED)
+ #define HAS_EXTERNAL_TEMP 0
+ #define HAS_ACCEL_REF 0
+ #define HAS_ACCEL 1
+ #define HAS_IGNITE 1
+ #define HAS_MONITOR 0
+#endif
+
+#if defined(TELEMETRUM_V_1_1)
+ #define HAS_FLIGHT 1
+ #define HAS_USB 1
+ #define HAS_BEEP 1
+ #define HAS_GPS 1
+ #define HAS_SERIAL_1 1
+ #define USE_SERIAL_STDIN 0
+ #define HAS_ADC 1
+ #define HAS_EEPROM 1
+ #define USE_INTERNAL_FLASH 0
+ #define HAS_DBG 1
+ #define DBG_ON_P1 1
+ #define DBG_ON_P0 0
+ #define IGNITE_ON_P2 1
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 0
+ #define PACKET_HAS_SLAVE 1
+
+ #define HAS_COMPANION 1
+ #define COMPANION_CS_ON_P1 1
+ #define COMPANION_CS_MASK 0x4 /* CS1 is P1_2 */
+ #define COMPANION_CS P1_2
+
+ #define AO_LED_RED 1
+ #define LEDS_AVAILABLE (AO_LED_RED)
+ #define HAS_EXTERNAL_TEMP 0
+ #define HAS_ACCEL_REF 1
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
+ #define M25_CS_MASK 0x02 /* CS0 is P1_1 */
+ #define M25_MAX_CHIPS 1
+ #define HAS_ACCEL 1
+ #define HAS_IGNITE 1
+ #define HAS_MONITOR 0
+#endif
+
+#if defined(TELEDONGLE_V_0_2)
+ #define HAS_FLIGHT 0
+ #define HAS_USB 1
+ #define HAS_BEEP 0
+ #define HAS_SERIAL_1 0
+ #define USE_SERIAL_STDIN 0
+ #define HAS_ADC 0
+ #define HAS_DBG 1
+ #define HAS_EEPROM 0
+ #define DBG_ON_P1 1
+ #define DBG_ON_P0 0
+ #define IGNITE_ON_P2 0
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 1
+ #define PACKET_HAS_SLAVE 0
+ #define AO_LED_RED 1
+ #define AO_LED_GREEN 2
+ #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
+ #define HAS_IGNITE 0
+ #define HAS_MONITOR 1
+#endif
+
+#if defined(TELEMINI_V_1_0)
+ #define HAS_FLIGHT 1
+ #define HAS_USB 0
+ #define HAS_BEEP 0
+ #define HAS_GPS 0
+ #define HAS_SERIAL_1 0
+ #define USE_SERIAL_STDIN 0
+ #define HAS_ADC 1
+ #define HAS_EEPROM 1
+ #define USE_INTERNAL_FLASH 1
+ #define HAS_DBG 0
+ #define IGNITE_ON_P2 0
+ #define IGNITE_ON_P0 1
+ #define PACKET_HAS_MASTER 0
+ #define PACKET_HAS_SLAVE 1
+ #define USE_FAST_ASCENT_LOG 1
+
+ #define AO_LED_GREEN 1
+ #define AO_LED_RED 2
+ #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define HAS_EXTERNAL_TEMP 0
+ #define HAS_ACCEL 0
+ #define HAS_IGNITE 1
+ #define HAS_MONITOR 0
+#endif
+
+#if defined(TELENANO_V_0_1)
+ #define HAS_FLIGHT 1
+ #define HAS_USB 0
+ #define HAS_BEEP 0
+ #define HAS_GPS 0
+ #define HAS_SERIAL_1 0
+ #define USE_SERIAL_STDIN 0
+ #define HAS_ADC 1
+ #define HAS_EEPROM 1
+ #define USE_INTERNAL_FLASH 1
+ #define HAS_DBG 0
+ #define IGNITE_ON_P2 0
+ #define IGNITE_ON_P0 1
+ #define PACKET_HAS_MASTER 0
+ #define PACKET_HAS_SLAVE 1
+
+ #define AO_LED_GREEN 1
+ #define AO_LED_RED 2
+ #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define HAS_EXTERNAL_TEMP 0
+ #define HAS_ACCEL 0
+ #define HAS_IGNITE 0
+ #define HAS_MONITOR 0
+#endif
+
+#if defined(TELEMETRUM_V_0_1)
+ #define HAS_FLIGHT 1
+ #define HAS_USB 1
+ #define HAS_BEEP 1
+ #define HAS_GPS 1
+ #define HAS_SERIAL_1 1
+ #define USE_SERIAL_STDIN 0
+ #define HAS_ADC 1
+ #define HAS_DBG 0
+ #define HAS_EEPROM 1
+ #define USE_INTERNAL_FLASH 0
+ #define DBG_ON_P1 0
+ #define DBG_ON_P0 1
+ #define IGNITE_ON_P2 1
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 0
+ #define PACKET_HAS_SLAVE 1
+ #define AO_LED_RED 2
+ #define AO_LED_GREEN 1
+ #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define HAS_EXTERNAL_TEMP 1
+ #define HAS_ACCEL_REF 0
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
+ #define HAS_ACCEL 1
+ #define HAS_IGNITE 1
+ #define HAS_MONITOR 0
+#endif
+
+#if defined(TELEDONGLE_V_0_1)
+ #define HAS_FLIGHT 0
+ #define HAS_USB 1
+ #define HAS_BEEP 0
+ #define HAS_SERIAL_1 0
+ #define USE_SERIAL_STDIN 0
+ #define HAS_ADC 0
+ #define HAS_DBG 0
+ #define HAS_EEPROM 0
+ #define DBG_ON_P1 0
+ #define DBG_ON_P0 1
+ #define IGNITE_ON_P2 0
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 1
+ #define PACKET_HAS_SLAVE 0
+ #define AO_LED_RED 2
+ #define AO_LED_GREEN 1
+ #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define SPI_CS_ON_P1 0
+ #define SPI_CS_ON_P0 1
+ #define HAS_IGNITE 0
+ #define HAS_MONITOR 1
+#endif
+
+#if defined(TIDONGLE)
+ #define HAS_FLIGHT 0
+ #define HAS_USB 1
+ #define HAS_BEEP 0
+ #define HAS_SERIAL_1 0
+ #define USE_SERIAL_STDIN 0
+ #define HAS_ADC 0
+ #define HAS_DBG 1
+ #define HAS_EEPROM 0
+ #define DBG_ON_P1 0
+ #define DBG_ON_P0 1
+ #define IGNITE_ON_P2 0
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 1
+ #define PACKET_HAS_SLAVE 0
+ #define AO_LED_RED 2
+ #define LEDS_AVAILABLE (AO_LED_RED)
+ #define SPI_CS_ON_P1 0
+ #define SPI_CS_ON_P0 1
+ #define HAS_IGNITE 0
+ #define HAS_MONITOR 1
+#endif
+
+#if defined(TELEBT_V_0_0)
+ #define HAS_FLIGHT 0
+ #define HAS_USB 1
+ #define HAS_BEEP 0
+ #define HAS_SERIAL_1 1
+ #define USE_SERIAL_STDIN 1
+ #define HAS_ADC 0
+ #define HAS_DBG 1
+ #define HAS_EEPROM 0
+ #define HAS_BTM 1
+ #define DBG_ON_P1 0
+ #define DBG_ON_P0 1
+ #define IGNITE_ON_P2 0
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 1
+ #define PACKET_HAS_SLAVE 0
+ #define AO_LED_RED 2
+ #define AO_LED_GREEN 1
+ #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
+ #define HAS_IGNITE 0
+ #define BT_LINK_ON_P2 1
+ #define BT_LINK_ON_P1 0
+ #define BT_LINK_PIN_INDEX 7
+ #define BT_LINK_PIN P2_1
+ #define HAS_MONITOR 1
+#endif
+
+#if defined(TELEBT_V_0_1)
+ #define HAS_FLIGHT 0
+ #define HAS_USB 1
+ #define HAS_BEEP 1
+ #define HAS_SERIAL_1 1
+ #define HAS_SERIAL_1_ALT_1 1
+ #define HAS_SERIAL_1_ALT_2 0
+ #define HAS_SERIAL_1_HW_FLOW 1
+ #define USE_SERIAL_STDIN 1
+ #define HAS_ADC 0
+ #define HAS_DBG 1
+ #define HAS_EEPROM 1
+ #define USE_INTERNAL_FLASH 0
+ #define HAS_BTM 1
+ #define DBG_ON_P1 1
+ #define DBG_ON_P0 0
+ #define IGNITE_ON_P2 0
+ #define IGNITE_ON_P0 0
+ #define PACKET_HAS_MASTER 1
+ #define PACKET_HAS_SLAVE 0
+ #define AO_LED_RED 1
+ #define AO_LED_GREEN 2
+ #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
+ #define M25_CS_MASK 0x04 /* CS0 is P1_2 */
+ #define M25_MAX_CHIPS 1
+ #define HAS_ACCEL 0
+ #define HAS_IGNITE 0
+ #define BT_LINK_ON_P2 0
+ #define BT_LINK_ON_P1 1
+ #define BT_LINK_PIN_INDEX 7
+ #define BT_LINK_PIN P1_7
+ #define HAS_MONITOR 1
+#endif
+
+#if DBG_ON_P1
+
+ #define DBG_CLOCK (1 << 4) /* mi0 */
+ #define DBG_DATA (1 << 5) /* mo0 */
+ #define DBG_RESET_N (1 << 3) /* c0 */
+
+ #define DBG_CLOCK_PIN (P1_4)
+ #define DBG_DATA_PIN (P1_5)
+ #define DBG_RESET_N_PIN (P1_3)
+
+ #define DBG_PORT_NUM 1
+ #define DBG_PORT P1
+ #define DBG_PORT_SEL P1SEL
+ #define DBG_PORT_INP P1INP
+ #define DBG_PORT_DIR P1DIR
+
+#endif /* DBG_ON_P1 */
+
+#if DBG_ON_P0
+
+ #define DBG_CLOCK (1 << 3)
+ #define DBG_DATA (1 << 4)
+ #define DBG_RESET_N (1 << 5)
+
+ #define DBG_CLOCK_PIN (P0_3)
+ #define DBG_DATA_PIN (P0_4)
+ #define DBG_RESET_N_PIN (P0_5)
+
+ #define DBG_PORT_NUM 0
+ #define DBG_PORT P0
+ #define DBG_PORT_SEL P0SEL
+ #define DBG_PORT_INP P0INP
+ #define DBG_PORT_DIR P0DIR
+
+#endif /* DBG_ON_P0 */
+
+#if COMPANION_CS_ON_P1
+ #define COMPANION_CS_PORT P1
+ #define COMPANION_CS_SEL P1SEL
+ #define COMPANION_CS_DIR P1DIR
+#endif
+
+#if SPI_CS_ON_P1
+ #define SPI_CS_PORT P1
+ #define SPI_CS_SEL P1SEL
+ #define SPI_CS_DIR P1DIR
+#endif
+
+#if SPI_CS_ON_P0
+ #define SPI_CS_PORT P0
+ #define SPI_CS_SEL P0SEL
+ #define SPI_CS_DIR P0DIR
+#endif
+
+#ifndef IGNITE_ON_P2
+#error Please define IGNITE_ON_P2
+#endif
+
+#ifndef IGNITE_ON_P0
+#error Please define IGNITE_ON_P0
+#endif
+
+#ifndef HAS_SERIAL_1
+#error Please define HAS_SERIAL_1
+#endif
+
+#ifndef USE_SERIAL_STDIN
+#error Please define USE_SERIAL_STDIN
+#endif
+
+#ifndef HAS_ADC
+#error Please define HAS_ADC
+#endif
+
+#ifndef HAS_EEPROM
+#error Please define HAS_EEPROM
+#endif
+
+#if HAS_EEPROM
+#ifndef USE_INTERNAL_FLASH
+#error Please define USE_INTERNAL_FLASH
+#endif
+#endif
+
+#ifndef HAS_DBG
+#error Please define HAS_DBG
+#endif
+
+#ifndef HAS_IGNITE
+#error Please define HAS_IGNITE
+#endif
+
+#ifndef PACKET_HAS_MASTER
+#error Please define PACKET_HAS_MASTER
+#endif
+
+#ifndef PACKET_HAS_SLAVE
+#error Please define PACKET_HAS_SLAVE
+#endif
+
+#ifndef HAS_MONITOR
+#error Please define HAS_MONITOR
+#endif
+
+#ifndef HAS_ADC
+#error Please define HAS_ADC
+#endif
+
+#if HAS_ADC
+
+#if HAS_ACCEL
+#ifndef HAS_ACCEL_REF
+#error Please define HAS_ACCEL_REF
+#endif
+#else
+#define HAS_ACCEL_REF 0
+#endif
+
+#endif /* HAS_ADC */
+
+#endif /* _AO_PINS_H_ */
#include <stdio.h>
#include <string.h>
#include <stddef.h>
-#include <ao_arch.h>
#include "ao_pins.h"
+#include <ao_arch.h>
#define TRUE 1
#define FALSE 0
/* Convert a __data pointer into an __xdata pointer */
-#define DATA_TO_XDATA(a) ((void __xdata *) ((uint8_t) (a) | 0xff00))
-
-/* Stack runs from above the allocated __data space to 0xfe, which avoids
- * writing to 0xff as that triggers the stack overflow indicator
- */
-#define AO_STACK_START 0x90
-#define AO_STACK_END 0xfe
-#define AO_STACK_SIZE (AO_STACK_END - AO_STACK_START + 1)
+#ifndef DATA_TO_XDATA
+#define DATA_TO_XDATA(a) (a)
+#endif
/* An AltOS task */
struct ao_task {
/* Yield the processor to another task */
void
-ao_yield(void) __naked;
+ao_yield(void) ao_arch_naked_declare;
/* Add a task to the run queue */
void
/* Timer interrupt */
void
-ao_timer_isr(void) __interrupt 9;
+ao_timer_isr(void) ao_arch_interrupt(9);
/* Initialize the timer */
void
int16_t sense_m; /* main continuity sense */
};
-#ifndef HAS_ADC
-#error Please define HAS_ADC
-#endif
-
#if HAS_ADC
-#if HAS_ACCEL
-#ifndef HAS_ACCEL_REF
-#error Please define HAS_ACCEL_REF
-#endif
-#else
-#define HAS_ACCEL_REF 0
-#endif
-
/*
* ao_adc.c
*/
/* The A/D interrupt handler */
void
-ao_adc_isr(void) __interrupt 1;
+ao_adc_isr(void) ao_arch_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;
-
-#ifndef HAS_USB
-#error Please define HAS_USB
-#endif
-
-#if HAS_USB
-extern __code __at (0x00aa) uint8_t ao_usb_descriptors [];
-#endif
-
/*
* ao_usb.c
*/
#if HAS_USB
/* USB interrupt handler */
void
-ao_usb_isr(void) __interrupt 6;
+ao_usb_isr(void) ao_arch_interrupt(6);
#endif
/* Enable the USB controller */
/* DMA interrupt routine */
void
-ao_dma_isr(void) __interrupt 8;
+ao_dma_isr(void) ao_arch_interrupt(8);
/*
* ao_mutex.c
#endif
void
-ao_serial_rx1_isr(void) __interrupt 3;
+ao_serial_rx1_isr(void) ao_arch_interrupt(3);
void
-ao_serial_tx1_isr(void) __interrupt 14;
+ao_serial_tx1_isr(void) ao_arch_interrupt(14);
char
ao_serial_getchar(void) __critical;
char callsign[AO_MAX_CALLSIGN];
};
-/*
- * ao_radio_recv tacks on rssi and status bytes
- */
-
-struct ao_telemetry_raw_recv {
- uint8_t packet[AO_MAX_TELEMETRY + 2];
-};
-
struct ao_telemetry_orig_recv {
struct ao_telemetry_orig telemetry_orig;
int8_t rssi;
uint8_t status;
};
+/*
+ * ao_radio_recv tacks on rssi and status bytes
+ */
+
+struct ao_telemetry_raw_recv {
+ uint8_t packet[AO_MAX_TELEMETRY + 2];
+};
+
/* Set delay between telemetry reports (0 to disable) */
#define AO_TELEMETRY_INTERVAL_PAD AO_MS_TO_TICKS(1000)
extern __xdata uint8_t ao_radio_mutex;
void
-ao_radio_general_isr(void) __interrupt 16;
+ao_radio_general_isr(void) ao_arch_interrupt(16);
void
ao_radio_get(uint8_t len);
while (n--)
while (--j)
while (--i)
- _asm nop _endasm;
+ ao_arch_nop();
}
void
+++ /dev/null
-/*
- * 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.
- */
-
-#ifndef _AO_PINS_H_
-#define _AO_PINS_H_
-
-#if defined(TELEMETRUM_V_1_0)
- #define HAS_FLIGHT 1
- #define HAS_USB 1
- #define HAS_BEEP 1
- #define HAS_GPS 1
- #define HAS_SERIAL_1 1
- #define HAS_ADC 1
- #define USE_SERIAL_STDIN 0
- #define HAS_EEPROM 1
- #define USE_INTERNAL_FLASH 0
- #define HAS_DBG 1
- #define DBG_ON_P1 1
- #define DBG_ON_P0 0
- #define IGNITE_ON_P2 1
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 0
- #define PACKET_HAS_SLAVE 1
-
- #define HAS_COMPANION 1
- #define COMPANION_CS_ON_P1 1
- #define COMPANION_CS_MASK 0x4 /* CS1 is P1_2 */
- #define COMPANION_CS P1_2
-
- #define AO_LED_RED 1
- #define LEDS_AVAILABLE (AO_LED_RED)
- #define HAS_EXTERNAL_TEMP 0
- #define HAS_ACCEL_REF 0
- #define HAS_ACCEL 1
- #define HAS_IGNITE 1
- #define HAS_MONITOR 0
-#endif
-
-#if defined(TELEMETRUM_V_1_1)
- #define HAS_FLIGHT 1
- #define HAS_USB 1
- #define HAS_BEEP 1
- #define HAS_GPS 1
- #define HAS_SERIAL_1 1
- #define USE_SERIAL_STDIN 0
- #define HAS_ADC 1
- #define HAS_EEPROM 1
- #define USE_INTERNAL_FLASH 0
- #define HAS_DBG 1
- #define DBG_ON_P1 1
- #define DBG_ON_P0 0
- #define IGNITE_ON_P2 1
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 0
- #define PACKET_HAS_SLAVE 1
-
- #define HAS_COMPANION 1
- #define COMPANION_CS_ON_P1 1
- #define COMPANION_CS_MASK 0x4 /* CS1 is P1_2 */
- #define COMPANION_CS P1_2
-
- #define AO_LED_RED 1
- #define LEDS_AVAILABLE (AO_LED_RED)
- #define HAS_EXTERNAL_TEMP 0
- #define HAS_ACCEL_REF 1
- #define SPI_CS_ON_P1 1
- #define SPI_CS_ON_P0 0
- #define M25_CS_MASK 0x02 /* CS0 is P1_1 */
- #define M25_MAX_CHIPS 1
- #define HAS_ACCEL 1
- #define HAS_IGNITE 1
- #define HAS_MONITOR 0
-#endif
-
-#if defined(TELEDONGLE_V_0_2)
- #define HAS_FLIGHT 0
- #define HAS_USB 1
- #define HAS_BEEP 0
- #define HAS_SERIAL_1 0
- #define USE_SERIAL_STDIN 0
- #define HAS_ADC 0
- #define HAS_DBG 1
- #define HAS_EEPROM 0
- #define DBG_ON_P1 1
- #define DBG_ON_P0 0
- #define IGNITE_ON_P2 0
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 1
- #define PACKET_HAS_SLAVE 0
- #define AO_LED_RED 1
- #define AO_LED_GREEN 2
- #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
- #define SPI_CS_ON_P1 1
- #define SPI_CS_ON_P0 0
- #define HAS_IGNITE 0
- #define HAS_MONITOR 1
-#endif
-
-#if defined(TELEMINI_V_1_0)
- #define HAS_FLIGHT 1
- #define HAS_USB 0
- #define HAS_BEEP 0
- #define HAS_GPS 0
- #define HAS_SERIAL_1 0
- #define USE_SERIAL_STDIN 0
- #define HAS_ADC 1
- #define HAS_EEPROM 1
- #define USE_INTERNAL_FLASH 1
- #define HAS_DBG 0
- #define IGNITE_ON_P2 0
- #define IGNITE_ON_P0 1
- #define PACKET_HAS_MASTER 0
- #define PACKET_HAS_SLAVE 1
- #define USE_FAST_ASCENT_LOG 1
-
- #define AO_LED_GREEN 1
- #define AO_LED_RED 2
- #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
- #define HAS_EXTERNAL_TEMP 0
- #define HAS_ACCEL 0
- #define HAS_IGNITE 1
- #define HAS_MONITOR 0
-#endif
-
-#if defined(TELENANO_V_0_1)
- #define HAS_FLIGHT 1
- #define HAS_USB 0
- #define HAS_BEEP 0
- #define HAS_GPS 0
- #define HAS_SERIAL_1 0
- #define USE_SERIAL_STDIN 0
- #define HAS_ADC 1
- #define HAS_EEPROM 1
- #define USE_INTERNAL_FLASH 1
- #define HAS_DBG 0
- #define IGNITE_ON_P2 0
- #define IGNITE_ON_P0 1
- #define PACKET_HAS_MASTER 0
- #define PACKET_HAS_SLAVE 1
-
- #define AO_LED_GREEN 1
- #define AO_LED_RED 2
- #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
- #define HAS_EXTERNAL_TEMP 0
- #define HAS_ACCEL 0
- #define HAS_IGNITE 0
- #define HAS_MONITOR 0
-#endif
-
-#if defined(TELEMETRUM_V_0_1)
- #define HAS_FLIGHT 1
- #define HAS_USB 1
- #define HAS_BEEP 1
- #define HAS_GPS 1
- #define HAS_SERIAL_1 1
- #define USE_SERIAL_STDIN 0
- #define HAS_ADC 1
- #define HAS_DBG 0
- #define HAS_EEPROM 1
- #define USE_INTERNAL_FLASH 0
- #define DBG_ON_P1 0
- #define DBG_ON_P0 1
- #define IGNITE_ON_P2 1
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 0
- #define PACKET_HAS_SLAVE 1
- #define AO_LED_RED 2
- #define AO_LED_GREEN 1
- #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
- #define HAS_EXTERNAL_TEMP 1
- #define HAS_ACCEL_REF 0
- #define SPI_CS_ON_P1 1
- #define SPI_CS_ON_P0 0
- #define HAS_ACCEL 1
- #define HAS_IGNITE 1
- #define HAS_MONITOR 0
-#endif
-
-#if defined(TELEDONGLE_V_0_1)
- #define HAS_FLIGHT 0
- #define HAS_USB 1
- #define HAS_BEEP 0
- #define HAS_SERIAL_1 0
- #define USE_SERIAL_STDIN 0
- #define HAS_ADC 0
- #define HAS_DBG 0
- #define HAS_EEPROM 0
- #define DBG_ON_P1 0
- #define DBG_ON_P0 1
- #define IGNITE_ON_P2 0
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 1
- #define PACKET_HAS_SLAVE 0
- #define AO_LED_RED 2
- #define AO_LED_GREEN 1
- #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
- #define SPI_CS_ON_P1 0
- #define SPI_CS_ON_P0 1
- #define HAS_IGNITE 0
- #define HAS_MONITOR 1
-#endif
-
-#if defined(TIDONGLE)
- #define HAS_FLIGHT 0
- #define HAS_USB 1
- #define HAS_BEEP 0
- #define HAS_SERIAL_1 0
- #define USE_SERIAL_STDIN 0
- #define HAS_ADC 0
- #define HAS_DBG 1
- #define HAS_EEPROM 0
- #define DBG_ON_P1 0
- #define DBG_ON_P0 1
- #define IGNITE_ON_P2 0
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 1
- #define PACKET_HAS_SLAVE 0
- #define AO_LED_RED 2
- #define LEDS_AVAILABLE (AO_LED_RED)
- #define SPI_CS_ON_P1 0
- #define SPI_CS_ON_P0 1
- #define HAS_IGNITE 0
- #define HAS_MONITOR 1
-#endif
-
-#if defined(TELEBT_V_0_0)
- #define HAS_FLIGHT 0
- #define HAS_USB 1
- #define HAS_BEEP 0
- #define HAS_SERIAL_1 1
- #define USE_SERIAL_STDIN 1
- #define HAS_ADC 0
- #define HAS_DBG 1
- #define HAS_EEPROM 0
- #define HAS_BTM 1
- #define DBG_ON_P1 0
- #define DBG_ON_P0 1
- #define IGNITE_ON_P2 0
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 1
- #define PACKET_HAS_SLAVE 0
- #define AO_LED_RED 2
- #define AO_LED_GREEN 1
- #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
- #define SPI_CS_ON_P1 1
- #define SPI_CS_ON_P0 0
- #define HAS_IGNITE 0
- #define BT_LINK_ON_P2 1
- #define BT_LINK_ON_P1 0
- #define BT_LINK_PIN_INDEX 7
- #define BT_LINK_PIN P2_1
- #define HAS_MONITOR 1
-#endif
-
-#if defined(TELEBT_V_0_1)
- #define HAS_FLIGHT 0
- #define HAS_USB 1
- #define HAS_BEEP 1
- #define HAS_SERIAL_1 1
- #define HAS_SERIAL_1_ALT_1 1
- #define HAS_SERIAL_1_ALT_2 0
- #define HAS_SERIAL_1_HW_FLOW 1
- #define USE_SERIAL_STDIN 1
- #define HAS_ADC 0
- #define HAS_DBG 1
- #define HAS_EEPROM 1
- #define USE_INTERNAL_FLASH 0
- #define HAS_BTM 1
- #define DBG_ON_P1 1
- #define DBG_ON_P0 0
- #define IGNITE_ON_P2 0
- #define IGNITE_ON_P0 0
- #define PACKET_HAS_MASTER 1
- #define PACKET_HAS_SLAVE 0
- #define AO_LED_RED 1
- #define AO_LED_GREEN 2
- #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
- #define SPI_CS_ON_P1 1
- #define SPI_CS_ON_P0 0
- #define M25_CS_MASK 0x04 /* CS0 is P1_2 */
- #define M25_MAX_CHIPS 1
- #define HAS_ACCEL 0
- #define HAS_IGNITE 0
- #define BT_LINK_ON_P2 0
- #define BT_LINK_ON_P1 1
- #define BT_LINK_PIN_INDEX 7
- #define BT_LINK_PIN P1_7
- #define HAS_MONITOR 1
-#endif
-
-#if DBG_ON_P1
-
- #define DBG_CLOCK (1 << 4) /* mi0 */
- #define DBG_DATA (1 << 5) /* mo0 */
- #define DBG_RESET_N (1 << 3) /* c0 */
-
- #define DBG_CLOCK_PIN (P1_4)
- #define DBG_DATA_PIN (P1_5)
- #define DBG_RESET_N_PIN (P1_3)
-
- #define DBG_PORT_NUM 1
- #define DBG_PORT P1
- #define DBG_PORT_SEL P1SEL
- #define DBG_PORT_INP P1INP
- #define DBG_PORT_DIR P1DIR
-
-#endif /* DBG_ON_P1 */
-
-#if DBG_ON_P0
-
- #define DBG_CLOCK (1 << 3)
- #define DBG_DATA (1 << 4)
- #define DBG_RESET_N (1 << 5)
-
- #define DBG_CLOCK_PIN (P0_3)
- #define DBG_DATA_PIN (P0_4)
- #define DBG_RESET_N_PIN (P0_5)
-
- #define DBG_PORT_NUM 0
- #define DBG_PORT P0
- #define DBG_PORT_SEL P0SEL
- #define DBG_PORT_INP P0INP
- #define DBG_PORT_DIR P0DIR
-
-#endif /* DBG_ON_P0 */
-
-#if COMPANION_CS_ON_P1
- #define COMPANION_CS_PORT P1
- #define COMPANION_CS_SEL P1SEL
- #define COMPANION_CS_DIR P1DIR
-#endif
-
-#if SPI_CS_ON_P1
- #define SPI_CS_PORT P1
- #define SPI_CS_SEL P1SEL
- #define SPI_CS_DIR P1DIR
-#endif
-
-#if SPI_CS_ON_P0
- #define SPI_CS_PORT P0
- #define SPI_CS_SEL P0SEL
- #define SPI_CS_DIR P0DIR
-#endif
-
-#ifndef IGNITE_ON_P2
-#error Please define IGNITE_ON_P2
-#endif
-
-#ifndef IGNITE_ON_P0
-#error Please define IGNITE_ON_P0
-#endif
-
-#ifndef HAS_SERIAL_1
-#error Please define HAS_SERIAL_1
-#endif
-
-#ifndef USE_SERIAL_STDIN
-#error Please define USE_SERIAL_STDIN
-#endif
-
-#ifndef HAS_ADC
-#error Please define HAS_ADC
-#endif
-
-#ifndef HAS_EEPROM
-#error Please define HAS_EEPROM
-#endif
-
-#if HAS_EEPROM
-#ifndef USE_INTERNAL_FLASH
-#error Please define USE_INTERNAL_FLASH
-#endif
-#endif
-
-#ifndef HAS_DBG
-#error Please define HAS_DBG
-#endif
-
-#ifndef HAS_IGNITE
-#error Please define HAS_IGNITE
-#endif
-
-#ifndef PACKET_HAS_MASTER
-#error Please define PACKET_HAS_MASTER
-#endif
-
-#ifndef PACKET_HAS_SLAVE
-#error Please define PACKET_HAS_SLAVE
-#endif
-
-#ifndef HAS_MONITOR
-#error Please define HAS_MONITOR
-#endif
-#endif /* _AO_PINS_H_ */
void
ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name) __reentrant
{
- uint8_t __xdata *stack;
uint8_t task_id;
uint8_t t;
if (ao_num_tasks == AO_NUM_TASKS)
ao_tasks[ao_num_tasks++] = task;
task->task_id = task_id;
task->name = name;
+ task->wchan = NULL;
/*
* Construct a stack frame so that it will 'return'
* to the start of the task
*/
- stack = task->stack;
-
- *stack++ = ((uint16_t) start); /* 0 */
- *stack++ = ((uint16_t) start) >> 8; /* 1 */
-
- /* and the stuff saved by ao_switch */
- *stack++ = 0; /* 2 acc */
- *stack++ = 0x80; /* 3 IE */
-
- /* 4 DPL
- * 5 DPH
- * 6 B
- * 7 R2
- * 8 R3
- * 9 R4
- * 10 R5
- * 11 R6
- * 12 R7
- * 13 R0
- * 14 R1
- * 15 PSW
- * 16 BP
- */
- for (t = 0; t < 13; t++)
- *stack++ = 0;
-
- task->stack_count = 17;
- task->wchan = NULL;
+ ao_arch_init_stack(task, start);
}
/* Task switching function. This must not use any stack variables */
void
-ao_yield(void) __naked
+ao_yield(void) ao_arch_naked_define
{
-
- /* Save current context */
- _asm
- /* Push ACC first, as when restoring the context it must be restored
- * last (it is used to set the IE register). */
- push ACC
- /* Store the IE register then enable interrupts. */
- push _IEN0
- setb _EA
- push DPL
- push DPH
- push b
- push ar2
- push ar3
- push ar4
- push ar5
- push ar6
- push ar7
- push ar0
- push ar1
- push PSW
- _endasm;
- PSW = 0;
- _asm
- push _bp
- _endasm;
+ ao_arch_save_context();
if (ao_cur_task_index == AO_NO_TASK_INDEX)
ao_cur_task_index = ao_num_tasks-1;
../$(PROG): $(REL) Makefile
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
- $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
+ $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
ao_product.h: ao-make-product.5c ../Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
../$(PROG): $(REL) Makefile
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
- $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
+ $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
ao_product.h: ao-make-product.5c ../Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
../$(PROG): $(REL) Makefile
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
- $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
+ $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
ao_product.h: ao-make-product.5c ../Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
../$(PROG): $(REL) Makefile
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
- $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
+ $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
ao_product.h: ao-make-product.5c ../Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
../$(PROG): $(REL) Makefile
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
- $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
+ $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
ao_product.h: ao-make-product.5c ../Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
../$(PROG): $(REL) Makefile
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
- $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
+ $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
ao_product.h: ao-make-product.5c ../Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@