Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
authorBdale Garbee <bdale@gag.com>
Sat, 20 Oct 2018 07:18:12 +0000 (01:18 -0600)
committerBdale Garbee <bdale@gag.com>
Sat, 20 Oct 2018 07:18:12 +0000 (01:18 -0600)
516 files changed:
.gitmodules [deleted file]
Makefile.am
Releasing
altoslib/AltosAdxl375.java [new file with mode: 0644]
altoslib/AltosCalData.java
altoslib/AltosConfigData.java
altoslib/AltosIdleFetch.java
altoslib/Makefile.am
altosui/Makefile.am
altosui/altos-windows.nsi.in
configure.ac
doc/updating-firmware.inc
pdclib [deleted submodule]
src/Makedefs.in
src/Makefile
src/aes/ao_aes.c
src/attiny/ao_arch.h
src/attiny/ao_arch_funcs.h
src/attiny/ao_i2c_attiny.c
src/attiny/ao_led.c [deleted file]
src/attiny/ao_led_tiny.c [new file with mode: 0644]
src/attiny/ao_spi_attiny.c
src/avr-demo/Makefile
src/avr/ao_adc_avr.c
src/avr/ao_arch.h
src/avr/ao_arch_funcs.h
src/avr/ao_eeprom_avr.c
src/avr/ao_i2c_usart.c
src/avr/ao_led.c [deleted file]
src/avr/ao_led_avr.c [new file with mode: 0644]
src/avr/ao_pwmin.c
src/avr/ao_pwmin.h
src/avr/ao_romconfig.c [deleted file]
src/avr/ao_serial_avr.c
src/avr/ao_spi_usart.c
src/avr/ao_timer.c
src/avr/ao_usb_avr.c
src/cc1111/Makefile.cc1111 [deleted file]
src/cc1111/_bp.c [deleted file]
src/cc1111/ao_adc.c [deleted file]
src/cc1111/ao_aes.c [deleted file]
src/cc1111/ao_arch.h [deleted file]
src/cc1111/ao_arch_funcs.h [deleted file]
src/cc1111/ao_battery.c [deleted file]
src/cc1111/ao_beep.c [deleted file]
src/cc1111/ao_button.c [deleted file]
src/cc1111/ao_dbg.c [deleted file]
src/cc1111/ao_dma.c [deleted file]
src/cc1111/ao_exti.c [deleted file]
src/cc1111/ao_exti.h [deleted file]
src/cc1111/ao_intflash.c [deleted file]
src/cc1111/ao_launch.c [deleted file]
src/cc1111/ao_launch.h [deleted file]
src/cc1111/ao_lcd_port.c [deleted file]
src/cc1111/ao_led.c [deleted file]
src/cc1111/ao_pins.h [deleted file]
src/cc1111/ao_radio.c [deleted file]
src/cc1111/ao_reboot.c [deleted file]
src/cc1111/ao_romconfig.c [deleted file]
src/cc1111/ao_serial.c [deleted file]
src/cc1111/ao_spi.c [deleted file]
src/cc1111/ao_string.c [deleted file]
src/cc1111/ao_timer.c [deleted file]
src/cc1111/ao_usb.c [deleted file]
src/cc1111/cc1111.h [deleted file]
src/chaoskey-v0.1/Makefile
src/chaoskey-v1.0/Makefile
src/chaoskey-v1.0/ao_chaoskey.c
src/cortexelf-v1/ao_cortexelf.c
src/cortexelf-v1/cortexelf.ld
src/detherm/Makefile
src/draw/ao_line.c
src/drivers/ao_25lc1024.c
src/drivers/ao_74hc165.c
src/drivers/ao_74hc497.c
src/drivers/ao_adxl375.c [new file with mode: 0644]
src/drivers/ao_adxl375.h [new file with mode: 0644]
src/drivers/ao_aprs.c
src/drivers/ao_at24c.c
src/drivers/ao_at45db161d.c
src/drivers/ao_btm.c
src/drivers/ao_button.c
src/drivers/ao_cc1120.c
src/drivers/ao_cc115l.c
src/drivers/ao_cc1200.c
src/drivers/ao_companion.c
src/drivers/ao_fat.c
src/drivers/ao_gps_sirf.c
src/drivers/ao_gps_skytraq.c
src/drivers/ao_gps_ublox.c
src/drivers/ao_hmc5883.c
src/drivers/ao_lcd.c
src/drivers/ao_lco.c
src/drivers/ao_lco.h
src/drivers/ao_lco_cmd.c
src/drivers/ao_lco_func.c
src/drivers/ao_lco_two.c
src/drivers/ao_led.c [new file with mode: 0644]
src/drivers/ao_m25.c
src/drivers/ao_mma655x.c
src/drivers/ao_mpu6000.c
src/drivers/ao_mpu9250.c
src/drivers/ao_mr25.c
src/drivers/ao_ms5607.c
src/drivers/ao_ms5607.h
src/drivers/ao_ms5607_convert_8051.c
src/drivers/ao_packet.c
src/drivers/ao_packet_master.c
src/drivers/ao_packet_slave.c
src/drivers/ao_pad.c
src/drivers/ao_pca9922.c
src/drivers/ao_ps2.c
src/drivers/ao_pyro_slave.c
src/drivers/ao_quadrature.c
src/drivers/ao_quadrature.h
src/drivers/ao_radio_master.c
src/drivers/ao_radio_slave.c
src/drivers/ao_rn4678.c
src/drivers/ao_sdcard.c
src/drivers/ao_seven_segment.c
src/drivers/ao_trng_send.c
src/drivers/ao_watchdog.c
src/easymega-v1.0/Makefile
src/easymega-v1.0/ao_easymega.c
src/easymega-v1.0/ao_pins.h
src/easymega-v2.0/Makefile [new file with mode: 0644]
src/easymega-v2.0/ao_easymega.c [new file with mode: 0644]
src/easymega-v2.0/ao_pins.h [new file with mode: 0644]
src/easymega-v2.0/flash-loader/Makefile [new file with mode: 0644]
src/easymega-v2.0/flash-loader/ao_pins.h [new file with mode: 0644]
src/easymini-v1.0/ao_pins.h
src/easymini-v2.0/ao_pins.h
src/fox1ihu/Makefile
src/fox1ihu/ao_fox1ihu.c
src/kernel/ao.h
src/kernel/ao_aes.h
src/kernel/ao_balloon.c
src/kernel/ao_beep.h
src/kernel/ao_cmd.c
src/kernel/ao_companion.h
src/kernel/ao_config.c
src/kernel/ao_config.h
src/kernel/ao_convert.c
src/kernel/ao_data.c
src/kernel/ao_data.h
src/kernel/ao_ee_fake.c
src/kernel/ao_eeprom.h
src/kernel/ao_fake_flight.c
src/kernel/ao_flight.c
src/kernel/ao_flight.h
src/kernel/ao_flight_nano.c
src/kernel/ao_forward.c
src/kernel/ao_forward.h
src/kernel/ao_freq.c
src/kernel/ao_gps_print.c
src/kernel/ao_gps_report.c
src/kernel/ao_gps_report_mega.c
src/kernel/ao_gps_report_metrum.c
src/kernel/ao_gps_show.c
src/kernel/ao_host.h
src/kernel/ao_ignite.c
src/kernel/ao_int64.c
src/kernel/ao_int64.h
src/kernel/ao_kalman.c
src/kernel/ao_led.h
src/kernel/ao_log.c
src/kernel/ao_log.h
src/kernel/ao_log_big.c
src/kernel/ao_log_fireone.c
src/kernel/ao_log_mega.c
src/kernel/ao_log_metrum.c
src/kernel/ao_log_mini.c
src/kernel/ao_log_single.c
src/kernel/ao_log_telem.c
src/kernel/ao_log_telescience.c
src/kernel/ao_log_tiny.c
src/kernel/ao_monitor.c
src/kernel/ao_mutex.c
src/kernel/ao_notask.c
src/kernel/ao_notask.h
src/kernel/ao_packet.h
src/kernel/ao_power.c
src/kernel/ao_product.c
src/kernel/ao_pyro.c
src/kernel/ao_radio_cmac.c
src/kernel/ao_radio_cmac.h
src/kernel/ao_radio_cmac_cmd.c
src/kernel/ao_report.c
src/kernel/ao_report_micro.c
src/kernel/ao_romconfig.c [new file with mode: 0644]
src/kernel/ao_rssi.c
src/kernel/ao_sample.c
src/kernel/ao_sample.h
src/kernel/ao_sample_profile.c
src/kernel/ao_send_packet.c
src/kernel/ao_serial.h
src/kernel/ao_stdio.c
src/kernel/ao_storage.c
src/kernel/ao_storage.h
src/kernel/ao_task.c
src/kernel/ao_task.h
src/kernel/ao_telemetry.c
src/kernel/ao_tracker.c
src/kernel/ao_usb.h
src/lambdakey-v1.0/Makefile
src/lambdakey-v1.0/ao_lambdakey.c
src/lambdakey-v1.0/ao_pins.h
src/lambdakey-v1.0/ao_scheme_os.h
src/lambdakey-v1.0/lambda.ld [deleted file]
src/lpc/Makefile-lpc.defs
src/lpc/altos-loader.ld
src/lpc/altos-standalone.ld
src/lpc/altos.ld
src/lpc/ao_adc_lpc.c
src/lpc/ao_arch.h
src/lpc/ao_arch_funcs.h
src/lpc/ao_beep_lpc.c
src/lpc/ao_boot_pin.c
src/lpc/ao_interrupt.c
src/lpc/ao_led_lpc.c
src/lpc/ao_romconfig.c [deleted file]
src/lpc/ao_timer_lpc.c
src/lpc/ao_usb_lpc.c
src/math/ef_acos.c [deleted file]
src/math/ef_log.c [deleted file]
src/math/ef_rem_pio2.c [deleted file]
src/math/ef_sqrt.c [deleted file]
src/math/fdlibm.h [deleted file]
src/math/ieeefp.h [deleted file]
src/math/kf_cos.c [deleted file]
src/math/kf_rem_pio2.c [deleted file]
src/math/kf_sin.c [deleted file]
src/math/machine/ieeefp.h [deleted file]
src/math/math.h [deleted file]
src/math/sf_copysign.c [deleted file]
src/math/sf_cos.c [deleted file]
src/math/sf_fabs.c [deleted file]
src/math/sf_floor.c [deleted file]
src/math/sf_scalbn.c [deleted file]
src/math/sf_sin.c [deleted file]
src/megadongle-v0.1/.gitignore [deleted file]
src/megadongle-v0.1/Makefile [deleted file]
src/megadongle-v0.1/ao_megadongle.c [deleted file]
src/megadongle-v0.1/ao_pins.h [deleted file]
src/megadongle-v0.1/flash-loader/Makefile [deleted file]
src/megadongle-v0.1/flash-loader/ao_pins.h [deleted file]
src/microkite/Makefile
src/micropeak-v2.0/Makefile
src/micropeak-v2.0/ao_micropeak.c
src/micropeak-v2.0/micropeak.ld
src/micropeak/Makefile
src/microsplash/Makefile
src/nanopeak-v0.1/Makefile
src/nucleao-32/Makefile
src/nucleao-32/load.ld
src/pnpservo-v1/Makefile
src/pnpservo-v1/lambda.ld
src/product/Makefile.teledongle [deleted file]
src/product/Makefile.telelaunch [deleted file]
src/product/Makefile.telemetrum [deleted file]
src/product/Makefile.telemini [deleted file]
src/product/Makefile.telenano [deleted file]
src/product/ao_flash_task.c
src/product/ao_micropeak.c
src/product/ao_telemetrum.c
src/product/ao_telemini.c
src/product/ao_telenano.c
src/product/ao_teleterra.c
src/product/ao_terraui.c
src/product/ao_test.c
src/spiradio-v0.1/.gitignore [deleted file]
src/spiradio-v0.1/.sdcdbrc [deleted file]
src/spiradio-v0.1/Makefile [deleted file]
src/spiradio-v0.1/ao_pins.h [deleted file]
src/spiradio-v0.1/ao_spiradio.c [deleted file]
src/stm-bringup/bringup.ld
src/stm-demo/Makefile
src/stm-demo/ao_demo.c
src/stm-scheme-newlib/Makefile
src/stm-scheme-newlib/ao_demo.c
src/stm-vga/Makefile
src/stm-vga/ao_demo.c
src/stm/Makefile-flash.defs
src/stm/Makefile.defs
src/stm/altos-512.ld
src/stm/altos-loader.ld
src/stm/altos-ram.ld
src/stm/altos.ld
src/stm/ao_adc_single_stm.c
src/stm/ao_adc_stm.c
src/stm/ao_arch.h
src/stm/ao_arch_funcs.h
src/stm/ao_beep_stm.c
src/stm/ao_eeprom_stm.c
src/stm/ao_flash_stm_pins.h
src/stm/ao_i2c_stm.c
src/stm/ao_interrupt.c
src/stm/ao_lcd_stm.c
src/stm/ao_led.c [deleted file]
src/stm/ao_led_stm.c [new file with mode: 0644]
src/stm/ao_pwm_stm.c
src/stm/ao_romconfig.c [deleted file]
src/stm/ao_serial_stm.c
src/stm/ao_spi_stm.c
src/stm/ao_timer.c
src/stm/ao_usb_stm.c
src/stm/stm32l.h
src/stm32f4-disco/.gitignore [new file with mode: 0644]
src/stm32f4-disco/Makefile [new file with mode: 0644]
src/stm32f4-disco/ao_disco.c [new file with mode: 0644]
src/stm32f4-disco/ao_pins.h [new file with mode: 0644]
src/stm32f4-disco/ao_scheme_os.h [new file with mode: 0644]
src/stm32f4/Makefile-flash.defs [new file with mode: 0644]
src/stm32f4/Makefile-raw.defs [new file with mode: 0644]
src/stm32f4/Makefile-stm32f4.defs [new file with mode: 0644]
src/stm32f4/Makefile.defs [new file with mode: 0644]
src/stm32f4/altos-loader.ld [new file with mode: 0644]
src/stm32f4/altos-raw.ld [new file with mode: 0644]
src/stm32f4/altos.ld [new file with mode: 0644]
src/stm32f4/ao_arch.h [new file with mode: 0644]
src/stm32f4/ao_arch_funcs.h [new file with mode: 0644]
src/stm32f4/ao_exti.h [new file with mode: 0644]
src/stm32f4/ao_exti_stm32f4.c [new file with mode: 0644]
src/stm32f4/ao_interrupt.c [new file with mode: 0644]
src/stm32f4/ao_serial_stm32f4.c [new file with mode: 0644]
src/stm32f4/ao_timer.c [new file with mode: 0644]
src/stm32f4/ao_usart_stm32f4.c [new file with mode: 0644]
src/stm32f4/ao_usb_gen.c [new file with mode: 0644]
src/stm32f4/ao_usb_gen.h [new file with mode: 0644]
src/stm32f4/ao_usb_stm32f4.c [new file with mode: 0644]
src/stm32f4/registers.ld [new file with mode: 0644]
src/stm32f4/stm32f4.h [new file with mode: 0644]
src/stmf0/Makefile-stmf0.defs
src/stmf0/altos-loader.ld
src/stmf0/altos-raw.ld
src/stmf0/altos.ld
src/stmf0/ao_adc_stm.c
src/stmf0/ao_arch.h
src/stmf0/ao_arch_funcs.h
src/stmf0/ao_beep_stm.c
src/stmf0/ao_interrupt.c
src/stmf0/ao_led.c [deleted file]
src/stmf0/ao_led_stmf0.c [new file with mode: 0644]
src/stmf0/ao_romconfig.c [deleted file]
src/stmf0/ao_storage_stm.c
src/stmf0/ao_timer.c
src/stmf0/ao_usb_stm.c
src/teleballoon-v1.1/.gitignore [deleted file]
src/teleballoon-v1.1/Makefile [deleted file]
src/teleballoon-v1.1/ao_pins.h [deleted file]
src/teleballoon-v1.1/ao_teleballoon.c [deleted file]
src/teleballoon-v2.0/Makefile
src/teleballoon-v2.0/ao_pins.h
src/teleballoon-v2.0/ao_teleballoon.c
src/telebt-v1.0/.gitignore [deleted file]
src/telebt-v1.0/.sdcdbrc [deleted file]
src/telebt-v1.0/Makefile [deleted file]
src/telebt-v1.0/ao_pins.h [deleted file]
src/telebt-v1.0/ao_telebt.c [deleted file]
src/telebt-v3.0/Makefile
src/telebt-v3.0/ao_telebt.c
src/telebt-v4.0/Makefile
src/telebt-v4.0/ao_telebt.c
src/teledongle-v0.1/.gitignore [deleted file]
src/teledongle-v0.1/.sdcdbrc [deleted file]
src/teledongle-v0.1/Makefile [deleted file]
src/teledongle-v0.2/.gitignore [deleted file]
src/teledongle-v0.2/.sdcdbrc [deleted file]
src/teledongle-v0.2/Makefile [deleted file]
src/teledongle-v1.8/.gitignore [deleted file]
src/teledongle-v1.8/Makefile [deleted file]
src/teledongle-v1.8/ao_pins.h [deleted file]
src/teledongle-v1.8/ao_teledongle.c [deleted file]
src/teledongle-v3.0/ao_teledongle.c
src/telefire-v0.1/.gitignore [deleted file]
src/telefire-v0.1/.sdcdbrc [deleted file]
src/telefire-v0.1/Makefile [deleted file]
src/telefire-v0.1/ao_pins.h [deleted file]
src/telefire-v0.1/ao_telefire.c [deleted file]
src/telefire-v0.2/.gitignore [deleted file]
src/telefire-v0.2/.sdcdbrc [deleted file]
src/telefire-v0.2/Makefile [deleted file]
src/telefire-v0.2/ao_pins.h [deleted file]
src/telefire-v0.2/ao_telefire.c [deleted file]
src/telefireeight-v1.0/ao_pins.h
src/telefireeight-v1.0/ao_telefireeight.c
src/telefireone-v1.0/Makefile
src/telefireone-v1.0/ao_pins.h
src/telefireone-v1.0/ao_telefireone.c
src/telefiretwo-v0.1/Makefile
src/telefiretwo-v0.1/ao_telefiretwo.c
src/telefiretwo-v0.2/Makefile
src/telefiretwo-v0.2/ao_pins.h
src/telegps-v0.1/Makefile
src/telegps-v2.0/Makefile
src/telegps-v2.0/ao_telegps.c
src/telelco-v0.1/.gitignore [deleted file]
src/telelco-v0.1/Makefile [deleted file]
src/telelco-v0.1/ao_lco.c [deleted file]
src/telelco-v0.1/ao_lco.h [deleted file]
src/telelco-v0.1/ao_pins.h [deleted file]
src/telelco-v0.1/ao_telelco.c [deleted file]
src/telelco-v0.2-cc1200/Makefile
src/telelco-v0.2-cc1200/ao_pins.h
src/telelco-v0.2-cc1200/ao_telelco.c
src/telelco-v0.2/Makefile
src/telelco-v0.2/ao_pins.h
src/telelco-v0.2/ao_telelco.c
src/telelco-v0.3/Makefile
src/telelco-v0.3/ao_pins.h
src/telelco-v0.3/ao_telelco.c
src/telelco-v2.0/ao_lco_v2.c
src/telelco-v2.0/ao_pins.h
src/telelco-v2.0/ao_telelco.c
src/telelcotwo-v0.1/Makefile
src/telelcotwo-v0.1/ao_pins.h
src/telelcotwo-v0.1/ao_telelcotwo.c
src/telemega-v0.1/Makefile
src/telemega-v0.1/ao_pins.h
src/telemega-v0.1/ao_telemega.c
src/telemega-v1.0/Makefile
src/telemega-v1.0/ao_pins.h
src/telemega-v1.0/ao_telemega.c
src/telemega-v2.0/Makefile
src/telemega-v2.0/ao_pins.h
src/telemega-v2.0/ao_telemega.c
src/telemega-v3.0/Makefile
src/telemega-v3.0/ao_pins.h
src/telemega-v3.0/ao_telemega.c
src/telemetrum-v0.1-sirf/.gitignore [deleted file]
src/telemetrum-v0.1-sirf/Makefile [deleted file]
src/telemetrum-v0.1-sky/.gitignore [deleted file]
src/telemetrum-v0.1-sky/.sdcdbrc [deleted file]
src/telemetrum-v0.1-sky/Makefile [deleted file]
src/telemetrum-v1.0/.gitignore [deleted file]
src/telemetrum-v1.0/.sdcdbrc [deleted file]
src/telemetrum-v1.0/Makefile [deleted file]
src/telemetrum-v1.1/.gitignore [deleted file]
src/telemetrum-v1.1/.sdcdbrc [deleted file]
src/telemetrum-v1.1/Makefile [deleted file]
src/telemetrum-v1.2/.gitignore [deleted file]
src/telemetrum-v1.2/.sdcdbrc [deleted file]
src/telemetrum-v1.2/Makefile [deleted file]
src/telemetrum-v2.0/Makefile
src/telemetrum-v2.0/ao_pins.h
src/telemetrum-v2.0/ao_telemetrum.c
src/telemetrum-v3.0/Makefile
src/telemetrum-v3.0/ao_pins.h
src/telemetrum-v3.0/ao_telemetrum.c
src/telemini-v1.0/.gitignore [deleted file]
src/telemini-v1.0/.sdcdbrc [deleted file]
src/telemini-v1.0/Makefile [deleted file]
src/telemini-v2.0/.gitignore [deleted file]
src/telemini-v2.0/.sdcdbrc [deleted file]
src/telemini-v2.0/Makefile [deleted file]
src/telemini-v2.0/ao_pins.h [deleted file]
src/telemini-v2.0/ao_telemini.c [deleted file]
src/telemini-v3.0/ao_pins.h
src/telemini-v3.0/ao_telemini.c
src/telenano-v0.1/.gitignore [deleted file]
src/telenano-v0.1/.sdcdbrc [deleted file]
src/telenano-v0.1/Makefile [deleted file]
src/telepyro-v0.1/.gitignore [deleted file]
src/telepyro-v0.1/Makefile [deleted file]
src/telerepeat-v1.0/.gitignore [deleted file]
src/telerepeat-v1.0/.sdcdbrc [deleted file]
src/telerepeat-v1.0/Makefile [deleted file]
src/telerepeat-v1.0/ao_pins.h [deleted file]
src/telerepeat-v1.0/ao_telerepeat.c [deleted file]
src/telescience-pwm/.gitignore [deleted file]
src/telescience-pwm/Makefile [deleted file]
src/telescience-v0.1/.gitignore [deleted file]
src/telescience-v0.1/Makefile [deleted file]
src/telescience-v0.2/.gitignore [deleted file]
src/telescience-v0.2/Makefile [deleted file]
src/telescience-v0.2/ao_pins.h [deleted file]
src/telescience-v0.2/ao_telescience.c [deleted file]
src/telescience-v0.2/flash-loader/Makefile [deleted file]
src/telescience-v0.2/flash-loader/ao_pins.h [deleted file]
src/teleshield-v0.1/.gitignore [deleted file]
src/teleshield-v0.1/Makefile [deleted file]
src/teleshield-v0.1/ao_ardu_serial.c [deleted file]
src/teleshield-v0.1/ao_pins.h [deleted file]
src/teleshield-v0.1/ao_teleshield.c [deleted file]
src/teleterra-v0.1/.gitignore [deleted file]
src/teleterra-v0.1/ao_pins.h [deleted file]
src/teleterra-v0.2/.gitignore [deleted file]
src/teleterra-v0.2/.sdcdbrc [deleted file]
src/teleterra-v0.2/Makefile [deleted file]
src/teleterra-v0.2/ao_pins.h [deleted file]
src/test/ao_aes_test.c
src/test/ao_eeprom_read.h
src/test/ao_flight_test.c
src/test/ao_gps_test_skytraq.c
src/test/ao_gps_test_ublox.c
src/test/ao_int64_test.c
src/test/ao_ms5607_convert_test.c
src/tidongle/.gitignore [deleted file]
src/tidongle/Makefile [deleted file]
src/tmgps-v2.0/Makefile
src/usbrelay-v0.1/ao_usbrelay.c
src/usbtrng-v2.0/.gitignore [deleted file]
src/usbtrng-v2.0/Makefile [deleted file]
src/usbtrng-v2.0/ao_pins.h [deleted file]
src/usbtrng-v2.0/ao_usbtrng.c [deleted file]
src/usbtrng-v2.0/flash-loader/.gitignore [deleted file]
src/usbtrng-v2.0/flash-loader/Makefile [deleted file]
src/usbtrng-v2.0/flash-loader/ao_pins.h [deleted file]
src/usbtrng/Makefile [deleted file]
src/usbtrng/ao_pins.h [deleted file]
src/usbtrng/ao_usbtrng.c [deleted file]
src/usbtrng/flash-loader/Makefile [deleted file]
src/usbtrng/flash-loader/ao_pins.h [deleted file]
src/vidtime/ao_vidtime.c
telegps/Makefile.am
telegps/telegps-windows.nsi.in

diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644 (file)
index 719da19..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "pdclib"]
-       path = pdclib
-       url = git://git.gag.com/fw/pdclib
index 89fdd6c..602226f 100644 (file)
@@ -6,12 +6,6 @@ MAINTAINERCLEANFILES = ChangeLog
 
 .PHONY: ChangeLog
 
-all: pdclib/Makefile
-all-recursive: pdclib/Makefile
-
-pdclib/Makefile:
-       git submodule update
-
 ChangeLog:
        (GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || \
        (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
index 6540383..d0db6ac 100644 (file)
--- a/Releasing
+++ b/Releasing
@@ -103,6 +103,7 @@ These are Bdale's notes on how to do a release.
 
        cp src/chaoskey-v1.0/{*.elf,*.ihx,*.bin} \
           src/easymega-v1.0/{*.elf,*.ihx} \
+          src/easymega-v2.0/{*.elf,*.ihx} \
           src/easymini-v1.0/{*.elf,*.ihx} \
           src/easymini-v2.0/{*.elf,*.ihx} \
           src/telebt-v3.0/{*.elf,*.ihx} \
@@ -120,6 +121,7 @@ These are Bdale's notes on how to do a release.
           ~/altusmetrumllc/Binaries/
        cp src/chaoskey-v1.0/flash-loader/{*.elf,*.bin} \
           src/easymega-v1.0/flash-loader/*.elf \
+          src/easymega-v2.0/flash-loader/*.elf \
           src/easymini-v1.0/flash-loader/*.elf \
           src/easymini-v2.0/flash-loader/{*.elf,*.bin} \
           src/telebt-v3.0/flash-loader/*.elf \
diff --git a/altoslib/AltosAdxl375.java b/altoslib/AltosAdxl375.java
new file mode 100644 (file)
index 0000000..2129ed6
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright © 2012 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+
+package org.altusmetrum.altoslib_13;
+
+import java.util.concurrent.*;
+
+public class AltosAdxl375 implements Cloneable {
+
+       private int     accel;
+       private int     axis;
+
+       public static final int X_AXIS = 0;
+       public static final int Y_AXIS = 1;
+       public static final int Z_AXIS = 2;
+
+       public boolean parse_line(String line) throws NumberFormatException {
+               if (line.startsWith("ADXL375 value")) {
+                       System.out.printf("adxl parse line %s\n", line);
+                       String[] items = line.split("\\s+");
+                       if (axis == AltosLib.MISSING)
+                               throw new NumberFormatException("No ADXL375 axis specified");
+                       if (items.length >= 3) {
+                               accel = Integer.parseInt(items[2 + axis]);
+                               System.out.printf("accel %d\n", accel);
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       public AltosAdxl375 clone() {
+               AltosAdxl375    n = new AltosAdxl375(axis);
+
+               n.accel = accel;
+               return n;
+       }
+
+       static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException, AltosUnknownProduct {
+               try {
+                       AltosCalData    cal_data = listener.cal_data();
+                       AltosAdxl375    adxl375 = new AltosAdxl375(link, cal_data.adxl375_axis);
+
+                       if (adxl375 != null) {
+                               int accel = adxl375.accel;
+                               if (cal_data.adxl375_inverted)
+                                       accel = -accel;
+                               if (cal_data.pad_orientation == 1)
+                                       accel = -accel;
+                               listener.set_acceleration(cal_data.acceleration(accel));
+                       }
+               } catch (TimeoutException te) {
+               } catch (NumberFormatException ne) {
+               }
+       }
+
+       public AltosAdxl375() {
+               accel = AltosLib.MISSING;
+               axis = AltosLib.MISSING;
+       }
+
+       public AltosAdxl375(int axis) {
+               this();
+               this.axis = axis;
+       }
+
+       public AltosAdxl375(AltosLink link, int axis) throws InterruptedException, TimeoutException, NumberFormatException {
+               this(axis);
+               link.printf("A\n");
+               for (;;) {
+                       String line = link.get_reply_no_dialog(5000);
+                       if (line == null)
+                               throw new TimeoutException();
+                       if (parse_line(line))
+                               break;
+               }
+       }
+}
index d448fdf..c3d7925 100644 (file)
@@ -133,6 +133,18 @@ public class AltosCalData {
                mma655x_inverted = inverted;
        }
 
+       public boolean adxl375_inverted = false;
+
+       public void set_adxl375_inverted(boolean inverted) {
+               adxl375_inverted = inverted;
+       }
+
+       public int adxl375_axis = AltosLib.MISSING;
+
+       public void set_adxl375_axis(int axis) {
+               adxl375_axis = axis;
+       }
+
        public int pad_orientation = AltosLib.MISSING;
 
        public void set_pad_orientation(int orientation) {
@@ -142,7 +154,11 @@ public class AltosCalData {
 
        /* Compute acceleration */
        public double acceleration(double sensor) {
-               return AltosConvert.acceleration_from_sensor(sensor, accel_plus_g, accel_minus_g, ground_accel);
+               double accel;
+               accel = AltosConvert.acceleration_from_sensor(sensor, accel_plus_g, accel_minus_g, ground_accel);
+               System.out.printf("acceleration %g (+ %g - %g g %g) -> %g\n",
+                                 sensor, accel_plus_g, accel_minus_g, ground_accel, accel);
+               return accel;
        }
 
        public AltosMs5607      ms5607 = null;
@@ -404,6 +420,14 @@ public class AltosCalData {
                        set_mma655x_inverted(config_data.mma655x_inverted());
                } catch (AltosUnknownProduct up) {
                }
+               try {
+                       set_adxl375_inverted(config_data.adxl375_inverted());
+               } catch (AltosUnknownProduct up) {
+               }
+               try {
+                       set_adxl375_axis(config_data.adxl375_axis());
+               } catch (AltosUnknownProduct up) {
+               }
                set_pad_orientation(config_data.pad_orientation);
        }
 }
index 48dab42..29ce033 100644 (file)
@@ -581,6 +581,22 @@ public class AltosConfigData {
                throw new AltosUnknownProduct(product);
        }
 
+       public boolean adxl375_inverted() throws AltosUnknownProduct {
+               if (product != null) {
+                       if (product.startsWith("EasyMega-v2"))
+                               return true;
+               }
+               throw new AltosUnknownProduct(product);
+       }
+
+       public int adxl375_axis() throws AltosUnknownProduct {
+               if (product != null) {
+                       if (product.startsWith("EasyMega-v2"))
+                               return AltosAdxl375.X_AXIS;
+               }
+               throw new AltosUnknownProduct(product);
+       }
+
        public void get_values(AltosConfigValues source) throws AltosConfigDataException {
 
                /* HAS_FLIGHT */
index 88a65e6..884d876 100644 (file)
@@ -32,7 +32,7 @@ class AltosIdler {
        static final int        idle_mag = 2;
        static final int        idle_mma655x = 4;
        static final int        idle_ms5607 = 5;
-
+       static final int        idle_adxl375 = 6;
 
        static final int        idle_sensor_tm = 10;
        static final int        idle_sensor_metrum = 11;
@@ -58,6 +58,9 @@ class AltosIdler {
                        case idle_mma655x:
                                AltosMma655x.provide_data(listener, link);
                                break;
+                       case idle_adxl375:
+                               AltosAdxl375.provide_data(listener, link);
+                               break;
                        case idle_ms5607:
                                AltosMs5607.provide_data(listener, link);
                                break;
@@ -157,11 +160,16 @@ public class AltosIdleFetch implements AltosDataProvider {
                               AltosIdler.idle_ms5607,
                               AltosIdler.idle_imu,
                               AltosIdler.idle_sensor_mega),
-               new AltosIdler("EasyMega",
+               new AltosIdler("EasyMega-v1",
                               AltosIdler.idle_mma655x,
                               AltosIdler.idle_ms5607,
                               AltosIdler.idle_imu, AltosIdler.idle_mag,
                               AltosIdler.idle_sensor_mega),
+               new AltosIdler("EasyMega-v2",
+                              AltosIdler.idle_adxl375,
+                              AltosIdler.idle_ms5607,
+                              AltosIdler.idle_imu,
+                              AltosIdler.idle_sensor_mega),
                new AltosIdler("TeleGPS",
                               AltosIdler.idle_gps,
                               AltosIdler.idle_sensor_tgps),
index 9297633..2f4e595 100644 (file)
@@ -28,6 +28,7 @@ altoslib_JAVA = \
        AltosLib.java \
        AltosAccelCal.java \
        AltosAccelCalListener.java \
+       AltosAdxl375.java \
        AltosCalData.java \
        AltosCompanion.java \
        AltosConfigData.java \
index 144d21d..7cc1f4e 100644 (file)
@@ -118,26 +118,18 @@ LINUX_MIMETYPE    =\
        $(ICONDIR)/org-altusmetrum-mimetypes.xml
 
 # Firmware
-FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx
 FIRMWARE_TD_3_0=$(top_srcdir)/src/teledongle-v3.0/teledongle-v3.0-$(VERSION).ihx
-FIRMWARE_TD=$(FIRMWARE_TD_0_2) $(FIRMWARE_TD_3_0)
+FIRMWARE_TD=$(FIRMWARE_TD_3_0)
 
-FIRMWARE_TM_1_0=$(top_srcdir)/src/telemetrum-v1.0/telemetrum-v1.0-$(VERSION).ihx
-FIRMWARE_TM_1_1=$(top_srcdir)/src/telemetrum-v1.1/telemetrum-v1.1-$(VERSION).ihx
-FIRMWARE_TM_1_2=$(top_srcdir)/src/telemetrum-v1.2/telemetrum-v1.2-$(VERSION).ihx
 FIRMWARE_TM_2_0=$(top_srcdir)/src/telemetrum-v2.0/telemetrum-v2.0-$(VERSION).ihx
-#FIRMWARE_TM_3_0=$(top_srcdir)/src/telemetrum-v3.0/telemetrum-v3.0-$(VERSION).ihx
-#FIRMWARE_TM=$(FIRMWARE_TM_1_0) $(FIRMWARE_TM_1_1) $(FIRMWARE_TM_1_2) $(FIRMWARE_TM_2_0) $(FIRMWARE_TM_3_0)
-FIRMWARE_TM=$(FIRMWARE_TM_1_0) $(FIRMWARE_TM_1_1) $(FIRMWARE_TM_1_2) $(FIRMWARE_TM_2_0)
+FIRMWARE_TM=$(FIRMWARE_TM_2_0)
 
-FIRMWARE_TELEMINI_1_0=$(top_srcdir)/src/telemini-v1.0/telemini-v1.0-$(VERSION).ihx
 FIRMWARE_TELEMINI_3_0=$(top_srcdir)/src/telemini-v3.0/telemini-v3.0-$(VERSION).ihx
-FIRMWARE_TELEMINI=$(FIRMWARE_TELEMINI_1_0) $(FIRMWARE_TELEMINI_3_0)
+FIRMWARE_TELEMINI=$(FIRMWARE_TELEMINI_3_0)
 
-FIRMWARE_TBT_1_0=$(top_srcdir)/src/telebt-v1.0/telebt-v1.0-$(VERSION).ihx
 FIRMWARE_TBT_3_0=$(top_srcdir)/src/telebt-v3.0/telebt-v3.0-$(VERSION).ihx
 FIRMWARE_TBT_4_0=$(top_srcdir)/src/telebt-v4.0/telebt-v4.0-$(VERSION).ihx
-FIRMWARE_TBT=$(FIRMWARE_TBT_1_0) $(FIRMWARE_TBT_3_0) $(FIRMWARE_TBT_4_0)
+FIRMWARE_TBT=$(FIRMWARE_TBT_3_0) $(FIRMWARE_TBT_4_0)
 
 FIRMWARE_TMEGA_1_0=$(top_srcdir)/src/telemega-v1.0/telemega-v1.0-$(VERSION).ihx
 FIRMWARE_TMEGA_2_0=$(top_srcdir)/src/telemega-v2.0/telemega-v2.0-$(VERSION).ihx
@@ -148,7 +140,8 @@ FIRMWARE_EMINI_1_0=$(top_srcdir)/src/easymini-v1.0/easymini-v1.0-$(VERSION).ihx
 FIRMWARE_EMINI=$(FIRMWARE_EMINI_1_0)
 
 FIRMWARE_EMEGA_1_0=$(top_srcdir)/src/easymega-v1.0/easymega-v1.0-$(VERSION).ihx
-FIRMWARE_EMEGA=$(FIRMWARE_EMEGA_1_0)
+FIRMWARE_EMEGA_2_0=$(top_srcdir)/src/easymega-v2.0/easymega-v2.0-$(VERSION).ihx
+FIRMWARE_EMEGA=$(FIRMWARE_EMEGA_1_0) $(FIRMWARE_EMEGA_2_0)
 
 FIRMWARE_TGPS_1_0=$(top_srcdir)/src/telegps-v1.0/telegps-v1.0-$(VERSION).ihx
 FIRMWARE_TGPS_2_0=$(top_srcdir)/src/telegps-v2.0/telegps-v2.0-$(VERSION).ihx
index be9fb43..2666fc3 100644 (file)
@@ -120,18 +120,12 @@ Section "Firmware"
 
        SetOutPath $INSTDIR
 
-       File "../src/telemetrum-v1.0/telemetrum-v1.0-${VERSION}.ihx"
-       File "../src/telemetrum-v1.1/telemetrum-v1.1-${VERSION}.ihx"
-       File "../src/telemetrum-v1.2/telemetrum-v1.2-${VERSION}.ihx"
        File "../src/telemetrum-v2.0/telemetrum-v2.0-${VERSION}.ihx"
 ;      File "../src/telemetrum-v3.0/telemetrum-v3.0-${VERSION}.ihx"
-       File "../src/telemini-v1.0/telemini-v1.0-${VERSION}.ihx"
        File "../src/telemini-v3.0/telemini-v3.0-${VERSION}.ihx"
        File "../src/telegps-v1.0/telegps-v1.0-${VERSION}.ihx"
        File "../src/telegps-v2.0/telegps-v2.0-${VERSION}.ihx"
-       File "../src/teledongle-v0.2/teledongle-v0.2-${VERSION}.ihx"
        File "../src/teledongle-v3.0/teledongle-v3.0-${VERSION}.ihx"
-       File "../src/telebt-v1.0/telebt-v1.0-${VERSION}.ihx"
        File "../src/telebt-v3.0/telebt-v3.0-${VERSION}.ihx"
        File "../src/telebt-v4.0/telebt-v4.0-${VERSION}.ihx"
        File "../src/telemega-v1.0/telemega-v1.0-${VERSION}.ihx"
@@ -140,6 +134,7 @@ Section "Firmware"
        File "../src/easymini-v1.0/easymini-v1.0-${VERSION}.ihx"
        File "../src/easymini-v2.0/easymini-v2.0-${VERSION}.ihx"
        File "../src/easymega-v1.0/easymega-v1.0-${VERSION}.ihx"
+       File "../src/easymega-v2.0/easymega-v2.0-${VERSION}.ihx"
 
 SectionEnd
 
index 7f7eec9..e888aa9 100644 (file)
@@ -18,8 +18,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([altos], 1.8.7)
-ANDROID_VERSION=17
+AC_INIT([altos], 1.8.7.1)
+ANDROID_VERSION=18
 AC_CONFIG_SRCDIR([src/kernel/ao.h])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
@@ -209,36 +209,6 @@ if test "x$GCC" = "xyes"; then
 fi
 AC_SUBST(WARN_CFLAGS)
 
-#
-# Configure SDCC
-#
-
-AC_ARG_WITH([sdcc],
-           [AS_HELP_STRING([--with-sdcc],
-                           [Name of SDCC])],
-           [],
-           [with_sdcc=auto])
-
-if test "x$with_sdcc" != "xno"; then       
-       if test "x$with_sdcc" = "xauto"; then
-               with_sdcc="sdcc"
-               AC_CHECK_PROG([HAVE_SDCC],[$with_sdcc], yes, no)
-       else
-               HAVE_SDCC=yes
-       fi
-else
-       HAVE_SDCC=no
-fi
-
-if test "x$HAVE_SDCC" = "xno"; then
-       AC_MSG_WARN([SDCC not found, cc1111 binaries will not be built])
-else
-       SDCC=$with_sdcc
-fi
-
-AC_SUBST(SDCC)
-AC_SUBST(HAVE_SDCC)
-
 #
 # Configure ARM compiler for STM32L and LPC11U14
 #
@@ -268,27 +238,6 @@ fi
 AC_SUBST(HAVE_ARM_CC)
 AC_SUBST(ARM_CC)
 
-if test -d pdclib -a x"$HAVE_ARM_CC" = xyes; then
-       PDCLIB_ROOT='$(TOPDIR)/../pdclib-root'
-       PDCLIB_INCLUDES='-I$(TOPDIR)/../pdclib-root/include'
-       PDCLIB_LIBS_M0='-L$(TOPDIR)/../pdclib-root/lib -lpdclib-cortex-m0'
-       PDCLIB_LIBS_M3='-L$(TOPDIR)/../pdclib-root/lib -lpdclib-cortex-m3'
-       HAVE_PDCLIB=yes
-else
-       PDCLIB_INCLUDES=''
-       PDCLIB_LIBS_M0='-lpdclib-cortex-m0'
-       PDCLIB_LIBS_M3='-lpdclib-cortex-m3'
-       HAVE_PDCLIB=no
-fi
-
-AM_CONDITIONAL(PDCLIB, [test x$HAVE_PDCLIB = xyes])
-
-AC_SUBST(PDCLIB_INCLUDES)
-AC_SUBST(PDCLIB_LIBS_M0)
-AC_SUBST(PDCLIB_LIBS_M3)
-AC_SUBST(PDCLIB_ROOT)
-AC_SUBST(HAVE_PDCLIB)
-
 if test "x$HAVE_ARM_CC" = "xyes"; then
        save_CC="$CC"
        save_CFLAGS="$CFLAGS"
@@ -311,16 +260,6 @@ if test "x$HAVE_ARM_CC" = "xyes"; then
                          [HAVE_ARM_M3_CC=no])
         AC_MSG_RESULT([$HAVE_ARM_M3_CC])
 
-       if test x$HAVE_PDCLIB != xyes; then
-               AC_CHECK_LIB(pdclib-cortex-m0,memcpy,
-                            [],
-                            [HAVE_ARM_M0_CC=no])
-
-               AC_CHECK_LIB(pdclib-cortex-m3,memcpy,
-                            [],
-                            [HAVE_ARM_M3_CC=no])
-        fi
-
        AC_LANG_POP([C])
        LIBS="$save_LIBS"
        CFLAGS="$save_CFLAGS"
@@ -340,6 +279,37 @@ if test "x$HAVE_ARM_M0_CC" = "xno"; then
        AC_MSG_WARN([No cortex-m0 arm compiler found, LPC11U14 binaries will not be built])
 fi
 
+AC_ARG_WITH([newlib-nano],
+           [AS_HELP_STRING([--with-newlib-nano],
+                           [Root of newlib nano install])],
+           [],
+           [with_newlib_nano=auto])
+
+HAVE_NEWLIB_NANO=no
+if test "x$with_newlib_nano" != "xno"; then
+       if test "x$with_newlib_nano" = "xauto"; then
+               for d in /usr/local/lib/newlib-nano /usr/lib/newlib-nano; do
+                       if test "x$with_newlib_nano" = "xauto" -a -d "$d"; then
+                               with_newlib_nano="$d"
+                               HAVE_NEWLIB_NANO=yes
+                       fi
+               done
+       else
+               HAVE_NEWLIB_NANO=yes
+       fi
+fi
+
+if test "x$HAVE_NEWLIB_NANO" = "xno"; then
+       AC_MSG_WARN([No newlib-nano library found, ARM binaries will not be built])
+       HAVE_ARM_M3_CC=no
+       HAVE_ARM_M0_CC=no
+else
+       NEWLIB_NANO="$with_newlib_nano"
+fi
+
+AC_SUBST(HAVE_NEWLIB_NANO)
+AC_SUBST(NEWLIB_NANO)
+
 #
 # Configure AVR compiler
 #
@@ -587,14 +557,12 @@ echo "  Configuration"
 echo "    Arm compiler................: ${ARM_CC}"
 echo "    STM32L support..............: ${HAVE_ARM_M3_CC}"
 echo "    LPC11U14 support............: ${HAVE_ARM_M0_CC}"
-echo "    SDCC........................: ${SDCC}"
-echo "    CC1111 support..............: ${HAVE_SDCC}"
 echo "    AVR compiler................: ${AVR_CC} ${AVR_OBJCOPY}"
 echo "    AVR support.................: ${HAVE_AVR_CC}"
 echo "    Android support.............: ${HAVE_ANDROID_SDK}"
 echo "    Android release support.....: ${ANDROID_RELEASE}"
 echo "    STlink support..............: ${HAVE_STLINK}"
-echo "    Local pdclib................: ${HAVE_PDCLIB}"
+echo "    Newlib-nano support.........: ${NEWLIB_NANO}"
 echo "    i386 and amd64 libaltos.....: ${MULTI_ARCH}"
 echo "    install shared mime info....: ${INSTALL_SHARED_MIME_INFO}"
 echo ""
index 91aa58f..d288382 100644 (file)
                        to the USB wires on the row of pins towards the center
                        of the board. Ground is available on the capacitor
                        next to it, on the end towards the USB wires.
+                       
+                       TeleBT v4::
+
+                       Connect pin 30 on the CPU to ground. Pin 30 is the 6th
+                       pin from the right on the top when the unit is oriented
+                       such that the SMA is at the top.
                        endif::telemetrum[]
 
                        Once you've located the right pins:
diff --git a/pdclib b/pdclib
deleted file mode 160000 (submodule)
index 20f71c3..0000000
--- a/pdclib
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 20f71c3a97eb4c7ecfa9754a0ca42855db935999
index a52f96f..b87e884 100644 (file)
@@ -1,14 +1,8 @@
 ARM_CC=@ARM_CC@
 HAVE_ARM_M3_CC=@HAVE_ARM_M3_CC@
 HAVE_ARM_M0_CC=@HAVE_ARM_M0_CC@
-PDCLIB_INCLUDES=@PDCLIB_INCLUDES@
-PDCLIB_LIBS_M0=@PDCLIB_LIBS_M0@
-PDCLIB_LIBS_M3=@PDCLIB_LIBS_M3@
-PDCLIB_ROOT=@PDCLIB_ROOT@
-HAVE_PDCLIB=@HAVE_PDCLIB@
-
-SDCC=@SDCC@
-HAVE_SDCC=@HAVE_SDCC@
+NEWLIB_NANO=@NEWLIB_NANO@
+HAVE_NEWLIB_NANO=@HAVE_NEWLIB_NANO@
 
 AVR_CC=@AVR_CC@
 AVR_OBJCOPY=@AVR_OBJCOPY@
index a1ff84c..757641f 100644 (file)
@@ -16,16 +16,9 @@ include Version
 TOPDIR=.
 include Makedefs
 
-SDCCDIRS=\
-       telemetrum-v1.2 telemetrum-v1.1 telemetrum-v1.0 \
-       teledongle-v0.2 \
-       telemini-v1.0 \
-       telebt-v1.0 \
-       telefire-v0.1 telefire-v0.2 \
-       telerepeat-v1.0
-
 ARMM3DIRS=\
        easymega-v1.0 easymega-v1.0/flash-loader \
+       easymega-v2.0 easymega-v2.0/flash-loader \
        telemega-v0.1 telemega-v0.1/flash-loader \
        telemega-v1.0 telemega-v1.0/flash-loader \
        telemega-v2.0 telemega-v2.0/flash-loader \
@@ -59,15 +52,6 @@ AVRDIRS=\
 
 SUBDIRS=
 
-ifeq ($(strip $(HAVE_PDCLIB)),yes)
-PDCLIB=pdclib
-CLEAN_PDCLIB=clean-pdclib
-endif
-
-ifeq ($(strip $(HAVE_SDCC)),yes)
-SUBDIRS+=$(SDCCDIRS)
-endif
-
 ifeq ($(strip $(HAVE_ARM_M3_CC)),yes)
 SUBDIRS+=$(ARMM3DIRS)
 foo=bar
@@ -82,7 +66,7 @@ ifeq ($(strip $(HAVE_AVR_CC)),yes)
 SUBDIRS += $(AVRDIRS)
 endif
 
-ALLDIRS=$(SDCCDIRS) $(ARMM3DIRS) $(ARMM0DIRS) $(AVRDIRS)
+ALLDIRS=$(ARMM3DIRS) $(ARMM0DIRS) $(AVRDIRS)
 
 all: all-local all-recursive
 
@@ -133,11 +117,3 @@ ao_whiten.h: make-whiten
 
 clean-local: $(CLEAN_PDCLIB)
        rm -f altitude.h ao_kalman.h
-
-pdclib:
-       mkdir -p $(PDCLIB_ROOT)/include $(PDCLIB_ROOT)/lib 
-       cd ../pdclib && make && make prefix=`pwd`/../pdclib-root install
-
-clean-pdclib:
-       rm -rf $(PDCLIB_ROOT)
-       cd ../pdclib && make clean
index fd90c5b..0bc8188 100644 (file)
@@ -372,7 +372,7 @@ ao_aes_set_mode(enum ao_aes_mode mode)
 }
 
 void
-ao_aes_set_key(__xdata uint8_t *in)
+ao_aes_set_key(uint8_t *in)
 {
        memcpy(key, in, 16);
        xrijndaelKeySched((word32 *) key, 128, 128, &rkk);
@@ -385,8 +385,8 @@ ao_aes_zero_iv(void)
 }
 
 void
-ao_aes_run(__xdata uint8_t *in,
-          __xdata uint8_t *out)
+ao_aes_run(uint8_t *in,
+          uint8_t *out)
 {
        uint8_t i;
        uint8_t *_iv = (uint8_t *) iv;
index 68f5702..dfd41af 100644 (file)
 
 #define AO_PORT_TYPE   uint8_t
 
+#define AO_LED_TYPE    uint8_t
+
 /* Various definitions to make GCC look more like SDCC */
 
 #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 __at(n)
 
@@ -53,6 +49,8 @@
 
 #define ao_arch_interrupt(n)   /* nothing */
 
+#define AO_ROMCONFIG_SYMBOL __attribute__((section(".romconfig"))) const
+
 #undef putchar
 #undef getchar
 #define putchar(c)     ao_putchar(c)
index 0b67a40..69b259d 100644 (file)
                (reg) |= (mask);                \
        } while (0)
 
-#define ao_spi_get_bit(reg,bit,pin,bus,speed) ao_spi_get_mask(reg,(1<<(bit)),bus,speed)
+#define ao_spi_get_bit(reg,bit,bus,speed) ao_spi_get_mask(reg,(1<<(bit)),bus,speed)
 
-#define ao_spi_put_bit(reg,bit,pin,bus) ao_spi_put_mask(reg,(1<<(bit)),bus)
+#define ao_spi_put_bit(reg,bit,bus) ao_spi_put_mask(reg,(1<<(bit)),bus)
 
 #define ao_gpio_token_paster(x,y)              x ## y
 #define ao_gpio_token_evaluator(x,y)   ao_gpio_token_paster(x,y)
 
-#define ao_gpio_set(port, bit, pin, v) do {    \
+#define ao_gpio_set(port, bit, v) do { \
                if (v)                          \
                        PORTB |= (1 << bit);    \
                else                            \
                        PORTB &= ~(1 << bit);   \
        } while (0)
 
-#define ao_gpio_get(port, bit, pin)    ((PORTB >> (bit)) & 1)
+#define ao_gpio_get(port, bit) ((PORTB >> (bit)) & 1)
 
 /*
  * The SPI mutex must be held to call either of these
  * from chip select low to chip select high
  */
 
-#define ao_enable_output(port, bit, pin, v) do {                       \
-               ao_gpio_set(port, bit, pin, v);                         \
+#define ao_enable_output(port, bit, v) do {                    \
+               ao_gpio_set(port, bit, v);                              \
                ao_gpio_token_evaluator(DDR,port) |= (1 << bit);        \
        } while (0)
 
 
 void
-ao_spi_send_bus(void __xdata *block, uint16_t len) __reentrant;
+ao_spi_send_bus(void *block, uint16_t len);
 
 void
-ao_spi_recv_bus(void __xdata *block, uint16_t len) __reentrant;
+ao_spi_recv_bus(void *block, uint16_t len);
 
 #define ao_spi_send(block, len, bus) ao_spi_send_bus(block, len)
 #define ao_spi_recv(block, len, bus) ao_spi_recv_bus(block, len)
@@ -110,10 +110,10 @@ ao_i2c_init(void);
 /* notask.c */
 
 uint8_t
-ao_sleep(__xdata void *wchan);
+ao_sleep(void *wchan);
 
 void
-ao_wakeup(__xdata void *wchan);
+ao_wakeup(void *wchan);
 
 extern alt_t   ao_max_height;
 
index f29ed6a..34185b5 100644 (file)
@@ -173,7 +173,7 @@ ao_i2c_stop_bus(void)
  * so using interrupts would take way too long
  */
 uint8_t
-ao_i2c_send_bus(void __xdata *block, uint16_t len, uint8_t stop)
+ao_i2c_send_bus(void *block, uint16_t len, uint8_t stop)
 {
        uint8_t *d = block;
 
@@ -206,7 +206,7 @@ ao_i2c_send_fixed_bus(uint8_t d, uint16_t len, uint8_t stop)
  * Poll, sending zeros and reading data back
  */
 uint8_t
-ao_i2c_recv_bus(void __xdata *block, uint16_t len, uint8_t stop)
+ao_i2c_recv_bus(void *block, uint16_t len, uint8_t stop)
 {
        uint8_t *d = block;
 
diff --git a/src/attiny/ao_led.c b/src/attiny/ao_led.c
deleted file mode 100644 (file)
index 5f53129..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-__pdata uint8_t ao_led_enable;
-
-#define LED_PORT       PORTB
-#define LED_DDR                DDRB
-
-void
-ao_led_on(uint8_t colors)
-{
-       LED_PORT |= (colors & ao_led_enable);
-}
-
-void
-ao_led_off(uint8_t colors)
-{
-       LED_PORT &= ~(colors & ao_led_enable);
-}
-
-void
-ao_led_set(uint8_t colors)
-{
-       LED_PORT = (LED_PORT & ~(ao_led_enable)) | (colors & ao_led_enable);
-}
-
-void
-ao_led_toggle(uint8_t colors)
-{
-       LED_PORT ^= (colors & ao_led_enable);
-}
-
-void
-ao_led_for(uint8_t colors, uint16_t ticks) __reentrant
-{
-       ao_led_on(colors);
-       ao_delay(ticks);
-       ao_led_off(colors);
-}
-
-void
-ao_led_init(uint8_t enable)
-{
-       ao_led_enable = enable;
-       LED_PORT &= ~enable;
-       LED_DDR |= enable;
-}
diff --git a/src/attiny/ao_led_tiny.c b/src/attiny/ao_led_tiny.c
new file mode 100644 (file)
index 0000000..cd620f4
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright © 2009 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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"
+
+#define LED_PORT       PORTB
+#define LED_DDR                DDRB
+
+void
+ao_led_on(uint8_t colors)
+{
+       LED_PORT |= colors;
+}
+
+void
+ao_led_off(uint8_t colors)
+{
+       LED_PORT &= ~colors;
+}
+
+void
+ao_led_set(uint8_t colors)
+{
+       LED_PORT = (LED_PORT & ~LEDS_AVAILABLE) | (colors & LEDS_AVAILABLE);
+}
+
+void
+ao_led_toggle(uint8_t colors)
+{
+       LED_PORT ^= (colors & LEDS_AVAILABLE);
+}
+
+void
+ao_led_for(uint8_t colors, AO_TICK_TYPE ticks)
+{
+       ao_led_on(colors);
+       ao_delay(ticks);
+       ao_led_off(colors);
+}
+
+void
+ao_led_init(void)
+{
+       LED_PORT &= ~LEDS_AVAILABLE;
+       LED_DDR |= LEDS_AVAILABLE;
+}
index f63eb65..1c90ad5 100644 (file)
@@ -82,7 +82,7 @@ ao_spi_transfer(uint8_t i)
  * so using interrupts would take way too long
  */
 void
-ao_spi_send_bus(void __xdata *block, uint16_t len) __reentrant
+ao_spi_send_bus(void *block, uint16_t len) 
 {
        uint8_t *d = block;
 
@@ -95,7 +95,7 @@ ao_spi_send_bus(void __xdata *block, uint16_t len) __reentrant
  * Poll, sending zeros and reading data back
  */
 void
-ao_spi_recv_bus(void __xdata *block, uint16_t len) __reentrant
+ao_spi_recv_bus(void *block, uint16_t len) 
 {
        uint8_t *d = block;
 
index e21ad04..0aca6f8 100644 (file)
@@ -38,7 +38,7 @@ ALTOS_SRC = \
        ao_stdio.c \
        ao_task.c \
        ao_timer.c \
-       ao_led.c \
+       ao_led_avr.c \
        ao_usb_avr.c \
        ao_lcd.c
 
index 2732c4d..2aae95a 100644 (file)
@@ -19,8 +19,8 @@
 #include "ao.h"
 #include "ao_pwmin.h"
 
-volatile __xdata struct ao_data        ao_data_ring[AO_DATA_RING];
-volatile __data uint8_t                ao_data_head;
+volatile struct ao_data        ao_data_ring[AO_DATA_RING];
+volatile uint8_t               ao_data_head;
 
 #ifdef TELESCIENCE
 const uint8_t  adc_channels[AO_LOG_TELESCIENCE_NUM_ADC] = {
@@ -119,16 +119,16 @@ ao_adc_poll(void)
 }
 
 void
-ao_data_get(__xdata struct ao_data *packet)
+ao_data_get(struct ao_data *packet)
 {
        uint8_t i = ao_data_ring_prev(ao_data_head);
        memcpy(packet, (void *) &ao_data_ring[i], sizeof (struct ao_data));
 }
 
 static void
-ao_adc_dump(void) __reentrant
+ao_adc_dump(void) 
 {
-       static __xdata struct ao_data   packet;
+       static struct ao_data   packet;
        uint8_t i;
        ao_data_get(&packet);
        printf("tick: %5u",  packet.tick);
@@ -137,7 +137,7 @@ ao_adc_dump(void) __reentrant
        printf("\n");
 }
 
-__code struct ao_cmds ao_adc_cmds[] = {
+const struct ao_cmds ao_adc_cmds[] = {
        { ao_adc_dump,  "a\0ADC" },
        { 0, NULL },
 };
index 2b1da64..6166c50 100644 (file)
 
 #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 __at(n)
 
index 891ad9b..f2a58af 100644 (file)
@@ -20,7 +20,7 @@
  * ao_spi.c
  */
 
-extern __xdata uint8_t ao_spi_mutex;
+extern uint8_t ao_spi_mutex;
 
 #define ao_spi_get_mask(reg,mask,bus,speed) do {       \
                ao_mutex_get(&ao_spi_mutex);    \
@@ -32,12 +32,12 @@ extern __xdata uint8_t      ao_spi_mutex;
                ao_mutex_put(&ao_spi_mutex);    \
        } while (0)
 
-#define ao_spi_get_bit(reg,bit,pin,bus,speed) do {     \
+#define ao_spi_get_bit(reg,bit,bus,speed) do { \
                ao_mutex_get(&ao_spi_mutex);    \
                (pin) = 0;                      \
        } while (0)
 
-#define ao_spi_put_bit(reg,bit,pin,bus) do {   \
+#define ao_spi_put_bit(reg,bit,bus) do {       \
                (pin) = 1;                      \
                ao_mutex_put(&ao_spi_mutex);    \
        } while (0)
@@ -46,7 +46,7 @@ extern __xdata uint8_t        ao_spi_mutex;
 #define ao_gpio_token_paster(x,y)              x ## y
 #define ao_gpio_token_evaluator(x,y)   ao_gpio_token_paster(x,y)
 
-#define ao_gpio_set(port, bit, pin, v) do {                            \
+#define ao_gpio_set(port, bit, v) do {                         \
                if (v)                                                  \
                        (ao_gpio_token_evaluator(PORT,port)) |= (1 << bit); \
                else                                                    \
@@ -59,17 +59,17 @@ extern __xdata uint8_t      ao_spi_mutex;
  * from chip select low to chip select high
  */
 
-#define ao_enable_output(port, bit, pin, v) do {                       \
-               ao_gpio_set(port, bit, pin, v);                         \
+#define ao_enable_output(port, bit, v) do {                    \
+               ao_gpio_set(port, bit, v);                              \
                ao_gpio_token_evaluator(DDR,port) |= (1 << bit);        \
        } while (0)
 
 
 void
-ao_spi_send_bus(void __xdata *block, uint16_t len) __reentrant;
+ao_spi_send_bus(void *block, uint16_t len);
 
 void
-ao_spi_recv_bus(void __xdata *block, uint16_t len) __reentrant;
+ao_spi_recv_bus(void *block, uint16_t len);
 
 #define ao_spi_send(block, len, bus) ao_spi_send_bus(block, len)
 #define ao_spi_recv(block, len, bus) ao_spi_recv_bus(block, len)
index 2fdf177..84942cd 100644 (file)
 #include <ao_storage.h>
 
 /* Total bytes of available storage */
-__pdata ao_pos_t       ao_storage_total = 1024;
+ao_pos_t       ao_storage_total = 1024;
 
 /* Block size - device is erased in these units. */
-__pdata ao_pos_t       ao_storage_block = 1024;
+ao_pos_t       ao_storage_block = 1024;
 
 /* Byte offset of config block. Will be ao_storage_block bytes long */
-__pdata ao_pos_t       ao_storage_config = 0;
+ao_pos_t       ao_storage_config = 0;
 
 /* Storage unit size - device reads and writes must be within blocks of this size. */
-__pdata uint16_t       ao_storage_unit = 1024;
+uint16_t       ao_storage_unit = 1024;
 
 /*
  * The internal flash chip is arranged in 8 byte sectors; the
@@ -45,7 +45,7 @@ __pdata uint16_t      ao_storage_unit = 1024;
  * Erase the specified sector
  */
 uint8_t
-ao_storage_erase(ao_pos_t pos) __reentrant
+ao_storage_erase(ao_pos_t pos) 
 {
        /* Not necessary */
        return 1;
@@ -83,10 +83,10 @@ ao_intflash_read(uint16_t pos)
  */
 
 uint8_t
-ao_storage_device_write(ao_pos_t pos32, __xdata void *v, uint16_t len) __reentrant
+ao_storage_device_write(ao_pos_t pos32, void *v, uint16_t len) 
 {
        uint16_t pos = pos32;
-       __xdata uint8_t *d = v;
+       uint8_t *d = v;
 
        if (pos >= ao_storage_total || pos + len > ao_storage_total)
                return 0;
@@ -101,7 +101,7 @@ ao_storage_device_write(ao_pos_t pos32, __xdata void *v, uint16_t len) __reentra
  * Read from flash
  */
 uint8_t
-ao_storage_device_read(ao_pos_t pos, __xdata void *v, uint16_t len) __reentrant
+ao_storage_device_read(ao_pos_t pos, void *v, uint16_t len) 
 {
        uint8_t *d = v;
        
@@ -113,7 +113,7 @@ ao_storage_device_read(ao_pos_t pos, __xdata void *v, uint16_t len) __reentrant
 }
 
 void
-ao_storage_flush(void) __reentrant
+ao_storage_flush(void) 
 {
 }
 
@@ -123,7 +123,7 @@ ao_storage_setup(void)
 }
 
 void
-ao_storage_device_info(void) __reentrant
+ao_storage_device_info(void) 
 {
        printf ("Using internal flash\n");
 }
index c95548d..67bee33 100644 (file)
@@ -22,7 +22,7 @@
  * Atmega32u4 TWI master mode (I2C)
  */
 
-__xdata uint8_t        ao_i2c_mutex;
+uint8_t        ao_i2c_mutex;
 
 /* Send bytes over I2C.
  *
@@ -30,7 +30,7 @@ __xdata uint8_t       ao_i2c_mutex;
  * so using interrupts would take way too long
  */
 void
-ao_i2c_send(void __xdata *block, uint16_t len) __reentrant
+ao_i2c_send(void *block, uint16_t len) 
 {
        uint8_t *d = block;
 
@@ -51,7 +51,7 @@ ao_i2c_send(void __xdata *block, uint16_t len) __reentrant
  * clocks the data coming in.
  */
 void
-ao_i2c_recv(void __xdata *block, uint16_t len) __reentrant
+ao_i2c_recv(void *block, uint16_t len) 
 {
        uint8_t *d = block;
 
diff --git a/src/avr/ao_led.c b/src/avr/ao_led.c
deleted file mode 100644 (file)
index 8eba489..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-__pdata uint8_t ao_led_enable;
-
-#define LED_PORT       PORTB
-#define LED_DDR                DDRB
-
-void
-ao_led_on(uint8_t colors)
-{
-       LED_PORT |= (colors & ao_led_enable);
-}
-
-void
-ao_led_off(uint8_t colors)
-{
-       LED_PORT &= ~(colors & ao_led_enable);
-}
-
-void
-ao_led_set(uint8_t colors)
-{
-       LED_PORT = (LED_PORT & ~(ao_led_enable)) | (colors & ao_led_enable);
-}
-
-void
-ao_led_toggle(uint8_t colors)
-{
-       LED_PORT ^= (colors & ao_led_enable);
-}
-
-void
-ao_led_for(uint8_t colors, uint16_t ticks) __reentrant
-{
-       ao_led_on(colors);
-       ao_delay(ticks);
-       ao_led_off(colors);
-}
-
-void
-ao_led_init(uint8_t enable)
-{
-       ao_led_enable = enable;
-       if ((LED_DDR & enable)) {
-               printf ("oops! restarted\n");
-               ao_panic(AO_PANIC_REBOOT);
-       }
-       LED_PORT &= ~enable;
-       LED_DDR |= enable;
-}
diff --git a/src/avr/ao_led_avr.c b/src/avr/ao_led_avr.c
new file mode 100644 (file)
index 0000000..165e95d
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright © 2009 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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"
+
+uint8_t ao_led_enable;
+
+#define LED_PORT       PORTB
+#define LED_DDR                DDRB
+
+void
+ao_led_on(uint8_t colors)
+{
+       LED_PORT |= (colors & ao_led_enable);
+}
+
+void
+ao_led_off(uint8_t colors)
+{
+       LED_PORT &= ~(colors & ao_led_enable);
+}
+
+void
+ao_led_set(uint8_t colors)
+{
+       LED_PORT = (LED_PORT & ~(ao_led_enable)) | (colors & ao_led_enable);
+}
+
+void
+ao_led_toggle(uint8_t colors)
+{
+       LED_PORT ^= (colors & ao_led_enable);
+}
+
+void
+ao_led_for(uint8_t colors, uint16_t ticks) 
+{
+       ao_led_on(colors);
+       ao_delay(ticks);
+       ao_led_off(colors);
+}
+
+void
+ao_led_init(uint8_t enable)
+{
+       ao_led_enable = enable;
+       if ((LED_DDR & enable)) {
+               printf ("oops! restarted\n");
+               ao_panic(AO_PANIC_REBOOT);
+       }
+       LED_PORT &= ~enable;
+       LED_DDR |= enable;
+}
index 5eb392a..2d83380 100644 (file)
@@ -26,8 +26,8 @@
  * project payload developed at Challenger Middle School.  
  */
 
-volatile __data uint16_t ao_icp3_count = 0;
-volatile __data uint16_t ao_icp3_last = 0;
+volatile uint16_t ao_icp3_count = 0;
+volatile uint16_t ao_icp3_last = 0;
 
 uint16_t ao_icp3(void)
 {
@@ -39,7 +39,7 @@ uint16_t ao_icp3(void)
 }
 
 static void
-ao_pwmin_display(void) __reentrant
+ao_pwmin_display(void) 
 {
        /* display the most recent value */
        printf("icp 3: %5u\n", ao_icp3());
@@ -62,7 +62,7 @@ ISR(TIMER3_CAPT_vect)
        ao_icp3_last = ao_icp3_this;
 }
 
-__code struct ao_cmds ao_pwmin_cmds[] = {
+const struct ao_cmds ao_pwmin_cmds[] = {
        { ao_pwmin_display,     "p\0PWM input" },
        { 0, NULL },
 };
index 43c12f5..fcb5e26 100644 (file)
@@ -18,4 +18,4 @@
 
 void ao_pwmin_init(void);
 
-extern volatile __data uint16_t ao_icp3_count;
+extern volatile uint16_t ao_icp3_count;
diff --git a/src/avr/ao_romconfig.c b/src/avr/ao_romconfig.c
deleted file mode 100644 (file)
index 4acfc1c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-AO_ROMCONFIG_SYMBOL (0) uint16_t ao_serial_number = 0;
index ab82b7b..cfdd7df 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "ao.h"
 
-__xdata struct ao_fifo ao_serial1_rx_fifo;
-__xdata struct ao_fifo ao_serial1_tx_fifo;
+struct ao_fifo ao_serial1_rx_fifo;
+struct ao_fifo ao_serial1_tx_fifo;
 
 void
 ao_debug_out(char c)
@@ -40,7 +40,7 @@ ISR(USART1_RX_vect)
 #endif
 }
 
-static __xdata uint8_t ao_serial_tx1_started;
+static uint8_t ao_serial_tx1_started;
 
 static void
 ao_serial1_tx_start(void)
@@ -75,7 +75,7 @@ _ao_serial1_pollchar(void)
 #endif
 
 char
-ao_serial1_getchar(void) __critical
+ao_serial1_getchar(void) 
 {
        char    c;
 
@@ -99,7 +99,7 @@ ao_serial1_putchar(char c)
 }
 
 void
-ao_serial1_drain(void) __critical
+ao_serial1_drain(void) 
 {
        ao_arch_block_interrupts();
        while (!ao_fifo_empty(ao_serial1_tx_fifo))
index 0d509cb..6c30b02 100644 (file)
@@ -22,7 +22,7 @@
  * Atmega32u4 USART in MSPIM (master SPI mode)
  */
 
-__xdata uint8_t        ao_spi_mutex;
+uint8_t        ao_spi_mutex;
 
 /* Send bytes over SPI.
  *
@@ -30,7 +30,7 @@ __xdata uint8_t       ao_spi_mutex;
  * so using interrupts would take way too long
  */
 void
-ao_spi_send_bus(void __xdata *block, uint16_t len) __reentrant
+ao_spi_send_bus(void *block, uint16_t len) 
 {
        uint8_t *d = block;
 
@@ -47,7 +47,7 @@ ao_spi_send_bus(void __xdata *block, uint16_t len) __reentrant
  * Poll, sending zeros and reading data back
  */
 void
-ao_spi_recv_bus(void __xdata *block, uint16_t len) __reentrant
+ao_spi_recv_bus(void *block, uint16_t len) 
 {
        uint8_t *d = block;
 
index 2eaa8b6..ff6a829 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "ao.h"
 
-volatile __data uint16_t ao_tick_count;
+volatile uint16_t ao_tick_count;
 
 uint16_t ao_time(void)
 {
@@ -33,8 +33,8 @@ uint16_t ao_time(void)
 #define T1_SAMPLE_TIME         30000   /* 3e6/30000 = 100 */
 
 #if HAS_ADC
-volatile __data uint8_t        ao_adc_interval = 1;
-volatile __data uint8_t        ao_adc_count;
+volatile uint8_t       ao_adc_interval = 1;
+volatile uint8_t       ao_adc_count;
 #endif
 
 void
@@ -53,7 +53,7 @@ ISR(TIMER1_COMPA_vect)
 
 #if HAS_ADC
 void
-ao_timer_set_adc_interval(uint8_t interval) __critical
+ao_timer_set_adc_interval(uint8_t interval) 
 {
        ao_adc_interval = interval;
        ao_adc_count = 0;
index 41d3c1b..df80099 100644 (file)
@@ -27,7 +27,7 @@
 #define debug(format, args...)
 #endif
 
-struct ao_task __xdata ao_usb_task;
+struct ao_task ao_usb_task;
 
 struct ao_usb_setup {
        uint8_t         dir_type_recip;
@@ -35,21 +35,21 @@ struct ao_usb_setup {
        uint16_t        value;
        uint16_t        index;
        uint16_t        length;
-} __xdata ao_usb_setup;
-
-static __xdata uint8_t         ao_usb_ep0_state;
-static const uint8_t * __xdata ao_usb_ep0_in_data;
-static __xdata uint8_t         ao_usb_ep0_in_len;
-static __xdata uint8_t ao_usb_ep0_in_pending;
-static __xdata uint8_t ao_usb_addr_pending;
-static __xdata uint8_t ao_usb_ep0_in_buf[2];
-static __xdata uint8_t         ao_usb_ep0_out_len;
-static __xdata uint8_t *__xdata ao_usb_ep0_out_data;
-
-static __xdata uint8_t ao_usb_in_flushed;
-__xdata uint8_t                ao_usb_running;
-static __xdata uint8_t ao_usb_configuration;
-static __xdata uint8_t ueienx_0;
+} ao_usb_setup;
+
+static uint8_t         ao_usb_ep0_state;
+static const uint8_t * ao_usb_ep0_in_data;
+static uint8_t         ao_usb_ep0_in_len;
+static uint8_t ao_usb_ep0_in_pending;
+static uint8_t ao_usb_addr_pending;
+static uint8_t ao_usb_ep0_in_buf[2];
+static uint8_t         ao_usb_ep0_out_len;
+static uint8_t *ao_usb_ep0_out_data;
+
+static uint8_t ao_usb_in_flushed;
+uint8_t                ao_usb_running;
+static uint8_t ao_usb_configuration;
+static uint8_t ueienx_0;
 
 void
 ao_usb_set_address(uint8_t address)
@@ -143,9 +143,9 @@ struct ao_usb_line_coding ao_usb_line_coding = {115200, 0, 0, 8};
 static void
 ao_usb_get_descriptor(uint16_t value)
 {
-       const uint8_t           *__xdata descriptor;
-       __xdata uint8_t         type = value >> 8;
-       __xdata uint8_t         index = value;
+       const uint8_t           *descriptor;
+       uint8_t         type = value >> 8;
+       uint8_t         index = value;
 
        descriptor = ao_usb_descriptors;
        while (descriptor[0] != 0) {
@@ -174,7 +174,7 @@ ao_usb_ep0_set_in_pending(uint8_t in_pending)
 static void
 ao_usb_ep0_flush(void)
 {
-       __xdata uint8_t this_len;
+       uint8_t this_len;
 
        cli();
        UENUM = 0;
@@ -242,7 +242,7 @@ static void
 ao_usb_ep0_setup(void)
 {
        /* Pull the setup packet out of the fifo */
-       ao_usb_ep0_out_data = (__xdata uint8_t *) &ao_usb_setup;
+       ao_usb_ep0_out_data = (uint8_t *) &ao_usb_setup;
        ao_usb_ep0_out_len = 8;
        ao_usb_ep0_fill(8, (1 << RXSTPI) | (1 << RXOUTI) | (1 << TXINI));
        if (ao_usb_ep0_out_len != 0) {
@@ -334,7 +334,7 @@ ao_usb_ep0_setup(void)
                case AO_USB_SET_LINE_CODING:
                        debug ("set line coding\n");
                        ao_usb_ep0_out_len = 7;
-                       ao_usb_ep0_out_data = (__xdata uint8_t *) &ao_usb_line_coding;
+                       ao_usb_ep0_out_data = (uint8_t *) &ao_usb_line_coding;
                        break;
                case AO_USB_GET_LINE_CODING:
                        debug ("get line coding\n");
@@ -636,7 +636,7 @@ ao_usb_enable(void)
 }
 
 #if USB_DEBUG
-struct ao_task __xdata ao_usb_echo_task;
+struct ao_task ao_usb_echo_task;
 
 static void
 ao_usb_echo(void)
diff --git a/src/cc1111/Makefile.cc1111 b/src/cc1111/Makefile.cc1111
deleted file mode 100644 (file)
index cb2d3db..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-include ../Makedefs
-CC=$(SDCC)
-
-CFLAGS=--model-small --debug --opt-code-speed -DCODESIZE=$(CODESIZE) -DCC1111
-
-CFLAGS += $(PRODUCT_DEF) -I. -I.. -I../kernel -I../cc1111 -I../drivers -I../product
-
-CODESIZE ?= 0x8000
-
-LDFLAGS=--out-fmt-ihx --code-loc 0x0000 --code-size $(CODESIZE) \
-       --xram-loc 0xf000 --xram-size 0xda2 --iram-size 0xff
-
-REL=$(SRC:.c=.rel) ao_product.rel
-ADB=$(REL:.rel=.adb)
-ASM=$(REL:.rel=.asm)
-LNK=$(REL:.rel=.lnk)
-LST=$(REL:.rel=.lst)
-RST=$(REL:.rel=.rst)
-SYM=$(REL:.rel=.sym)
-
-PCDB=$(PROG:.ihx=.cdb)
-PLNK=$(PROG:.ihx=.lnk)
-PMAP=$(PROG:.ihx=.map)
-PMEM=$(PROG:.ihx=.mem)
-PAOM=$(PROG:.ihx=)
-
-%.rel : %.c $(INC)
-       $(call quiet,CC,$(PRODUCT_DEF)) $(CFLAGS) -c -o$@ $<
-
-all:
-
-clean-cc1111:
-       rm -f *.adb *.asm *.lnk *.lst *.rel *.rst *.sym
-       rm -f $(PROGNAME)-*
-       rm -f ao_product.h
-       rm -f ../$(PROGNAME)-*
-
-../ao_kalman.h:
-       +(cd .. && make ao_kalman.h)
diff --git a/src/cc1111/_bp.c b/src/cc1111/_bp.c
deleted file mode 100644 (file)
index 6bf135b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*-------------------------------------------------------------------------
-
-  _bp.c :- just declares bp as a variable
-
-             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
-
-   This library is free software; you can redistribute it and/or modify it
-   under the terms of the GNU Library General Public License as published by the
-   Free Software Foundation; either version 2, or (at your option) any
-   later version.
-
-   This library 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 Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-   In other words, you are welcome to use, share and improve this program.
-   You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!
--------------------------------------------------------------------------*/
-
-__data unsigned char bp ;
diff --git a/src/cc1111/ao_adc.c b/src/cc1111/ao_adc.c
deleted file mode 100644 (file)
index 94af5cd..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-volatile __xdata struct ao_data        ao_data_ring[AO_DATA_RING];
-volatile __data uint8_t                ao_data_head;
-#if (AO_DATA_ALL & ~(AO_DATA_ADC))
-volatile __data uint8_t                ao_data_present;
-#endif
-
-#ifdef TELENANO_V_0_1
-# define AO_ADC_FIRST_PIN      1
-#endif
-
-#if HAS_ACCEL_REF
-# define AO_ADC_FIRST_PIN      2
-#endif
-
-#ifndef AO_ADC_FIRST_PIN
-# define AO_ADC_FIRST_PIN      0
-#endif
-
-void
-ao_adc_poll(void)
-{
-       ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | AO_ADC_FIRST_PIN;
-}
-
-void
-ao_data_get(__xdata struct ao_data *packet)
-{
-#if HAS_FLIGHT
-       uint8_t i = ao_data_ring_prev(ao_sample_data);
-#else
-       uint8_t i = ao_data_ring_prev(ao_data_head);
-#endif
-       ao_xmemcpy(packet, (void __xdata *) &ao_data_ring[i], sizeof (struct ao_data));
-}
-
-void
-ao_adc_isr(void) __interrupt 1
-{
-       uint8_t sequence;
-       uint8_t __xdata *a;
-
-       sequence = (ADCCON2 & ADCCON2_SCH_MASK) >> ADCCON2_SCH_SHIFT;
-#if TELEMETRUM_V_0_1 || TELEMETRUM_V_0_2 || TELEMETRUM_V_1_0 || TELEMETRUM_V_1_1 || TELEMETRUM_V_1_2 || TELELAUNCH_V_0_1 || TELEBALLOON_V_1_1
-       /* TeleMetrum readings */
-#if HAS_ACCEL_REF
-       if (sequence == 2) {
-               a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.accel_ref);
-               sequence = 0;
-       } else
-#endif
-       {
-               if (sequence == ADCCON3_ECH_TEMP)
-                       sequence = 2;
-               a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.accel + sequence);
-               sequence++;
-       }
-#define GOT_ADC
-       a[0] = ADCL;
-       a[1] = ADCH;
-       if (sequence < 6) {
-#if HAS_EXTERNAL_TEMP == 0
-               /* start next channel conversion */
-               /* v0.2 replaces external temp sensor with internal one */
-               if (sequence == 2)
-                       ADCCON3 = ADCCON3_EREF_1_25 | ADCCON3_EDIV_512 | ADCCON3_ECH_TEMP;
-               else
-#endif
-                       ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | sequence;
-               return;
-       }
-#endif
-
-#if TELEMINI_V_1_0 || TELENANO_V_0_1
-       /* TeleMini readings */
-       a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.pres);
-#if TELEMINI_V_1_0
-       switch (sequence) {
-       case 0:
-               /* pressure */
-               a += 0;
-               sequence = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | 1;
-               break;
-       case 1:
-               /* drogue sense */
-               a += 6;
-               sequence = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | 2;
-               break;
-       case 2:
-               /* main sense */
-               a += 8;
-               sequence = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | 3;
-               break;
-       case 3:
-               /* battery */
-               a += 4;
-               sequence = ADCCON3_EREF_1_25 | ADCCON3_EDIV_512 | ADCCON3_ECH_TEMP;
-               break;
-       case ADCCON3_ECH_TEMP:
-               a += 2;
-               sequence = 0;
-               break;
-       }
-#define GOT_ADC
-#endif
-#ifdef TELENANO_V_0_1
-       switch (sequence) {
-       case 1:
-               /* pressure */
-               a += 0;
-               sequence = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | 3;
-               break;
-       case 3:
-               /* battery */
-               a += 4;
-               sequence = ADCCON3_EREF_1_25 | ADCCON3_EDIV_512 | ADCCON3_ECH_TEMP;
-               break;
-       case ADCCON3_ECH_TEMP:
-               a += 2;
-               sequence = 0;
-               break;
-       }
-#define GOT_ADC
-#endif
-       a[0] = ADCL;
-       a[1] = ADCH;
-       if (sequence) {
-               /* Start next conversion */
-               ADCCON3 = sequence;
-               return;
-       }
-#endif /* telemini || telenano */
-
-#if defined(TELEFIRE_V_0_1) || defined(TELEFIRE_V_0_2)
-       a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.sense[0] + sequence - AO_ADC_FIRST_PIN);
-       a[0] = ADCL;
-       a[1] = ADCH;
-       if (sequence < 5) {
-               ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | (sequence + 1);
-               return;
-       }
-#define GOT_ADC
-#endif /* TELEFIRE_V_0_1 */
-
-#ifdef TELEBT_V_1_0
-       a = (uint8_t __xdata *) (&ao_data_ring[ao_data_head].adc.batt);
-       a[0] = ADCL;
-       a[1] = ADCH;
-#define GOT_ADC
-#endif 
-
-#ifdef FETCH_ADC
-       FETCH_ADC();
-#define GOT_ADC
-#endif
-
-#ifndef GOT_ADC
-#error No known ADC configuration set
-#endif
-
-       /* record this conversion series */
-       ao_data_ring[ao_data_head].tick = ao_time();
-       ao_data_head = ao_data_ring_next(ao_data_head);
-       ao_wakeup(DATA_TO_XDATA(&ao_data_head));
-}
-
-static void
-ao_adc_dump(void) __reentrant
-{
-       static __xdata struct ao_data   packet;
-       ao_data_get(&packet);
-#ifndef AO_ADC_DUMP
-       printf("tick: %5u accel: %5d pres: %5d temp: %5d batt: %5d drogue: %5d main: %5d\n",
-              packet.tick, packet.adc.accel, packet.adc.pres, packet.adc.temp,
-              packet.adc.v_batt, packet.adc.sense_d, packet.adc.sense_m);
-#else
-       AO_ADC_DUMP(&packet);
-#endif
-}
-
-__code struct ao_cmds ao_adc_cmds[] = {
-       { ao_adc_dump,  "a\0Current ADC" },
-       { 0, NULL },
-};
-
-void
-ao_adc_init(void)
-{
-#ifdef AO_ADC_PINS
-       ADCCFG = AO_ADC_PINS;
-
-#else
-
-#if IGNITE_ON_P2
-       /* TeleMetrum configuration */
-       ADCCFG = ((1 << 0) |    /* acceleration */
-                 (1 << 1) |    /* pressure */
-#if HAS_EXTERNAL_TEMP
-                 (1 << 2) |    /* v0.1 temperature */
-#endif
-                 (1 << 3) |    /* battery voltage */
-                 (1 << 4) |    /* drogue sense */
-                 (1 << 5));    /* main sense */
-#endif
-
-#if IGNITE_ON_P0
-       /* TeleMini configuration */
-       ADCCFG = ((1 << 0) |    /* pressure */
-                 (1 << 1) |    /* drogue sense */
-                 (1 << 2) |    /* main sense */
-                 (1 << 3));    /* battery voltage */
-#endif
-
-#endif /* else AO_ADC_PINS */
-
-       /* enable interrupts */
-       ADCIF = 0;
-       IEN0 |= IEN0_ADCIE;
-       ao_cmd_register(&ao_adc_cmds[0]);
-}
diff --git a/src/cc1111/ao_aes.c b/src/cc1111/ao_aes.c
deleted file mode 100644 (file)
index e845a92..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-#if !HAS_AES
-#error Must define HAS_AES 1
-#endif
-
-__xdata uint8_t ao_aes_mutex;
-__xdata uint8_t        ao_aes_done;
-__xdata uint8_t        ao_aes_dma_in, ao_aes_dma_out;
-__xdata uint8_t ao_aes_dma_in_done, ao_aes_dma_out_done;
-__pdata enum ao_aes_mode ao_aes_current_mode;
-
-void
-ao_aes_isr(void) __interrupt 4
-{
-       S0CON = 0;
-       if (ENCCCS & ENCCCS_RDY) {
-               ao_aes_done = 1;
-               ao_wakeup(&ao_aes_done);
-       }
-}
-
-void
-ao_aes_set_mode(enum ao_aes_mode mode)
-{
-       ao_aes_current_mode = mode;
-}
-
-void
-ao_aes_set_key(__xdata uint8_t *in)
-{
-       ao_dma_set_transfer(ao_aes_dma_in,
-                           in,
-                           &ENCDIXADDR,
-                           AO_AES_LEN,
-                           DMA_CFG0_WORDSIZE_8 |
-                           DMA_CFG0_TMODE_SINGLE |
-                           DMA_CFG0_TRIGGER_ENC_DW,
-                           DMA_CFG1_SRCINC_1 |
-                           DMA_CFG1_DESTINC_0 |
-                           DMA_CFG1_PRIORITY_LOW);
-       ao_dma_start(ao_aes_dma_in);
-       ao_aes_done = 0;
-       ENCCCS = ENCCCS_MODE_CBC_MAC |
-               ENCCCS_CMD_LOAD_KEY;
-       ENCCCS |= ENCCCS_START;
-       __critical while (!ao_aes_done)
-               ao_sleep(&ao_aes_done);
-}
-
-void
-ao_aes_zero_iv(void)
-{
-       uint8_t b;
-
-       ENCCCS = ENCCCS_MODE_CBC_MAC | ENCCCS_CMD_LOAD_IV | ENCCCS_START;
-       for (b = 0; b < AO_AES_LEN; b++)
-               ENCDI = 0;
-}
-
-void
-ao_aes_run(__xdata uint8_t *in,
-          __xdata uint8_t *out)
-{
-       uint8_t b;
-       if (in) {
-               ao_dma_set_transfer(ao_aes_dma_in,
-                                   in,
-                                   &ENCDIXADDR,
-                                   AO_AES_LEN,
-                                   DMA_CFG0_WORDSIZE_8 |
-                                   DMA_CFG0_TMODE_SINGLE |
-                                   DMA_CFG0_TRIGGER_ENC_DW,
-                                   DMA_CFG1_SRCINC_1 |
-                                   DMA_CFG1_DESTINC_0 |
-                                   DMA_CFG1_PRIORITY_LOW);
-       }
-       if (out) {
-               ao_dma_set_transfer(ao_aes_dma_out,
-                                   &ENCDOXADDR,
-                                   out,
-                                   AO_AES_LEN,
-                                   DMA_CFG0_WORDSIZE_8 |
-                                   DMA_CFG0_TMODE_SINGLE |
-                                   DMA_CFG0_TRIGGER_ENC_UP,
-                                   DMA_CFG1_SRCINC_0 |
-                                   DMA_CFG1_DESTINC_1 |
-                                   DMA_CFG1_PRIORITY_LOW);
-       }
-       switch (ao_aes_current_mode) {
-       case ao_aes_mode_cbc_mac:
-               if (out)
-                       b = (ENCCCS_MODE_CBC |
-                            ENCCCS_CMD_ENCRYPT);
-               else
-                       b = (ENCCCS_MODE_CBC_MAC |
-                            ENCCCS_CMD_ENCRYPT);
-               break;
-       default:
-               return;
-       }
-       ao_aes_done = 0;
-       if (in)
-               ao_dma_start(ao_aes_dma_in);
-       if (out)
-               ao_dma_start(ao_aes_dma_out);
-       ENCCCS = b;
-       ENCCCS |= ENCCCS_START;
-       if (out) {
-               __critical while (!ao_aes_dma_out_done)
-                       ao_sleep(&ao_aes_dma_out_done);
-       } else {
-               __critical while (!ao_aes_done)
-                       ao_sleep(&ao_aes_done);
-       }
-}
-
-void
-ao_aes_init(void)
-{
-#if DMA_SHARE_AES_RADIO
-       ao_aes_dma_in = ao_radio_dma;
-#else
-       ao_aes_dma_in = ao_dma_alloc(&ao_aes_dma_in_done);
-#endif
-       ao_aes_dma_out = ao_dma_alloc(&ao_aes_dma_out_done);
-       S0CON = 0;
-       ENCIE = 1;
-}
diff --git a/src/cc1111/ao_arch.h b/src/cc1111/ao_arch.h
deleted file mode 100644 (file)
index 937e6d0..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- */
-
-/*
- * CC1111 definitions and code fragments for AltOS
- */
-
-#ifndef _AO_ARCH_H_
-#define _AO_ARCH_H_
-
-#include "cc1111.h"
-
-/* Convert a __data pointer into an __xdata pointer */
-#define DATA_TO_XDATA(a)       ((void __xdata *) ((uint8_t) (a) | 0xff00))
-
-/* Code and xdata use the same address space */
-#define CODE_TO_XDATA(a)       ((__xdata void *) ((uint16_t) (a)))
-
-/* Pdata lives at the start of xdata */
-#define PDATA_TO_XDATA(a)      ((void __xdata *) ((uint8_t) (a) | 0xf000))
-
-/* 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_PORT_TYPE   uint8_t
-
-#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
-
-#define AO_ROMCONFIG_SYMBOL(a) __code __at(a)
-
-extern AO_ROMCONFIG_SYMBOL(0x00a0) uint16_t ao_romconfig_version;
-extern AO_ROMCONFIG_SYMBOL(0x00a2) uint16_t ao_romconfig_check;
-extern AO_ROMCONFIG_SYMBOL(0x00a4) uint16_t ao_serial_number;
-extern AO_ROMCONFIG_SYMBOL(0x00a6) uint32_t ao_radio_cal;
-
-#ifndef HAS_USB
-#error Please define HAS_USB
-#endif
-
-#define ao_arch_task_members\
-       uint8_t stack_count;            /* amount of saved stack */
-
-/* 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_regs()                                            \
-       __asm                                                           \
-       /* Push ACC first, as when restoring the context it must be restored \
-        * last (it is used to set the IE register). */                 \
-       push    ACC                                                     \
-       push    _IEN0                                                   \
-       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
-
-#define ao_arch_save_stack() {                                                 \
-               uint8_t stack_len;                                      \
-               __data uint8_t *stack_ptr;                              \
-               __xdata uint8_t *save_ptr;                              \
-               /* Save the current stack */                            \
-               stack_len = SP - (AO_STACK_START - 1);                  \
-               ao_cur_task->stack_count = stack_len;                   \
-               stack_ptr = (uint8_t __data *) AO_STACK_START;          \
-               save_ptr = (uint8_t __xdata *) ao_cur_task->stack;      \
-               do                                                      \
-                       *save_ptr++ = *stack_ptr++;                     \
-               while (--stack_len);                                    \
-       }
-
-/* Empty the stack; might as well let interrupts have the whole thing */
-#define ao_arch_isr_stack()            (SP = AO_STACK_START - 1)
-
-#define ao_arch_block_interrupts()     __asm clr _EA __endasm
-#define ao_arch_release_interrupts()   __asm setb _EA __endasm
-
-/* Idle the CPU, waking when an interrupt occurs */
-#define ao_arch_wait_interrupt() do {          \
-               ao_arch_release_interrupts();   \
-               (PCON = PCON_IDLE);             \
-               ao_arch_block_interrupts();     \
-       } while (0)
-
-#define ao_arch_restore_stack() {                                      \
-               uint8_t stack_len;                                      \
-               __data uint8_t *stack_ptr;                              \
-               __xdata uint8_t *save_ptr;                              \
-                                                                       \
-               /* Restore the old stack */                             \
-               stack_len = ao_cur_task->stack_count;                   \
-               SP = AO_STACK_START - 1 + stack_len;                    \
-                                                                       \
-               stack_ptr = (uint8_t __data *) AO_STACK_START;          \
-               save_ptr = (uint8_t __xdata *) ao_cur_task->stack;      \
-               do                                                      \
-                       *stack_ptr++ = *save_ptr++;                     \
-               while (--stack_len);                                    \
-                                                                       \
-               __asm                                                   \
-               pop             _bp                                     \
-               pop             PSW                                     \
-               pop             ar1                                     \
-               pop             ar0                                     \
-               pop             ar7                                     \
-               pop             ar6                                     \
-               pop             ar5                                     \
-               pop             ar4                                     \
-               pop             ar3                                     \
-               pop             ar2                                     \
-               pop             b                                       \
-               pop             DPH                                     \
-               pop             DPL                                     \
-               /* The next byte of the stack is the IE register.  Only the global \
-                  enable bit forms part of the task context.  Pop off the IE then set \
-                  the global enable bit to match that of the stored IE register. */ \
-               pop             ACC                                     \
-               JB              ACC.7,0098$                             \
-               CLR             _EA                                     \
-               LJMP    0099$                                           \
-               0098$:                                                  \
-                       SETB            _EA                             \
-               0099$:                                                  \
-               /* Finally restore ACC, which was the first register saved. */ \
-               pop             ACC                                     \
-               ret                                                     \
-               __endasm;                                               \
-}
-
-#define ao_arch_critical(b) __critical { b }
-
-#define AO_DATA_RING   32
-
-/* ao_button.c */
-#ifdef HAS_BUTTON
-void
-ao_p0_isr(void) ao_arch_interrupt(13);
-
-void
-ao_p1_isr(void) ao_arch_interrupt(15);
-
-void
-ao_p2_isr(void);
-
-#define HAS_P2_ISR     1
-
-#endif
-
-void
-ao_button_init(void);
-
-char
-ao_button_get(uint16_t timeout) __critical;
-
-void
-ao_button_clear(void) __critical;
-
-/* console I/O funcs */
-#define ao_getchar getchar
-#define ao_putchar putchar
-
-/* ao_string.c */
-
-void
-_ao_xmemcpy(__xdata void *dst, __xdata void *src, uint16_t count);
-
-#define ao_xmemcpy(d,s,c) _ao_xmemcpy(d,s,c)
-
-void
-_ao_xmemset(__xdata void *dst, uint8_t value, uint16_t count);
-
-#define ao_xmemset(d,v,c) _ao_xmemset(d,v,c)
-
-int8_t
-_ao_xmemcmp(__xdata void *a, __xdata void *b, uint16_t count);
-
-#define ao_xmemcmp(d,s,c) _ao_xmemcmp((d), (s), (c))
-
-struct ao_serial_speed {
-       uint8_t baud;
-       uint8_t gcr;
-};
-
-extern const __code struct ao_serial_speed ao_serial_speeds[];
-
-/*
- * ao_dma.c
- */
-
-/* Allocate a DMA channel. the 'done' parameter will be set when the
- * dma is finished and will be used to wakeup any waiters
- */
-
-uint8_t
-ao_dma_alloc(__xdata uint8_t * done);
-
-/* Setup a DMA channel */
-void
-ao_dma_set_transfer(uint8_t id,
-                   void __xdata *srcaddr,
-                   void __xdata *dstaddr,
-                   uint16_t count,
-                   uint8_t cfg0,
-                   uint8_t cfg1);
-
-/* Start a DMA channel */
-void
-ao_dma_start(uint8_t id);
-
-/* Manually trigger a DMA channel */
-void
-ao_dma_trigger(uint8_t id);
-
-/* Abort a running DMA transfer */
-void
-ao_dma_abort(uint8_t id);
-
-/* DMA interrupt routine */
-void
-ao_dma_isr(void) ao_arch_interrupt(8);
-
-/* ao_adc.c */
-
-#if HAS_ADC
-/* The A/D interrupt handler */
-void
-ao_adc_isr(void) ao_arch_interrupt(1);
-#endif
-
-#if HAS_USB
-/* USB interrupt handler */
-void
-ao_usb_isr(void) ao_arch_interrupt(6);
-#endif
-
-#if HAS_SERIAL_0
-void
-ao_serial0_rx_isr(void) ao_arch_interrupt(2);
-
-void
-ao_serial0_tx_isr(void) ao_arch_interrupt(7);
-#endif
-
-#if HAS_SERIAL_1
-void
-ao_serial1_rx_isr(void) ao_arch_interrupt(3);
-
-void
-ao_serial1_tx_isr(void) ao_arch_interrupt(14);
-#endif
-
-#if HAS_EXTI_0
-void
-ao_p0_isr(void) __interrupt(13);
-#endif
-
-#define AO_ADC_MAX     32767
-
-#endif /* _AO_ARCH_H_ */
diff --git a/src/cc1111/ao_arch_funcs.h b/src/cc1111/ao_arch_funcs.h
deleted file mode 100644 (file)
index d849655..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright © 2012 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- */
-
-/*
- * ao_spi.c
- */
-
-#if !HAS_SPI_0 && !HAS_SPI_1
-#define HAS_SPI_0      1
-#define SPI_0_ALT_2    1
-#endif
-
-#if HAS_SPI_0 && HAS_SPI_1
-#define MULTI_SPI      1
-#define N_SPI          2
-#else
-#define MULTI_SPI      0
-#define N_SPI          1
-#endif
-
-extern __xdata uint8_t ao_spi_mutex[N_SPI];
-
-#if MULTI_SPI
-#define ao_spi_get(bus)        ao_mutex_get(&ao_spi_mutex[bus])
-#define ao_spi_put(bus)        ao_mutex_put(&ao_spi_mutex[bus])
-#else
-#define ao_spi_get(bus)        ao_mutex_get(&ao_spi_mutex[0])
-#define ao_spi_put(bus)        ao_mutex_put(&ao_spi_mutex[0])
-#endif
-
-#define AO_SPI_SPEED_FAST      17
-#define AO_SPI_SPEED_200kHz    13
-
-#if MULTI_SPI
-#define ao_spi_set_speed(bus,speed) (*(bus ? &U1GCR : &U0GCR) =(UxGCR_CPOL_NEGATIVE | \
-                                                               UxGCR_CPHA_FIRST_EDGE | \
-                                                               UxGCR_ORDER_MSB | \
-                                                               ((speed) << UxGCR_BAUD_E_SHIFT)))
-#else
-#define ao_spi_set_speed(bus,speed) (U0GCR = (UxGCR_CPOL_NEGATIVE |    \
-                                             UxGCR_CPHA_FIRST_EDGE |   \
-                                             UxGCR_ORDER_MSB |         \
-                                             ((speed) << UxGCR_BAUD_E_SHIFT)))
-#endif
-
-#define ao_spi_get_slave(bus) do {                     \
-               ao_spi_get(bus);                        \
-               ao_spi_set_speed(bus,AO_SPI_SPEED_FAST);        \
-       } while (0)
-
-#define ao_spi_put_slave(bus) do {             \
-               ao_spi_put(bus);                \
-       } while (0)
-
-#define ao_spi_get_mask(reg,mask,bus,speed) do {       \
-               ao_spi_get(bus);                        \
-               ao_spi_set_speed(bus,speed);            \
-               (reg) &= ~(mask);                       \
-       } while (0)
-
-#define ao_spi_put_mask(reg,mask,bus) do {             \
-       (reg) |= (mask); \
-       ao_spi_put(bus); \
-       } while (0)
-
-
-#define ao_spi_get_bit(reg,bit,pin,bus,speed) do {     \
-               ao_spi_get(bus);                        \
-               ao_spi_set_speed(bus,speed);            \
-               pin = 0;                                \
-       } while (0)
-
-#define ao_spi_put_bit(reg,bit,pin,bus) do {   \
-               pin = 1;                        \
-               ao_spi_put(bus);                \
-       } while (0)
-
-
-/*
- * The SPI mutex must be held to call either of these
- * functions -- this mutex covers the entire SPI operation,
- * from chip select low to chip select high
- */
-
-#if MULTI_SPI
-void
-ao_spi_send(void __xdata *block, uint16_t len, uint8_t bus) __reentrant;
-
-void
-ao_spi_recv(void __xdata *block, uint16_t len, uint8_t bus) __reentrant;
-#else
-void
-ao_spi_send_bus(void __xdata *block, uint16_t len) __reentrant;
-
-void
-ao_spi_recv_bus(void __xdata *block, uint16_t len) __reentrant;
-
-#define ao_spi_send(block, len, bus) ao_spi_send_bus(block, len)
-#define ao_spi_recv(block, len, bus) ao_spi_recv_bus(block, len)
-#endif
-
-#if AO_SPI_SLAVE
-void
-ao_spi_send_wait(void);
-
-void
-ao_spi_recv_wait(void);
-#endif
-
-void
-ao_spi_init(void);
-
-#define token_paster(x,y)      x ## y
-#define token_paster3(x,y,z)   x ## y ## z
-#define token_evaluator(x,y)   token_paster(x,y)
-#define token_evaluator3(x,y,z)        token_paster3(x,y,z)
-
-#define ao_spi_init_cs(port, mask) do {                        \
-               port |= mask;                           \
-               token_evaluator(port,DIR) |= mask;      \
-               token_evaluator(port,SEL) &= ~mask;     \
-       } while (0)
-
-#define cc1111_enable_output(port,dir,sel,pin,bit,v) do {      \
-               pin = v;                                        \
-               dir |= (1 << bit);                              \
-               sel &= ~(1 << bit);                             \
-       } while (0)
-
-#define disable_unreachable    _Pragma("disable_warning 126")
-
-#define ao_enable_output(port,bit,pin,v) cc1111_enable_output(port,token_evaluator(port,DIR), token_evaluator(port,SEL), pin, bit, v)
-#define ao_gpio_set(port, bit, pin, v) ((pin) = (v))
-#define ao_gpio_get(port, bit, pin) (pin)
-#define ao_gpio_get_bits(port) (port)
-#define ao_gpio_set_bits(port, bits) ((port) |= bits)
-#define ao_gpio_clr_bits(port, bits) ((port) &= ~bits)
diff --git a/src/cc1111/ao_battery.c b/src/cc1111/ao_battery.c
deleted file mode 100644 (file)
index 9fb4c26..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-static __data union {
-       uint8_t d[2];
-       int16_t v;
-} ao_battery_value;
-
-void
-ao_battery_isr(void) ao_arch_interrupt(1)
-{
-       ao_battery_value.d[0] = ADCL;
-       ao_battery_value.d[1] = ADCH;
-       ao_wakeup(DATA_TO_XDATA(&ao_battery_value));
-}
-
-uint16_t
-ao_battery_get(void) 
-{
-       ao_arch_critical(
-               ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | BATTERY_PIN;
-               ao_sleep(DATA_TO_XDATA(&ao_battery_value));
-               );
-       return (uint16_t) ((int32_t) ao_battery_value.v * (int32_t) 4950 >> 15);
-}
-
-static void
-ao_battery_show(void)
-{
-       printf("Battery: %u mV\n", ao_battery_get());
-}
-
-__code struct ao_cmds ao_battery_cmds[] = {
-       { ao_battery_show,      "B\0Show battery voltage" },
-       { 0, NULL },
-};
-
-void
-ao_battery_init(void)
-{
-       ADCCFG = (1 << BATTERY_PIN);
-       ADCIF = 0;
-       IEN0 |= IEN0_ADCIE;
-       ao_cmd_register(&ao_battery_cmds[0]);
-}
diff --git a/src/cc1111/ao_beep.c b/src/cc1111/ao_beep.c
deleted file mode 100644 (file)
index 04d1048..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-void
-ao_beep(uint8_t beep)
-{
-       if (beep == 0) {
-               P2_0 = 0;
-               P2SEL = (P2SEL & ~P2SEL_SELP2_0_MASK) | P2SEL_SELP2_0_GPIO;
-               T4CTL = 0;
-       } else {
-               P2SEL = (P2SEL & ~P2SEL_SELP2_0_MASK) | P2SEL_SELP2_0_PERIPHERAL;
-               T4CC0 = beep;
-               T4CTL = TxCTL_DIV_32 | TxCTL_MODE_MODULO | TxCTL_START;
-       }
-}
-
-void
-ao_beep_for(uint8_t beep, uint16_t ticks) __reentrant
-{
-       ao_beep(beep);
-       ao_delay(ticks);
-       ao_beep(0);
-}
-
-void
-ao_beep_init(void)
-{
-       /* Our beeper is on P2_0, which is hooked to timer 4 using
-        * configuration alternative 2
-        */
-       P2_0 = 0;
-       P2SEL = (P2SEL & ~P2SEL_SELP2_0_MASK) | P2SEL_SELP2_0_GPIO;
-       PERCFG = (PERCFG & ~PERCFG_T4CFG_ALT_MASK) | PERCFG_T4CFG_ALT_2;
-       T4CCTL0 = TxCCTLy_CMP_TOGGLE|TxCCTLy_CMP_MODE_ENABLE;
-}
diff --git a/src/cc1111/ao_button.c b/src/cc1111/ao_button.c
deleted file mode 100644 (file)
index 0496a32..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-volatile __xdata struct ao_fifo ao_button_fifo;
-
-static __code struct {
-       uint8_t mask;
-       uint8_t reg;
-} ao_buttons[] = {
-#ifdef BUTTON_1_MASK
-       { BUTTON_1_MASK, BUTTON_1_REG },
-#endif
-#ifdef BUTTON_2_MASK
-       { BUTTON_2_MASK, BUTTON_2_REG },
-#endif
-#ifdef BUTTON_3_MASK
-       { BUTTON_3_MASK, BUTTON_3_REG },
-#endif
-};
-
-#define NUM_BUTTONS    ((sizeof ao_buttons) / sizeof (ao_buttons[0]))
-
-static __xdata uint16_t ao_button_tick[NUM_BUTTONS];
-
-static void
-ao_button_insert(char n)
-{
-       uint16_t        now = ao_time();
-       if ((now - ao_button_tick[n]) > 20) {
-               ao_button_tick[n] = now;
-               ao_fifo_insert(ao_button_fifo, n);
-               ao_wakeup(&ao_button_fifo);
-       }
-}
-
-static void
-ao_button_isr(uint8_t flag, uint8_t reg)
-{
-       uint8_t b;
-
-       for (b = 0; b < NUM_BUTTONS; b++)
-               if (ao_buttons[b].reg == reg && (ao_buttons[b].mask & flag))
-                       ao_button_insert(b + 1);
-}
-
-static uint8_t
-ao_button_mask(uint8_t reg)
-{
-       uint8_t b;
-       uint8_t mask = 0;
-
-       for (b = 0; b < NUM_BUTTONS; b++)
-               if (ao_buttons[b].reg == reg)
-                       mask |= ao_buttons[b].mask;
-       return mask;
-}
-
-char
-ao_button_get(uint16_t timeout) __critical
-{
-       char    b;
-
-       while (ao_fifo_empty(ao_button_fifo))
-               if (ao_sleep_for(&ao_button_fifo, timeout))
-                       return 0;
-       ao_fifo_remove(ao_button_fifo, b);
-       return b;
-}
-
-void
-ao_button_clear(void) __critical
-{
-       char b;
-
-       while (!ao_fifo_empty(ao_button_fifo))
-               ao_fifo_remove(ao_button_fifo, b);
-}
-
-void
-ao_p0_isr(void) ao_arch_interrupt(13)
-{
-       P0IF = 0;
-       ao_button_isr(P0IFG, 0);
-       P0IFG = 0;
-}
-
-void
-ao_p1_isr(void) ao_arch_interrupt(15)
-{
-       P1IF = 0;
-       ao_button_isr(P1IFG, 1);
-       P1IFG = 0;
-}
-
-/* Shared with USB */
-void
-ao_p2_isr(void)
-{
-       ao_button_isr(P2IFG, 2);
-       P2IFG = 0;
-}
-
-void
-ao_button_init(void)
-{
-       uint8_t mask;
-
-       /* Pins are configured as inputs with pull-up by default */
-
-       /* Enable interrupts for P0 inputs */
-       mask = ao_button_mask(0);
-       if (mask) {
-               if (mask & 0x0f)
-                       PICTL |= PICTL_P0IENL;
-               if (mask & 0xf0)
-                       PICTL |= PICTL_P0IENH;
-               P0IFG = 0;
-               P0IF = 0;
-               IEN1 |= IEN1_P0IE;
-               PICTL |= PICTL_P0ICON;
-       }
-
-       /* Enable interrupts for P1 inputs */
-       mask = ao_button_mask(1);
-       if (mask) {
-               P1IEN |= mask;
-               P1IFG = 0;
-               P1IF = 0;
-               IEN2 |= IEN2_P1IE;
-               PICTL |= PICTL_P1ICON;
-       }
-
-       /* Enable interrupts for P2 inputs */
-       mask = ao_button_mask(2);
-       if (mask) {
-               PICTL |= PICTL_P2IEN;
-               P2IFG = 0;
-               P2IF = 0;
-               IEN2 |= IEN2_P2IE;
-               PICTL |= PICTL_P2ICON;
-       }
-}
diff --git a/src/cc1111/ao_dbg.c b/src/cc1111/ao_dbg.c
deleted file mode 100644 (file)
index ca751b8..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-#include "ao_pins.h"
-
-static void
-ao_dbg_send_bits(uint8_t msk, uint8_t val) __reentrant
-{
-       DBG_PORT = (DBG_PORT & ~msk) | (val & msk);
-       __asm
-               nop
-               nop
-       __endasm;
-}
-
-void
-ao_dbg_send_byte(uint8_t byte)
-{
-       __pdata uint8_t b, d;
-
-       DBG_PORT |= DBG_DATA;
-       DBG_PORT_DIR |= DBG_DATA;
-       for (b = 0; b < 8; b++) {
-               d = 0;
-               if (byte & 0x80)
-                       d = DBG_DATA;
-               byte <<= 1;
-               ao_dbg_send_bits(DBG_CLOCK|DBG_DATA, DBG_CLOCK|d);
-               ao_dbg_send_bits(DBG_CLOCK|DBG_DATA,     0    |d);
-       }
-       DBG_PORT_DIR &= ~DBG_DATA;
-}
-
-uint8_t
-ao_dbg_recv_byte(void)
-{
-       __pdata uint8_t byte, b;
-
-       byte = 0;
-       for (b = 0; b < 8; b++) {
-               byte = byte << 1;
-               ao_dbg_send_bits(DBG_CLOCK, DBG_CLOCK);
-               if (DBG_DATA_PIN)
-                       byte |= 1;
-               ao_dbg_send_bits(DBG_CLOCK, 0);
-       }
-       return byte;
-}
-
-/* 8051 instructions
- */
-#define NOP                    0x00
-#define MOV_direct_data                0x75
-#define LJMP                   0x02
-#define MOV_Rn_data(n)         (0x78 | (n))
-#define DJNZ_Rn_rel(n)         (0xd8 | (n))
-#define MOV_A_direct           0xe5
-#define MOV_direct1_direct2    0x85
-#define MOV_direct_A           0xf5
-#define MOV_DPTR_data16                0x90
-#define MOV_A_data             0x74
-#define MOVX_atDPTR_A          0xf0
-#define MOVX_A_atDPTR          0xe0
-#define INC_DPTR               0xa3
-#define TRAP                   0xa5
-#define SJMP                   0x80
-#define JB                     0x20
-
-#define DEBUG_INSTR(l)         (0x54 | (l))
-
-#define SFR_PSW                        0xD0
-#define SFR_DPL0               0x82
-#define SFR_DPH0               0x83
-#define SFR_DPL1               0x84
-#define SFR_DPH1               0x85
-
-__pdata uint8_t        save_acc;
-__pdata uint8_t save_psw;
-__pdata uint8_t save_dpl0;
-__pdata uint8_t save_dph0;
-__pdata uint8_t save_dpl1;
-__pdata uint8_t save_dph1;
-
-static uint8_t
-ao_dbg_inst1(uint8_t a) __reentrant
-{
-       ao_dbg_send_byte(DEBUG_INSTR(1));
-       ao_dbg_send_byte(a);
-       return ao_dbg_recv_byte();
-}
-
-static uint8_t
-ao_dbg_inst2(uint8_t a, uint8_t b) __reentrant
-{
-       ao_dbg_send_byte(DEBUG_INSTR(2));
-       ao_dbg_send_byte(a);
-       ao_dbg_send_byte(b);
-       return ao_dbg_recv_byte();
-}
-
-static uint8_t
-ao_dbg_inst3(uint8_t a, uint8_t b, uint8_t c) __reentrant
-{
-       ao_dbg_send_byte(DEBUG_INSTR(3));
-       ao_dbg_send_byte(a);
-       ao_dbg_send_byte(b);
-       ao_dbg_send_byte(c);
-       return ao_dbg_recv_byte();
-}
-
-void
-ao_dbg_start_transfer(uint16_t addr)
-{
-       save_acc  = ao_dbg_inst1(NOP);
-       save_psw  = ao_dbg_inst2(MOV_A_direct, SFR_PSW);
-       save_dpl0 = ao_dbg_inst2(MOV_A_direct, SFR_DPL0);
-       save_dph0 = ao_dbg_inst2(MOV_A_direct, SFR_DPH0);
-       save_dpl1 = ao_dbg_inst2(MOV_A_direct, SFR_DPL1);
-       save_dph1 = ao_dbg_inst2(MOV_A_direct, SFR_DPH1);
-       ao_dbg_inst3(MOV_DPTR_data16, addr >> 8, addr);
-}
-
-void
-ao_dbg_end_transfer(void)
-{
-       ao_dbg_inst3(MOV_direct_data, SFR_DPL0, save_dpl0);
-       ao_dbg_inst3(MOV_direct_data, SFR_DPH0, save_dph0);
-       ao_dbg_inst3(MOV_direct_data, SFR_DPL1, save_dpl1);
-       ao_dbg_inst3(MOV_direct_data, SFR_DPH1, save_dph1);
-       ao_dbg_inst3(MOV_direct_data, SFR_PSW, save_psw);
-       ao_dbg_inst2(MOV_A_data, save_acc);
-}
-
-void
-ao_dbg_write_byte(uint8_t byte)
-{
-       ao_dbg_inst2(MOV_A_data, byte);
-       ao_dbg_inst1(MOVX_atDPTR_A);
-       ao_dbg_inst1(INC_DPTR);
-}
-
-uint8_t
-ao_dbg_read_byte(void)
-{
-       ao_dbg_inst1(MOVX_A_atDPTR);
-       return ao_dbg_inst1(INC_DPTR);
-}
-
-static void
-ao_dbg_set_pins(void)
-{
-       /* Make the DBG pins GPIOs. On TeleMetrum, this will
-        * disable the SPI link, so don't expect SPI to work after
-        * using the debugger.
-        */
-       DBG_PORT_SEL &= ~(DBG_CLOCK|DBG_DATA|DBG_RESET_N);
-
-       /* make DBG_DATA tri-state */
-       DBG_PORT_INP |= DBG_DATA;
-
-       /* Raise RESET_N and CLOCK */
-       DBG_PORT |= DBG_RESET_N | DBG_CLOCK;
-
-       /* RESET_N and CLOCK are outputs now */
-       DBG_PORT_DIR |= DBG_RESET_N | DBG_CLOCK;
-       DBG_PORT_DIR &= ~DBG_DATA;
-}
-
-static void
-ao_dbg_long_delay(void)
-{
-       uint8_t n;
-
-       for (n = 0; n < 20; n++)
-               __asm nop __endasm;
-}
-
-#define AO_RESET_LOW_DELAY     AO_MS_TO_TICKS(100)
-#define AO_RESET_HIGH_DELAY    AO_MS_TO_TICKS(100)
-
-static void
-ao_dbg_send_bits_delay(uint8_t msk, uint8_t val)
-{
-       ao_dbg_long_delay();
-       ao_dbg_send_bits(msk, val);
-}
-
-void
-ao_dbg_do_reset(uint8_t clock_up)
-{
-       ao_dbg_set_pins();
-       ao_dbg_send_bits_delay(DBG_CLOCK|DBG_DATA|DBG_RESET_N, DBG_CLOCK|DBG_DATA|DBG_RESET_N);
-       ao_dbg_send_bits_delay(DBG_CLOCK|DBG_DATA|DBG_RESET_N, clock_up |DBG_DATA|    0    );
-       ao_delay(AO_RESET_LOW_DELAY);
-       ao_dbg_send_bits      (DBG_CLOCK|DBG_DATA|DBG_RESET_N, DBG_CLOCK|DBG_DATA|    0    );
-       ao_dbg_send_bits_delay(DBG_CLOCK|DBG_DATA|DBG_RESET_N, clock_up |DBG_DATA|    0    );
-       ao_dbg_send_bits_delay(DBG_CLOCK|DBG_DATA|DBG_RESET_N, DBG_CLOCK|DBG_DATA|    0    );
-       ao_dbg_send_bits_delay(DBG_CLOCK|DBG_DATA|DBG_RESET_N, clock_up |DBG_DATA|DBG_RESET_N);
-       ao_delay(AO_RESET_HIGH_DELAY);
-}
-
-static void
-debug_enable(void)
-{
-       /* toggle clock line while holding reset low */
-       ao_dbg_do_reset(0);
-}
-
-static void
-debug_reset(void)
-{
-       /* hold clock high while holding reset low */
-       ao_dbg_do_reset(DBG_CLOCK);
-}
-
-static void
-debug_put(void)
-{
-       for (;;) {
-               ao_cmd_white ();
-               if (ao_cmd_lex_c == '\n')
-                       break;
-               ao_cmd_hex();
-               if (ao_cmd_status != ao_cmd_success)
-                       break;
-               ao_dbg_send_byte(ao_cmd_lex_i);
-       }
-}
-
-static void
-debug_get(void)
-{
-       __pdata uint16_t count;
-       __pdata uint16_t i;
-       __pdata uint8_t byte;
-       ao_cmd_hex();
-       if (ao_cmd_status != ao_cmd_success)
-               return;
-       count = ao_cmd_lex_i;
-       if (count > 256) {
-               ao_cmd_status = ao_cmd_syntax_error;
-               return;
-       }
-       for (i = 0; i < count; i++) {
-               if (i && (i & 7) == 0)
-                       putchar('\n');
-               byte = ao_dbg_recv_byte();
-               ao_cmd_put8(byte);
-               putchar(' ');
-       }
-       putchar('\n');
-}
-
-static void
-debug_input(void)
-{
-       __pdata uint16_t count;
-       __pdata uint16_t addr;
-       __pdata uint8_t b;
-       __pdata uint8_t i;
-
-       ao_cmd_hex();
-       count = ao_cmd_lex_i;
-       ao_cmd_hex();
-       addr = ao_cmd_lex_i;
-       if (ao_cmd_status != ao_cmd_success)
-               return;
-       ao_dbg_start_transfer(addr);
-       i = 0;
-       while (count--) {
-               if (!(i++ & 7))
-                       putchar('\n');
-               b = ao_dbg_read_byte();
-               ao_cmd_put8(b);
-       }
-       ao_dbg_end_transfer();
-       putchar('\n');
-}
-
-static void
-debug_output(void)
-{
-       __pdata uint16_t count;
-       __pdata uint16_t addr;
-       __pdata uint8_t b;
-
-       ao_cmd_hex();
-       count = ao_cmd_lex_i;
-       ao_cmd_hex();
-       addr = ao_cmd_lex_i;
-       if (ao_cmd_status != ao_cmd_success)
-               return;
-       ao_dbg_start_transfer(addr);
-       while (count--) {
-               b = ao_getnibble() << 4;
-               b |= ao_getnibble();
-               if (ao_cmd_status != ao_cmd_success)
-                       return;
-               ao_dbg_write_byte(b);
-       }
-       ao_dbg_end_transfer();
-}
-
-__code struct ao_cmds ao_dbg_cmds[7] = {
-       { debug_enable, "D\0Enable debug" },
-       { debug_get,    "G <count>\0Get data" },
-       { debug_input,  "I <count> <addr>\0Input <count> at <addr>" },
-       { debug_output, "O <count> <addr>\0Output <count> at <addr>" },
-       { debug_put,    "P <byte> ...\0Put data" },
-       { debug_reset,  "R\0Reset" },
-       { 0, NULL },
-};
-
-void
-ao_dbg_init(void)
-{
-       ao_cmd_register(&ao_dbg_cmds[0]);
-}
diff --git a/src/cc1111/ao_dma.c b/src/cc1111/ao_dma.c
deleted file mode 100644 (file)
index 1826651..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-#define NUM_DMA        5
-
-/*
- * The config address for DMA0 is programmed
- * separately from that of DMA1-4, but for simplicity,
- * we make them all contiguous.
- */
-
-static __xdata struct cc_dma_channel ao_dma_config[NUM_DMA];
-static __xdata uint8_t * __xdata ao_dma_done[NUM_DMA];
-static __data uint8_t ao_next_dma;
-
-uint8_t
-ao_dma_alloc(__xdata uint8_t *done)
-{
-       uint8_t id;
-
-       if (ao_next_dma == NUM_DMA)
-               ao_panic(AO_PANIC_DMA);
-       id = ao_next_dma++;
-       ao_dma_done[id] = done;
-
-       /* When the first dma object is allocated, set up the DMA
-        * controller
-        */
-       if (id == 0) {
-               DMAIRQ = 0;
-               DMAIF = 0;
-               IEN1 |= IEN1_DMAIE;
-               DMA0CFGH = ((uint16_t) (&ao_dma_config[0])) >> 8;
-               DMA0CFGL = ((uint16_t) (&ao_dma_config[0]));
-               DMA1CFGH = ((uint16_t) (&ao_dma_config[1])) >> 8;
-               DMA1CFGL = ((uint16_t) (&ao_dma_config[1]));
-       }
-
-       return id;
-}
-
-void
-ao_dma_set_transfer(uint8_t id,
-                   void __xdata *srcaddr,
-                   void __xdata *dstaddr,
-                   uint16_t count,
-                   uint8_t cfg0,
-                   uint8_t cfg1)
-{
-       if (DMAARM & (1 << id))
-               ao_panic(AO_PANIC_DMA);
-       ao_dma_config[id].src_high = ((uint16_t) srcaddr) >> 8;
-       ao_dma_config[id].src_low = ((uint16_t) srcaddr);
-       ao_dma_config[id].dst_high = ((uint16_t) dstaddr) >> 8;
-       ao_dma_config[id].dst_low = ((uint16_t) dstaddr);
-       ao_dma_config[id].len_high = count >> 8;
-       ao_dma_config[id].len_low = count;
-       ao_dma_config[id].cfg0 = cfg0;
-       ao_dma_config[id].cfg1 = cfg1 | DMA_CFG1_IRQMASK;
-}
-
-#define nop()  __asm nop __endasm;
-
-void
-ao_dma_start(uint8_t id)
-{
-       uint8_t mask = (1 << id);
-       DMAIRQ &= ~mask;
-       if (DMAARM & mask) {
-               DMAARM = 0x80 | mask;
-               nop(); nop(); nop(); nop();
-               nop(); nop(); nop(); nop();
-       }
-       *(ao_dma_done[id]) = 0;
-       DMAARM = mask;
-       nop(); nop(); nop(); nop();
-       nop(); nop(); nop(); nop();
-       nop();
-}
-
-void
-ao_dma_trigger(uint8_t id)
-{
-       DMAREQ |= (1 << id);
-}
-
-void
-ao_dma_abort(uint8_t id)
-{
-       uint8_t mask = (1 << id);
-       DMAARM = 0x80 | mask;
-       DMAIRQ &= ~mask;
-}
-
-void
-ao_dma_isr(void) __interrupt 8
-{
-       uint8_t id, mask;
-
-       /* Find the first DMA channel which is done */
-       mask = 1;
-       for (id = 0; id < ao_next_dma; id++) {
-               if (DMAIRQ & mask) {
-                       /* Clear CPU interrupt flag */
-                       DMAIF = 0;
-                       /* Clear the completed ID */
-                       DMAIRQ = ~mask;
-                       *(ao_dma_done[id]) = 1;
-                       ao_wakeup(ao_dma_done[id]);
-                       break;
-               }
-               mask <<= 1;
-       }
-}
diff --git a/src/cc1111/ao_exti.c b/src/cc1111/ao_exti.c
deleted file mode 100644 (file)
index e21e417..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright © 2012 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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>
-#include <ao_exti.h>
-
-#if HAS_EXTI_0
-__xdata void   (*ao_int_callback)(void);
-
-void
-ao_p0_isr(void) __interrupt(13)
-{
-       if (P0IF && (P0IFG & (AO_MS5607_MISO_MASK))) {
-               (*ao_int_callback)();
-       }
-       P0IFG = 0;
-       P0IF = 0;
-}
-#endif
diff --git a/src/cc1111/ao_exti.h b/src/cc1111/ao_exti.h
deleted file mode 100644 (file)
index 927a4f0..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright © 2012 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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_EXTI_H_
-#define _AO_EXTI_H_
-
-#define AO_EXTI_MODE_RISING    1
-#define AO_EXTI_MODE_FALLING   2
-#define AO_EXTI_MODE_PULL_UP   4
-#define AO_EXTI_MODE_PULL_DOWN 8
-#define AO_EXTI_PRIORITY_LOW   16
-#define AO_EXTI_PRIORITY_MED   0
-#define AO_EXTI_PRIORITY_HIGH  32
-
-extern void    (*ao_int_callback)(void);
-
-#define ao_exti_setup(gpio, pin, mode, callback) do { \
-               ao_int_callback = callback;           \
-       } while (0)
-
-#define ao_exti_set_mode(gpio, pin, mode) do { \
-       } while (0)
-
-#define ao_exti_set_callback(port, pin, callback) do { \
-               ao_int_callback = callback;             \
-       } while (0)
-
-#define ao_exti_init()
-
-#define ao_exti_enable(port, pin) do {         \
-               P0IFG &= ~(1 << pin);           \
-               P0IF = 0;                       \
-               PICTL |= PICTL_P0IENL;          \
-               IEN1 |= IEN1_P0IE;              \
-       } while (0)
-
-#define ao_exti_disable(port, pin) do {                \
-               IEN1 &= ~IEN1_P0IE;             \
-               PICTL &= ~PICTL_P0IENL;         \
-       } while (0)
-
-#endif /* _AO_EXTI_H_ */
diff --git a/src/cc1111/ao_intflash.c b/src/cc1111/ao_intflash.c
deleted file mode 100644 (file)
index 154b3c2..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright © 2011  Anthony Towns <aj@erisian.com.au>
- *
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-#include "cc1111.h"
-
-#define ENDOFCODE  (CODESIZE)
-#define AO_INTFLASH_BLOCK      1024
-#define AO_INTFLASH_BLOCKS     ((0x8000 - ENDOFCODE)/AO_INTFLASH_BLOCK)
-#define AO_INTFLASH_SIZE       (AO_INTFLASH_BLOCK * AO_INTFLASH_BLOCKS)
-#define AO_INTFLASH_LOCATION   (0x8000 - AO_INTFLASH_SIZE)
-
-/*
- *       21000 * 24e6
- * FWT = ------------
- *           16e9
- *
- *     = 31.5
- *
- * Round up and use 32
- */
-
-#define FLASH_TIMING   0x20
-
-#if AO_INTFLASH_BLOCKS < 2
-#error "Too few pages"
-#endif
-
-#if AO_INFTLASH_LOCATION % 1024 != 0
-#error "Pages aren't aligned properly"
-#endif
-
-__xdata __at(AO_INTFLASH_LOCATION) uint8_t ao_intflash[AO_INTFLASH_SIZE];
-
-/* Total bytes of available storage */
-__pdata uint32_t       ao_storage_total = sizeof(ao_intflash);
-
-/* Block size - device is erased in these units. */
-__pdata uint32_t       ao_storage_block = AO_INTFLASH_BLOCK;
-
-/* Byte offset of config block. Will be ao_storage_block bytes long */
-__pdata uint32_t       ao_storage_config = sizeof(ao_intflash) - AO_INTFLASH_BLOCK;
-
-/* Storage unit size - device reads and writes must be within blocks of this size. */
-__pdata uint16_t       ao_storage_unit = AO_INTFLASH_BLOCK;
-
-__xdata static uint8_t  ao_intflash_dma_done;
-static uint8_t ao_intflash_dma;
-
-/*
- * The internal flash chip is arranged in 1kB sectors; the
- * chip cannot erase in units smaller than that.
- *
- * Writing happens in units of 2 bytes and
- * can only change bits from 1 to 0. So, you can rewrite
- * the same contents, or append to an existing page easily enough
- */
-
-/*
- * Erase the specified sector
- */
-uint8_t
-ao_storage_erase(uint32_t pos) __reentrant
-{
-       uint16_t addr;
-
-       if (pos >= ao_storage_total || pos + ao_storage_block > ao_storage_total)
-               return 0;
-
-       addr = ((uint16_t)(ao_intflash + pos) >> 1);
-
-       FADDRH = addr >> 8;
-       FADDRL = addr;
-
-       __critical {
-               _asm
-               .even
-               orl _FCTL, #FCTL_ERASE;         ; FCTL |=  FCTL_ERASE
-               nop                             ; Required, see datasheet.
-               _endasm;
-       }
-
-       return 1;
-}
-
-/*
- * Write to flash
- */
-
-static void
-ao_intflash_write_aligned(uint16_t pos, __xdata void *d, uint16_t len) __reentrant
-{
-       pos = ((uint16_t) ao_intflash + pos) >> 1;
-
-       ao_dma_set_transfer(ao_intflash_dma,
-                           d,
-                           &FWDATAXADDR,
-                           len,
-                           DMA_CFG0_WORDSIZE_8 |
-                           DMA_CFG0_TMODE_SINGLE |
-                           DMA_CFG0_TRIGGER_FLASH,
-                           DMA_CFG1_SRCINC_1 |
-                           DMA_CFG1_DESTINC_0 |
-                           DMA_CFG1_PRIORITY_HIGH);
-
-       FADDRH = pos >> 8;
-       FADDRL = pos;
-
-       ao_dma_start(ao_intflash_dma);
-
-       __critical {
-               _asm
-               .even
-               orl _FCTL, #FCTL_WRITE;         ; FCTL |=  FCTL_WRITE
-               nop
-               _endasm;
-       }
-       __critical while (!ao_intflash_dma_done)
-                          ao_sleep(&ao_intflash_dma_done);
-}
-
-static void
-ao_intflash_write_byte(uint16_t pos, uint8_t byte) __reentrant
-{
-       static __xdata uint8_t b[2];
-
-       if (pos & 1) {
-               b[0] = 0xff;
-               b[1] = byte;
-       } else {
-               b[0] = byte;
-               b[1] = 0xff;
-       }
-       ao_intflash_write_aligned(pos, b, 2);
-}
-
-uint8_t
-ao_storage_device_write(uint32_t pos32, __xdata void *v, uint16_t len) __reentrant
-{
-       uint16_t pos = pos32;
-       __xdata uint8_t *d = v;
-       uint8_t oddlen;
-
-       if (pos >= ao_storage_total || pos + len > ao_storage_total)
-               return 0;
-       if (len == 0)
-               return 1;
-
-       if (pos & 1) {
-               ao_intflash_write_byte(pos++, *d++);
-               len--;
-       }
-       oddlen = len & 1;
-       len -= oddlen;
-       if (len)
-               ao_intflash_write_aligned(pos, d, len);
-       if (oddlen)
-               ao_intflash_write_byte(pos + len, d[len]);
-
-       return 1;
-}
-
-/*
- * Read from flash
- */
-uint8_t
-ao_storage_device_read(uint32_t pos, __xdata void *d, uint16_t len) __reentrant
-{
-       if (pos >= ao_storage_total || pos + len > ao_storage_total)
-               return 0;
-       ao_xmemcpy(d, ao_intflash+pos, len);
-       return 1;
-}
-
-void
-ao_storage_flush(void) __reentrant
-{
-}
-
-void
-ao_storage_setup(void)
-{
-}
-
-void
-ao_storage_device_info(void) __reentrant
-{
-       printf ("Using internal flash, starting at 0x%04x\n", AO_INTFLASH_LOCATION);
-}
-
-void
-ao_storage_device_init(void)
-{
-       ao_intflash_dma = ao_dma_alloc(&ao_intflash_dma_done);
-
-       FWT = FLASH_TIMING;
-}
diff --git a/src/cc1111/ao_launch.c b/src/cc1111/ao_launch.c
deleted file mode 100644 (file)
index 76d6d13..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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>
-#include <ao_launch.h>
-#include <ao_radio_cmac.h>
-
-__xdata uint16_t ao_launch_ignite;
-
-#if 0
-#define PRINTD(...) printf(__VA_ARGS__)
-#else
-#define PRINTD(...) 
-#endif
-
-static void
-ao_launch_run(void)
-{
-       for (;;) {
-               while (!ao_launch_ignite)
-                       ao_sleep(&ao_launch_ignite);
-               ao_ignition[ao_igniter_drogue].firing = 1;
-               ao_ignition[ao_igniter_main].firing = 1;
-               AO_IGNITER_DIR |= AO_IGNITER_DROGUE_BIT | AO_IGNITER_MAIN_BIT;
-               AO_IGNITER_DROGUE = 1;
-               while (ao_launch_ignite) {
-                       ao_launch_ignite = 0;
-                       ao_delay(AO_MS_TO_TICKS(500));
-               }
-               AO_IGNITER_DROGUE = 0;
-               ao_ignition[ao_igniter_drogue].firing = 0;
-               ao_ignition[ao_igniter_main].firing = 0;
-       }
-}
-
-static void
-ao_launch_status(void)
-{
-       uint8_t i;
-       for (;;) {
-               ao_delay(AO_SEC_TO_TICKS(1));
-               if (ao_igniter_status(ao_igniter_drogue) == ao_igniter_ready) {
-                       if (ao_igniter_status(ao_igniter_main) == ao_igniter_ready) {
-                               for (i = 0; i < 5; i++) {
-                                       ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(50));
-                                       ao_delay(AO_MS_TO_TICKS(100));
-                               }
-                       } else {
-                               ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(200));
-                       }
-               }
-       }
-}
-
-static __pdata uint8_t ao_launch_armed;
-static __pdata uint16_t        ao_launch_arm_time;
-
-static void
-ao_launch(void)
-{
-       static __xdata struct ao_launch_command command;
-       static __xdata struct ao_launch_query   query;
-       int16_t time_difference;
-
-       ao_led_off(AO_LED_RED);
-       ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(200));
-       for (;;) {
-               flush();
-               if (ao_radio_cmac_recv(&command, sizeof (command), 0) != AO_RADIO_CMAC_OK)
-                       continue;
-               
-               PRINTD ("tick %d serial %d cmd %d channel %d\n",
-                       command.tick, command.serial, command.cmd, command.channel);
-
-               switch (command.cmd) {
-               case AO_LAUNCH_QUERY:
-                       if (command.serial != ao_serial_number) {
-                               PRINTD ("serial number mismatch\n");
-                               break;
-                       }
-
-                       if (command.channel == 0) {
-                               query.valid = 1;
-                               query.arm_status = ao_igniter_status(ao_igniter_drogue);
-                               query.igniter_status = ao_igniter_status(ao_igniter_main);
-                       } else {
-                               query.valid = 0;
-                       }
-                       query.tick = ao_time();
-                       query.serial = ao_serial_number;
-                       query.channel = command.channel;
-                       PRINTD ("query tick %d serial %d channel %d valid %d arm %d igniter %d\n",
-                               query.tick, query.serial, query.channel, query.valid, query.arm_status,
-                               query.igniter_status);
-                       ao_radio_cmac_send(&query, sizeof (query));
-                       break;
-               case AO_LAUNCH_ARM:
-                       if (command.serial != ao_serial_number) {
-                               PRINTD ("serial number mismatch\n");
-                               break;
-                       }
-
-                       if (command.channel != 0)
-                               break;
-                       time_difference = command.tick - ao_time();
-                       PRINTD ("arm tick %d local tick %d\n", command.tick, ao_time());
-                       if (time_difference < 0)
-                               time_difference = -time_difference;
-                       if (time_difference > 10) {
-                               PRINTD ("time difference too large %d\n", time_difference);
-                               break;
-                       }
-                       PRINTD ("armed\n");
-                       ao_launch_armed = 1;
-                       ao_launch_arm_time = ao_time();
-                       break;
-               case AO_LAUNCH_FIRE:
-                       if (!ao_launch_armed) {
-                               PRINTD ("not armed\n");
-                               break;
-                       }
-                       if ((uint16_t) (ao_time() - ao_launch_arm_time) > AO_SEC_TO_TICKS(20)) {
-                               PRINTD ("late launch arm_time %d time %d\n",
-                                       ao_launch_arm_time, ao_time());
-                               break;
-                       }
-                       time_difference = command.tick - ao_time();
-                       if (time_difference < 0)
-                               time_difference = -time_difference;
-                       if (time_difference > 10) {
-                               PRINTD ("time different too large %d\n", time_difference);
-                               break;
-                       }
-                       PRINTD ("ignite\n");
-                       ao_launch_ignite = 1;
-                       ao_wakeup(&ao_launch_ignite);
-                       break;
-               }
-       }
-}
-
-void
-ao_launch_test(void)
-{
-       switch (ao_igniter_status(ao_igniter_drogue)) {
-       case ao_igniter_ready:
-       case ao_igniter_active:
-               printf ("Armed: ");
-               switch (ao_igniter_status(ao_igniter_main)) {
-               default:
-                       printf("unknown status\n");
-                       break;
-               case ao_igniter_ready:
-                       printf("igniter good\n");
-                       break;
-               case ao_igniter_open:
-                       printf("igniter bad\n");
-                       break;
-               }
-               break;
-       default:
-               printf("Disarmed\n");
-       }
-}
-
-void
-ao_launch_manual(void)
-{
-       ao_cmd_white();
-       if (!ao_match_word("DoIt"))
-               return;
-       ao_cmd_white();
-       ao_launch_ignite = 1;
-       ao_wakeup(&ao_launch_ignite);
-}
-
-static __xdata struct ao_task ao_launch_task;
-static __xdata struct ao_task ao_launch_ignite_task;
-static __xdata struct ao_task ao_launch_status_task;
-
-__code struct ao_cmds ao_launch_cmds[] = {
-       { ao_launch_test,       "t\0Test launch continuity" },
-       { ao_launch_manual,     "i <key>\0Fire igniter. <key> is doit with D&I" },
-       { 0, NULL }
-};
-
-void
-ao_launch_init(void)
-{
-       AO_IGNITER_DROGUE = 0;
-       AO_IGNITER_MAIN = 0;
-       AO_IGNITER_DIR |= AO_IGNITER_DROGUE_BIT | AO_IGNITER_MAIN_BIT;
-       ao_cmd_register(&ao_launch_cmds[0]);
-       ao_add_task(&ao_launch_task, ao_launch, "launch listener");
-       ao_add_task(&ao_launch_ignite_task, ao_launch_run, "launch igniter");
-       ao_add_task(&ao_launch_status_task, ao_launch_status, "launch status");
-}
diff --git a/src/cc1111/ao_launch.h b/src/cc1111/ao_launch.h
deleted file mode 100644 (file)
index 966b5ce..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright © 2017 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, either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- */
-
-#ifndef _AO_LAUNCH_H_
-#define _AO_LAUNCH_H_
-/* ao_launch.c */
-
-struct ao_launch_command {
-       uint16_t        tick;
-       uint16_t        serial;
-       uint8_t         cmd;
-       uint8_t         channel;
-       uint16_t        unused;
-};
-
-#define AO_LAUNCH_QUERY                1
-
-struct ao_launch_query {
-       uint16_t        tick;
-       uint16_t        serial;
-       uint8_t         channel;
-       uint8_t         valid;
-       uint8_t         arm_status;
-       uint8_t         igniter_status;
-};
-
-#define AO_LAUNCH_ARM          2
-#define AO_LAUNCH_FIRE         3
-
-void
-ao_launch_init(void);
-
-#endif /* _AO_LAUNCH_H_ */
diff --git a/src/cc1111/ao_lcd_port.c b/src/cc1111/ao_lcd_port.c
deleted file mode 100644 (file)
index 9b58809..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-static void
-ao_lcd_port_delay(void)
-{
-       uint8_t i;
-
-       for (i = 0; i < 100; i++)
-               ao_arch_nop();
-}
-
-void
-ao_lcd_port_put_nibble(uint8_t rs, uint8_t nibble)
-{
-       P0 = (P0 & 0xf0) | (nibble & 0x0f);
-       P1_1 = rs;
-       P1_0 = 1;
-       ao_lcd_port_delay();
-       P1_0 = 0;
-       ao_lcd_port_delay();
-}
-
-void
-ao_lcd_port_init(void)
-{
-       /* LCD_E and LCD_RS are GPIO outputs */
-       P1DIR |= 0x03;
-       P1SEL &= ~0x03;
-
-       /* LCD D4-D7 are GPIO outputs */
-       P0DIR |= 0x0f;
-       P0SEL &= ~0x0f;
-}
diff --git a/src/cc1111/ao_led.c b/src/cc1111/ao_led.c
deleted file mode 100644 (file)
index 5fae46c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-__pdata uint8_t ao_led_enable;
-
-void
-ao_led_on(uint8_t colors)
-{
-       P1 |= (colors & ao_led_enable);
-}
-
-void
-ao_led_off(uint8_t colors)
-{
-       P1 &= ~(colors & ao_led_enable);
-}
-
-void
-ao_led_set(uint8_t colors)
-{
-       P1 = (P1 & ~(ao_led_enable)) | (colors & ao_led_enable);
-}
-
-void
-ao_led_toggle(uint8_t colors)
-{
-       P1 ^= (colors & ao_led_enable);
-}
-
-void
-ao_led_for(uint8_t colors, uint16_t ticks) __reentrant
-{
-       ao_led_on(colors);
-       ao_delay(ticks);
-       ao_led_off(colors);
-}
-
-void
-ao_led_init(uint8_t enable)
-{
-       ao_led_enable = enable;
-       P1SEL &= ~enable;
-       P1 &= ~enable;
-       P1DIR |= enable;
-}
diff --git a/src/cc1111/ao_pins.h b/src/cc1111/ao_pins.h
deleted file mode 100644 (file)
index 9d6e1c1..0000000
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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_
-
-#define HAS_RADIO              1
-#define DISABLE_LOG_SPACE      1
-#define AO_VALUE_32            0
-#define HAS_WIDE_GPS           0
-
-#if defined(TELEMETRUM_V_1_0)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              1
-       #define HAS_USB                 1
-       #define HAS_BEEP                1
-       #define HAS_BEEP_CONFIG         0
-       #define HAS_GPS                 1
-       #define HAS_SERIAL_1            1
-       #define HAS_ADC                 1
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 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 NOISY_ACCEL             1
-
-       #define HAS_COMPANION           1
-       #define COMPANION_CS_ON_P1      1
-       #define AO_COMPANION_CS_PORT    P1
-       #define AO_COMPANION_CS_PIN     2
-       #define AO_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
-       #define HAS_TELEMETRY           1
-       #define HAS_RADIO_RATE          0       /* not enough space for this */
-       #define HAS_MUTEX_TRY           0
-       #define HAS_TASK_INFO           0       /* not enough space for this either */
-       #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
-#endif
-
-#if defined(TELEMETRUM_V_1_1)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              1
-       #define HAS_USB                 1
-       #define HAS_BEEP                1
-       #define HAS_BEEP_CONFIG         0
-       #define HAS_BATTERY_REPORT      1
-       #define HAS_GPS                 1
-       #define HAS_SERIAL_1            1
-       #define HAS_ADC                 1
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 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 AO_COMPANION_CS_PORT    P1
-       #define AO_COMPANION_CS_PIN     2
-       #define AO_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 AO_M25_SPI_CS_MASK      0x02    /* CS0 is P1_1 */
-       #define M25_MAX_CHIPS           1
-       #define HAS_ACCEL               1
-       #define HAS_IGNITE              1
-       #define HAS_MONITOR             0
-       #define HAS_TELEMETRY           1
-       #define HAS_RADIO_RATE          0       /* not enough space for this */
-       #define HAS_MUTEX_TRY           0
-       #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
-#endif
-
-#if defined(TELEMETRUM_V_1_2)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              1
-       #define HAS_USB                 1
-       #define HAS_BEEP                1
-       #define HAS_BEEP_CONFIG         0
-       #define HAS_BATTERY_REPORT      1
-       #define HAS_GPS                 1
-       #define HAS_SERIAL_1            1
-       #define HAS_ADC                 1
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 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 AO_COMPANION_CS_PORT    P1
-       #define AO_COMPANION_CS_PIN     2
-       #define AO_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 AO_M25_SPI_CS_MASK      0x02    /* CS0 is P1_1 */
-       #define M25_MAX_CHIPS           1
-       #define HAS_ACCEL               1
-       #define HAS_IGNITE              1
-       #define HAS_MONITOR             0
-       #define HAS_TELEMETRY           1
-       #define HAS_RADIO_RATE          0       /* not enough space for this */
-       #define HAS_MUTEX_TRY           0
-       #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
-#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 HAS_ADC                 0
-       #define HAS_DBG                 1
-       #define HAS_EEPROM              0
-       #define HAS_LOG                 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 AO_MONITOR_LED          AO_LED_GREEN
-       #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
-       #define LEGACY_MONITOR          1
-       #define HAS_RSSI                1
-       #define HAS_AES                 0
-       #define HAS_TELEMETRY           0
-       #define AO_RADIO_REG_TEST       1
-#endif
-
-#if defined(TELEMINI_V_1_0)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              1
-       #define HAS_USB                 0
-       #define HAS_BEEP                0
-       #define HAS_GPS                 0
-       #define HAS_SERIAL_1            0
-       #define HAS_ADC                 1
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 1
-       #define HAS_FORCE_FREQ          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
-       #define HAS_TELEMETRY           1
-       #define HAS_RADIO_RATE          0       /* not enough space for this */
-       #define AO_LOG_FORMAT           AO_LOG_FORMAT_TINY
-#endif
-
-#if defined(TELENANO_V_0_1)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              1
-       #define HAS_USB                 0
-       #define HAS_BEEP                0
-       #define HAS_GPS                 0
-       #define HAS_SERIAL_1            0
-       #define HAS_ADC                 1
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 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
-       #define HAS_TELEMETRY           1
-       #define HAS_RADIO_RATE          0       /* not enough space for this */
-#endif
-
-#if defined(TELEMETRUM_V_0_1)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              1
-       #define HAS_USB                 1
-       #define HAS_BEEP                1
-       #define HAS_BEEP_CONFIG         0
-       #define HAS_GPS                 1
-       #define HAS_SERIAL_1            1
-       #define HAS_ADC                 1
-       #define HAS_DBG                 0
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 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
-       #define HAS_TELEMETRY           1
-       #define HAS_RADIO_RATE          0       /* not enough space for this */
-       #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX        ((uint32_t) 127 * (uint32_t) 1024)
-       #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
-#endif
-
-#if defined(TELEDONGLE_V_0_1)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              0
-       #define HAS_USB                 1
-       #define HAS_BEEP                0
-       #define HAS_SERIAL_1            0
-       #define HAS_ADC                 0
-       #define HAS_DBG                 0
-       #define HAS_EEPROM              0
-       #define HAS_LOG                 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 AO_MONITOR_LED          AO_LED_GREEN
-       #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
-       #define LEGACY_MONITOR          1
-       #define HAS_RSSI                1
-       #define HAS_AES                 0
-       #define HAS_TELEMETRY           0
-#endif
-
-#if defined(TIDONGLE)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              0
-       #define HAS_USB                 1
-       #define HAS_BEEP                0
-       #define HAS_SERIAL_1            0
-       #define HAS_ADC                 0
-       #define HAS_DBG                 1
-       #define HAS_EEPROM              0
-       #define HAS_LOG                 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_MONITOR_LED          AO_LED_RED
-       #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
-       #define LEGACY_MONITOR          1
-       #define HAS_RSSI                1
-       #define HAS_AES                 0
-       #define HAS_TELEMETRY           0
-#endif
-
-#if defined(TELEBT_V_0_0)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              0
-       #define HAS_USB                 1
-       #define HAS_BEEP                0
-       #define HAS_SERIAL_1            1
-       #define USE_SERIAL_1_STDIN      1
-       #define DELAY_SERIAL_1_STDIN    1
-       #define HAS_ADC                 0
-       #define HAS_DBG                 1
-       #define HAS_EEPROM              0
-       #define HAS_LOG                 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 AO_MONITOR_LED          AO_LED_RED
-       #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_IGNITE_REPORT       1
-       #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
-       #define LEGACY_MONITOR          1
-       #define HAS_RSSI                0
-       #define HAS_AES                 0
-       #define HAS_TELEMETRY           0
-       #define AO_RADIO_REG_TEST       1
-#endif
-
-#if defined(TELEBT_V_0_1)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              0
-       #define HAS_USB                 1
-       #define HAS_BEEP                1
-       #define HAS_BEEP_CONFIG         0
-       #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_1_STDIN      1
-       #define DELAY_SERIAL_1_STDIN    1
-       #define HAS_ADC                 0
-       #define HAS_DBG                 1
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 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 AO_MONITOR_LED          AO_LED_RED
-       #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
-       #define SPI_CS_ON_P1            1
-       #define SPI_CS_ON_P0            0
-       #define AO_M25_SPI_CS_MASK      0x04    /* CS0 is P1_2 */
-       #define M25_MAX_CHIPS           1
-       #define HAS_ACCEL               0
-       #define HAS_IGNITE              0
-       #define HAS_IGNITE_REPORT       1
-       #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
-       #define LEGACY_MONITOR          1
-       #define HAS_RSSI                0
-       #define HAS_AES                 0
-       #define HAS_TELEMETRY           0
-       #define AO_RADIO_REG_TEST       1
-#endif
-
-#if defined(TELELAUNCH_V_0_1)
-       /* Discontinued and was never built with CC1111 chips needing this */
-       #define NEEDS_CC1111_CLOCK_HACK 0
-       #define HAS_FLIGHT              0
-       #define HAS_USB                 1
-       #define HAS_BEEP                1
-       #define HAS_GPS                 0
-       #define HAS_SERIAL_1            1
-       #define HAS_ADC                 1
-       #define HAS_DBG                 0
-       #define HAS_EEPROM              1
-       #define HAS_LOG                 0
-       #define USE_INTERNAL_FLASH      1
-       #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        0
-       #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               0
-       #define HAS_IGNITE              1
-       #define HAS_MONITOR             0
-       #define HAS_AES                 1
-       #define HAS_TELEMETRY           0
-#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
-
-#define AO_M25_SPI_CS_PORT     SPI_CS_PORT
-
-#ifndef IGNITE_ON_P2
-#error Please define IGNITE_ON_P2
-#endif
-
-#ifndef IGNITE_ON_P0
-#error Please define IGNITE_ON_P0
-#endif
-
-#ifndef HAS_ADC
-#error Please define HAS_ADC
-#endif
-
-#ifndef HAS_EEPROM
-#error Please define HAS_EEPROM
-#endif
-
-#ifndef HAS_LOG
-#error Please define HAS_LOG
-#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
-
-#if HAS_IGNITE
-#define HAS_IGNITE_REPORT 1
-#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
-
-#if HAS_MONITOR
-#ifndef HAS_RSSI
-#error Please define HAS_RSSI
-#endif
-#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 */
-
-#if IGNITE_ON_P2
-#define AO_IGNITER_PORT                P2
-#define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
-#define AO_IGNITER_DROGUE      P2_3
-#define AO_IGNITER_MAIN                P2_4
-#define AO_IGNITER_DIR         P2DIR
-#define AO_IGNITER_DROGUE_BIT  (1 << 3)
-#define AO_IGNITER_MAIN_BIT    (1 << 4)
-#define AO_IGNITER_DROGUE_PIN  3
-#define AO_IGNITER_MAIN_PIN    4
-#endif
-
-#if IGNITE_ON_P0
-#define AO_IGNITER_PORT                P0
-#define AO_IGNITER_DROGUE      P0_5
-#define AO_IGNITER_MAIN                P0_4
-#define AO_IGNITER_DIR         P0DIR
-#define AO_IGNITER_DROGUE_BIT  (1 << 5)
-#define AO_IGNITER_MAIN_BIT    (1 << 4)
-#define AO_IGNITER_DROGUE_PIN  5
-#define AO_IGNITER_MAIN_PIN    4
-#endif
-
-#define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
-#define AO_IGNITER_MAIN_PORT   AO_IGNITER_PORT
-
-/* test these values with real igniters */
-#define AO_IGNITER_OPEN                1000
-#define AO_IGNITER_CLOSED      7000
-#define AO_IGNITER_FIRE_TIME   AO_MS_TO_TICKS(50)
-#define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
-
-struct ao_adc {
-       int16_t         accel;          /* accelerometer */
-       int16_t         pres;           /* pressure sensor */
-       int16_t         temp;           /* temperature sensor */
-       int16_t         v_batt;         /* battery voltage */
-       int16_t         sense_d;        /* drogue continuity sense */
-       int16_t         sense_m;        /* main continuity sense */
-#if HAS_ACCEL_REF
-       uint16_t        accel_ref;      /* acceleration reference */
-#endif
-};
-
-/*
- * Voltage divider on ADC battery sampler
- */
-#define AO_BATTERY_DIV_PLUS    5       /* 5k */
-#define AO_BATTERY_DIV_MINUS   10      /* 10k */
-
-/*
- * Voltage divider on ADC igniter samplers
- */
-#define AO_IGNITE_DIV_PLUS     100     /* 100k */
-#define AO_IGNITE_DIV_MINUS    27      /* 27k */
-
-/*
- * ADC reference in decivolts
- */
-#define AO_ADC_REFERENCE_DV    33
-
-#endif /* _AO_PINS_H_ */
diff --git a/src/cc1111/ao_radio.c b/src/cc1111/ao_radio.c
deleted file mode 100644 (file)
index 166d14d..0000000
+++ /dev/null
@@ -1,689 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-#if HAS_PAD
-#include <ao_pad.h>
-#endif
-
-/* Values from SmartRF® Studio for:
- *
- * Deviation:  20.507812 kHz
- * Datarate:   38.360596 kBaud
- * Modulation: GFSK
- * RF Freq:    434.549927 MHz
- * Channel:    99.975586 kHz
- * Channel:    0
- * RX filter:  93.75 kHz
- */
-
-/*
- * For IF freq of 140.62kHz, the IF value is:
- *
- * 140.62e3 / (24e6 / 2**10) = 6
- */
-
-#define IF_FREQ_CONTROL        6
-
-/*
- *  http://www.ntia.doc.gov/files/ntia/publications/84-168.pdf
- *
- * Necessary bandwidth for a FSK modulated signal:
- *
- *     bw = 2.6d + 0.55b       1.5 < m < 5.5
- *     bw = 2.1d + 1.9b        5.5 < m < 20
- *
- *     b is the modulation rate in bps
- *     d is the peak deviation (from the center)
- *
- *     m = 2d / b
- *
- * 20.5 kHz deviation 38.4kbps signal:
- *
- *     m = 41 / 38.4, which is < 5.5:
- *
- *     bw = 2.6 * 20.5 + 0.55 * 38.4 = 74.42kHz
- *
- *     M = 1, E = 3, bw = 75kHz
- *
- * 5.125 kHz deviation, 9.6kbps signal
- *
- *     m = 10.25 / 9.6, which is < 5.5:
- *
- *     bw = 2.6 * 5.125 + 0.55 * 9.6 = 18.6kHz
- *
- *     M = 2, E = 3, bw = 53.6kHz
- *
- * 1.28125kHz deviation, 2.4kbps signal
- *
- *     m = 2.565 / 2.4, which is < 5.5:
- *
- *     bw = 2.6 * 20.5 + 1.9 * 2.4 = 47.61kHz
- *
- *     M = 3, E = 3, bw = 53.6kHz
- *
- * For channel bandwidth of 93.75 kHz, the CHANBW_E and CHANBW_M values are
- *
- * BW = 24e6 / (8 * (4 + M) * 2 ** E)
- *
- * So, M = 0 and E = 3
- */
-
-#define CHANBW_M_384   1
-#define CHANBW_M_96    3
-#define CHANBW_M_24    3
-#define CHANBW_E       3
-
-/*
- * For a symbol rate of 38360kBaud, the DRATE_E and DRATE_M values are:
- *
- * R = (256 + M) * 2** E * 24e6 / 2**28
- *
- * So for 38360kBaud, M is 163 and E is 10
- */
-
-#define DRATE_M                163
-
-#define DRATE_E_384    10
-
-/* For 9600 baud, M is 163 and E is 8
- */
-
-#define DRATE_E_96     8
-
-/* For 2400 baud, M is 163 and E is 6
- */
-
-#define DRATE_E_24     6
-
-/*
- * For a channel deviation of 20.5kHz, the DEVIATION_E and DEVIATION_M values are:
- *
- * F = 24e6/2**17 * (8 + DEVIATION_M) * 2**DEVIATION_E
- *
- * For 20.5kHz deviation, M is 6 and E is 3
- * For 5.125kHz deviation, M is 6 and E is 1
- * For 1.28125kHz deviation, M is 0 and E is 0
- */
-
-#define DEVIATION_M_384        6
-#define DEVIATION_E_384        3
-
-#define DEVIATION_M_96 6
-#define DEVIATION_E_96 1
-
-#define DEVIATION_M_24 0
-#define DEVIATION_E_24 0
-
-/*
- * For our RDF beacon, set the symbol rate to 2kBaud (for a 1kHz tone),
- * so the DRATE_E and DRATE_M values are:
- *
- * M is 94 and E is 6
- *
- * To make the tone last for 200ms, we need 2000 * .2 = 400 bits or 50 bytes
- */
-
-#define RDF_DRATE_E    6
-#define RDF_DRATE_M    94
-#define RDF_PACKET_LEN 50
-
-/*
- * RDF deviation should match the normal NFM value of 5kHz
- *
- * M is 6 and E is 1
- *
- */
-
-#define RDF_DEVIATION_M        6
-#define RDF_DEVIATION_E        1
-
-/* This are from the table for 433MHz */
-
-#define RF_POWER_M30_DBM       0x12
-#define RF_POWER_M20_DBM       0x0e
-#define RF_POWER_M15_DBM       0x1d
-#define RF_POWER_M10_DBM       0x34
-#define RF_POWER_M5_DBM                0x2c
-#define RF_POWER_0_DBM         0x60
-#define RF_POWER_5_DBM         0x84
-#define RF_POWER_7_DBM         0xc8
-#define RF_POWER_10_DBM                0xc0
-
-#define RF_POWER               RF_POWER_10_DBM
-
-static __code uint8_t radio_setup[] = {
-       RF_PA_TABLE7_OFF,       RF_POWER,
-       RF_PA_TABLE6_OFF,       RF_POWER,
-       RF_PA_TABLE5_OFF,       RF_POWER,
-       RF_PA_TABLE4_OFF,       RF_POWER,
-       RF_PA_TABLE3_OFF,       RF_POWER,
-       RF_PA_TABLE2_OFF,       RF_POWER,
-       RF_PA_TABLE1_OFF,       RF_POWER,
-       RF_PA_TABLE0_OFF,       RF_POWER,
-
-       RF_FSCTRL1_OFF,         (IF_FREQ_CONTROL << RF_FSCTRL1_FREQ_IF_SHIFT),
-       RF_FSCTRL0_OFF,         (0 << RF_FSCTRL0_FREQOFF_SHIFT),
-
-       RF_MDMCFG3_OFF,         (DRATE_M << RF_MDMCFG3_DRATE_M_SHIFT),
-       RF_MDMCFG2_OFF,         (RF_MDMCFG2_DEM_DCFILT_ON |
-                                RF_MDMCFG2_MOD_FORMAT_GFSK |
-                                RF_MDMCFG2_SYNC_MODE_15_16),
-       RF_MDMCFG1_OFF,         (RF_MDMCFG1_FEC_EN |
-                                RF_MDMCFG1_NUM_PREAMBLE_4 |
-                                (2 << RF_MDMCFG1_CHANSPC_E_SHIFT)),
-       RF_MDMCFG0_OFF,         (17 << RF_MDMCFG0_CHANSPC_M_SHIFT),
-
-       RF_CHANNR_OFF,          0,
-
-       /* SmartRF says set LODIV_BUF_CURRENT_TX to 0
-        * And, we're not using power ramping, so use PA_POWER 0
-        */
-       RF_FREND0_OFF,          ((1 << RF_FREND0_LODIV_BUF_CURRENT_TX_SHIFT) |
-                                (0 << RF_FREND0_PA_POWER_SHIFT)),
-
-       RF_FREND1_OFF,          ((1 << RF_FREND1_LNA_CURRENT_SHIFT) |
-                                (1 << RF_FREND1_LNA2MIX_CURRENT_SHIFT) |
-                                (1 << RF_FREND1_LODIV_BUF_CURRENT_RX_SHIFT) |
-                                (2 << RF_FREND1_MIX_CURRENT_SHIFT)),
-
-       RF_FSCAL3_OFF,          0xE9,
-       RF_FSCAL2_OFF,          0x0A,
-       RF_FSCAL1_OFF,          0x00,
-       RF_FSCAL0_OFF,          0x1F,
-
-       RF_TEST2_OFF,           RF_TEST2_RX_LOW_DATA_RATE_MAGIC,
-       RF_TEST1_OFF,           RF_TEST1_RX_LOW_DATA_RATE_MAGIC,
-       RF_TEST0_OFF,           0x09,
-
-       /* default sync values */
-       RF_SYNC1_OFF,           0xD3,
-       RF_SYNC0_OFF,           0x91,
-
-       /* max packet length */
-       RF_PKTCTRL1_OFF,        ((1 << PKTCTRL1_PQT_SHIFT)|
-                                PKTCTRL1_APPEND_STATUS|
-                                PKTCTRL1_ADR_CHK_NONE),
-       RF_PKTCTRL0_OFF,        (RF_PKTCTRL0_WHITE_DATA|
-                                RF_PKTCTRL0_PKT_FORMAT_NORMAL|
-                                RF_PKTCTRL0_CRC_EN|
-                                RF_PKTCTRL0_LENGTH_CONFIG_FIXED),
-       RF_ADDR_OFF,            0x00,
-       RF_MCSM2_OFF,           (RF_MCSM2_RX_TIME_END_OF_PACKET),
-       RF_MCSM1_OFF,           (RF_MCSM1_CCA_MODE_RSSI_BELOW_UNLESS_RECEIVING|
-                                RF_MCSM1_RXOFF_MODE_IDLE|
-                                RF_MCSM1_TXOFF_MODE_IDLE),
-       RF_MCSM0_OFF,           (RF_MCSM0_FS_AUTOCAL_FROM_IDLE|
-                                RF_MCSM0_MAGIC_3|
-                                RF_MCSM0_CLOSE_IN_RX_0DB),
-       RF_FOCCFG_OFF,          (RF_FOCCFG_FOC_PRE_K_3K,
-                                RF_FOCCFG_FOC_POST_K_PRE_K,
-                                RF_FOCCFG_FOC_LIMIT_BW_OVER_4),
-       RF_BSCFG_OFF,           (RF_BSCFG_BS_PRE_K_2K|
-                                RF_BSCFG_BS_PRE_KP_3KP|
-                                RF_BSCFG_BS_POST_KI_PRE_KI|
-                                RF_BSCFG_BS_POST_KP_PRE_KP|
-                                RF_BSCFG_BS_LIMIT_0),
-       RF_AGCCTRL2_OFF,        (RF_AGCCTRL2_MAX_DVGA_GAIN_ALL|
-                                RF_AGCCTRL2_MAX_LNA_GAIN_0|
-                                RF_AGCCTRL2_MAGN_TARGET_33dB),
-       RF_AGCCTRL1_OFF,        (RF_AGCCTRL1_AGC_LNA_PRIORITY_0 |
-                                RF_AGCCTRL1_CARRIER_SENSE_REL_THR_DISABLE |
-                                RF_AGCCTRL1_CARRIER_SENSE_ABS_THR_0DB),
-       RF_AGCCTRL0_OFF,        (RF_AGCCTRL0_HYST_LEVEL_NONE |
-                                RF_AGCCTRL0_WAIT_TIME_8 |
-                                RF_AGCCTRL0_AGC_FREEZE_NORMAL |
-                                RF_AGCCTRL0_FILTER_LENGTH_8),
-       RF_IOCFG2_OFF,          0x00,
-       RF_IOCFG1_OFF,          0x00,
-       RF_IOCFG0_OFF,          0x00,
-};
-
-static __code uint8_t rdf_setup[] = {
-       RF_MDMCFG4_OFF,         ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-                                (CHANBW_M_384 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-                                (RDF_DRATE_E << RF_MDMCFG4_DRATE_E_SHIFT)),
-       RF_MDMCFG3_OFF,         (RDF_DRATE_M << RF_MDMCFG3_DRATE_M_SHIFT),
-       RF_MDMCFG2_OFF,         (RF_MDMCFG2_DEM_DCFILT_OFF |
-                                RF_MDMCFG2_MOD_FORMAT_GFSK |
-                                RF_MDMCFG2_SYNC_MODE_NONE),
-       RF_MDMCFG1_OFF,         (RF_MDMCFG1_FEC_DIS |
-                                RF_MDMCFG1_NUM_PREAMBLE_2 |
-                                (2 << RF_MDMCFG1_CHANSPC_E_SHIFT)),
-
-       RF_DEVIATN_OFF,         ((RDF_DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) |
-                                (RDF_DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)),
-
-       /* packet length is set in-line */
-       RF_PKTCTRL1_OFF,        ((0 << PKTCTRL1_PQT_SHIFT)|
-                                PKTCTRL1_ADR_CHK_NONE),
-       RF_PKTCTRL0_OFF,        (RF_PKTCTRL0_PKT_FORMAT_NORMAL|
-                                RF_PKTCTRL0_LENGTH_CONFIG_FIXED),
-};
-
-static __code uint8_t fixed_pkt_setup[] = {
-#if !HAS_RADIO_RATE
-       RF_MDMCFG4_OFF,         ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-                                (CHANBW_M_384 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-                                (DRATE_E_384 << RF_MDMCFG4_DRATE_E_SHIFT)),
-#endif
-       RF_MDMCFG3_OFF,         (DRATE_M << RF_MDMCFG3_DRATE_M_SHIFT),
-       RF_MDMCFG2_OFF,         (RF_MDMCFG2_DEM_DCFILT_ON |
-                                RF_MDMCFG2_MOD_FORMAT_GFSK |
-                                RF_MDMCFG2_SYNC_MODE_15_16),
-       RF_MDMCFG1_OFF,         (RF_MDMCFG1_FEC_EN |
-                                RF_MDMCFG1_NUM_PREAMBLE_4 |
-                                (2 << RF_MDMCFG1_CHANSPC_E_SHIFT)),
-
-#if !HAS_RADIO_RATE
-       RF_DEVIATN_OFF,         ((DEVIATION_E_384 << RF_DEVIATN_DEVIATION_E_SHIFT) |
-                                (DEVIATION_M_384 << RF_DEVIATN_DEVIATION_M_SHIFT)),
-#endif
-
-       /* max packet length -- now set inline */
-       RF_PKTCTRL1_OFF,        ((1 << PKTCTRL1_PQT_SHIFT)|
-                                PKTCTRL1_APPEND_STATUS|
-                                PKTCTRL1_ADR_CHK_NONE),
-       RF_PKTCTRL0_OFF,        (RF_PKTCTRL0_WHITE_DATA|
-                                RF_PKTCTRL0_PKT_FORMAT_NORMAL|
-                                RF_PKTCTRL0_CRC_EN|
-                                RF_PKTCTRL0_LENGTH_CONFIG_FIXED),
-};
-
-#if HAS_RADIO_RATE
-static __code struct {
-       uint8_t         mdmcfg4;
-       uint8_t         deviatn;
-} packet_rate_setup[] = {
-       /* 38400 */
-       {
-               ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-                (CHANBW_M_384 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-                (DRATE_E_384 << RF_MDMCFG4_DRATE_E_SHIFT)),
-               ((DEVIATION_E_384 << RF_DEVIATN_DEVIATION_E_SHIFT) |
-                (DEVIATION_M_384 << RF_DEVIATN_DEVIATION_M_SHIFT)),
-       },
-       /* 9600 */
-       {
-               ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-                (CHANBW_M_96 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-                (DRATE_E_96 << RF_MDMCFG4_DRATE_E_SHIFT)),
-               ((DEVIATION_E_96 << RF_DEVIATN_DEVIATION_E_SHIFT) |
-                (DEVIATION_M_96 << RF_DEVIATN_DEVIATION_M_SHIFT)),
-       },
-       /* 2400 */
-       {
-               ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-                (CHANBW_M_24 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-                (DRATE_E_24 << RF_MDMCFG4_DRATE_E_SHIFT)),
-               ((DEVIATION_E_24 << RF_DEVIATN_DEVIATION_E_SHIFT) |
-                (DEVIATION_M_24 << RF_DEVIATN_DEVIATION_M_SHIFT)),
-       },
-};
-#endif
-
-__xdata uint8_t        ao_radio_dma;
-__xdata uint8_t ao_radio_dma_done;
-__xdata uint8_t ao_radio_done;
-__xdata uint8_t ao_radio_abort;
-__xdata uint8_t ao_radio_mutex;
-
-#if PACKET_HAS_MASTER || HAS_AES
-#define NEED_RADIO_RSSI 1
-#endif
-
-#ifndef NEED_RADIO_RSSI
-#define NEED_RADIO_RSSI 0
-#endif
-
-#if NEED_RADIO_RSSI
-__xdata int8_t ao_radio_rssi;
-#endif
-
-void
-ao_radio_general_isr(void) __interrupt 16
-{
-       S1CON &= ~0x03;
-       if (RFIF & RFIF_IM_TIMEOUT) {
-               ao_radio_recv_abort();
-               RFIF &= ~ RFIF_IM_TIMEOUT;
-       } else if (RFIF & RFIF_IM_DONE) {
-               ao_radio_done = 1;
-               ao_wakeup(&ao_radio_done);
-               RFIF &= ~RFIF_IM_DONE;
-       }
-}
-
-static void
-ao_radio_set_packet(void)
-{
-       uint8_t i;
-       for (i = 0; i < sizeof (fixed_pkt_setup); i += 2)
-               RF[fixed_pkt_setup[i]] = fixed_pkt_setup[i+1];
-}
-
-static void
-ao_radio_idle(void)
-{
-       if (RF_MARCSTATE != RF_MARCSTATE_IDLE)
-       {
-               do {
-                       RFST = RFST_SIDLE;
-                       ao_yield();
-               } while (RF_MARCSTATE != RF_MARCSTATE_IDLE);
-       }
-}
-
-#define ao_radio_put() ao_mutex_put(&ao_radio_mutex)
-
-static void
-ao_radio_get(uint8_t len)
-{
-       ao_config_get();
-       ao_mutex_get(&ao_radio_mutex);
-       ao_radio_idle();
-       RF_CHANNR = 0;
-       RF_FREQ2 = (uint8_t) (ao_config.radio_setting >> 16);
-       RF_FREQ1 = (uint8_t) (ao_config.radio_setting >> 8);
-       RF_FREQ0 = (uint8_t) (ao_config.radio_setting);
-       RF_PKTLEN = len;
-#if HAS_RADIO_RATE
-       RF_MDMCFG4 = packet_rate_setup[ao_config.radio_rate].mdmcfg4;
-       RF_DEVIATN = packet_rate_setup[ao_config.radio_rate].deviatn;
-#endif
-}
-
-
-void
-ao_radio_send(__xdata void *packet, uint8_t size) __reentrant
-{
-       ao_radio_get(size);
-       ao_radio_done = 0;
-       ao_dma_set_transfer(ao_radio_dma,
-                           packet,
-                           &RFDXADDR,
-                           size,
-                           DMA_CFG0_WORDSIZE_8 |
-                           DMA_CFG0_TMODE_SINGLE |
-                           DMA_CFG0_TRIGGER_RADIO,
-                           DMA_CFG1_SRCINC_1 |
-                           DMA_CFG1_DESTINC_0 |
-                           DMA_CFG1_PRIORITY_HIGH);
-       ao_dma_start(ao_radio_dma);
-       RFST = RFST_STX;
-       __critical while (!ao_radio_done)
-               ao_sleep(&ao_radio_done);
-       ao_radio_put();
-}
-
-uint8_t
-ao_radio_recv(__xdata void *packet, uint8_t size, uint8_t timeout) __reentrant
-{
-       ao_radio_abort = 0;
-       ao_radio_get(size - 2);
-       ao_dma_set_transfer(ao_radio_dma,
-                           &RFDXADDR,
-                           packet,
-                           size,
-                           DMA_CFG0_WORDSIZE_8 |
-                           DMA_CFG0_TMODE_SINGLE |
-                           DMA_CFG0_TRIGGER_RADIO,
-                           DMA_CFG1_SRCINC_0 |
-                           DMA_CFG1_DESTINC_1 |
-                           DMA_CFG1_PRIORITY_HIGH);
-       ao_dma_start(ao_radio_dma);
-       RFST = RFST_SRX;
-
-       /* Wait for DMA to be done, for the radio receive process to
-        * get aborted or for a receive timeout to fire
-        */
-       __critical while (!ao_radio_dma_done && !ao_radio_abort)
-                          if (ao_sleep_for(&ao_radio_dma_done, timeout))
-                                  break;
-
-       /* If recv was aborted, clean up by stopping the DMA engine
-        * and idling the radio
-        */
-       if (!ao_radio_dma_done) {
-               ao_dma_abort(ao_radio_dma);
-               ao_radio_idle();
-#if NEED_RADIO_RSSI
-               ao_radio_rssi = 0;
-#endif
-       }
-#if NEED_RADIO_RSSI
-       else
-               ao_radio_rssi = AO_RSSI_FROM_RADIO(((uint8_t *)packet)[size - 2]);
-#endif
-       ao_radio_put();
-       return ao_radio_dma_done;
-}
-
-/*
- * Wake up a task waiting to receive a radio packet
- * and tell them to abort the transfer
- */
-
-void
-ao_radio_recv_abort(void)
-{
-       ao_radio_abort = 1;
-       ao_wakeup(&ao_radio_dma_done);
-}
-
-__code ao_radio_rdf_value = 0x55;
-
-static void
-ao_radio_rdf_start(void)
-{
-       uint8_t i;
-       ao_radio_abort = 0;
-       ao_radio_get(AO_RADIO_RDF_LEN);
-       ao_radio_done = 0;
-       for (i = 0; i < sizeof (rdf_setup); i += 2)
-               RF[rdf_setup[i]] = rdf_setup[i+1];
-}
-
-static void
-ao_radio_rdf_run(void)
-{
-       ao_dma_start(ao_radio_dma);
-       RFST = RFST_STX;
-       __critical while (!ao_radio_done && !ao_radio_abort)
-                          ao_sleep(&ao_radio_done);
-       if (!ao_radio_done) {
-               ao_dma_abort(ao_radio_dma);
-               ao_radio_idle();
-       }
-       ao_radio_set_packet();
-       ao_radio_put();
-}
-
-void
-ao_radio_rdf(void)
-{
-       ao_radio_rdf_start();
-
-       ao_dma_set_transfer(ao_radio_dma,
-                           CODE_TO_XDATA(&ao_radio_rdf_value),
-                           &RFDXADDR,
-                           AO_RADIO_RDF_LEN,
-                           DMA_CFG0_WORDSIZE_8 |
-                           DMA_CFG0_TMODE_SINGLE |
-                           DMA_CFG0_TRIGGER_RADIO,
-                           DMA_CFG1_SRCINC_0 |
-                           DMA_CFG1_DESTINC_0 |
-                           DMA_CFG1_PRIORITY_HIGH);
-       ao_radio_rdf_run();
-}
-
-#define PA     0x00
-#define BE     0x55
-
-#define CONT_PAUSE_8   PA, PA, PA, PA, PA, PA, PA, PA
-#define CONT_PAUSE_16  CONT_PAUSE_8, CONT_PAUSE_8
-#define CONT_PAUSE_24  CONT_PAUSE_16, CONT_PAUSE_8
-
-#define CONT_BEEP_8    BE, BE, BE, BE, BE, BE, BE, BE
-
-#if AO_RADIO_CONT_PAUSE_LEN == 24
-#define CONT_PAUSE     CONT_PAUSE_24
-#endif
-
-#if AO_RADIO_CONT_TONE_LEN == 8
-#define CONT_BEEP              CONT_BEEP_8
-#define CONT_PAUSE_SHORT       CONT_PAUSE_8
-#endif
-
-#define CONT_ADDR(c)   CODE_TO_XDATA(&ao_radio_cont[(3-(c)) * (AO_RADIO_CONT_PAUSE_LEN + AO_RADIO_CONT_TONE_LEN)])
-
-__code uint8_t ao_radio_cont[] = {
-       CONT_PAUSE, CONT_BEEP,
-       CONT_PAUSE, CONT_BEEP,
-       CONT_PAUSE, CONT_BEEP,
-       CONT_PAUSE, CONT_PAUSE_SHORT,
-       CONT_PAUSE, CONT_PAUSE_SHORT,
-       CONT_PAUSE,
-};
-
-void
-ao_radio_continuity(uint8_t c)
-{
-       ao_radio_rdf_start();
-       ao_dma_set_transfer(ao_radio_dma,
-                           CONT_ADDR(c),
-                           &RFDXADDR,
-                           AO_RADIO_CONT_TOTAL_LEN,
-                           DMA_CFG0_WORDSIZE_8 |
-                           DMA_CFG0_TMODE_SINGLE |
-                           DMA_CFG0_TRIGGER_RADIO,
-                           DMA_CFG1_SRCINC_1 |
-                           DMA_CFG1_DESTINC_0 |
-                           DMA_CFG1_PRIORITY_HIGH);
-       ao_radio_rdf_run();
-}
-
-void
-ao_radio_rdf_abort(void)
-{
-       ao_radio_abort = 1;
-       ao_wakeup(&ao_radio_done);
-}
-
-
-/* Output carrier */
-
-static __xdata radio_test_on;
-
-void
-ao_radio_test(uint8_t on)
-{
-       if (on) {
-               if (!radio_test_on) {
-#if HAS_MONITOR
-                       ao_monitor_disable();
-#endif
-#if PACKET_HAS_SLAVE
-                       ao_packet_slave_stop();
-#endif
-#if HAS_PAD
-                       ao_pad_disable();
-#endif
-                       ao_radio_get(0xff);
-                       RFST = RFST_STX;
-                       radio_test_on = 1;
-               }
-       } else  {
-               if (radio_test_on) {
-                       ao_radio_idle();
-                       ao_radio_put();
-                       radio_test_on = 0;
-#if HAS_MONITOR
-                       ao_monitor_enable();
-#endif
-#if HAS_PAD
-                       ao_pad_enable();
-#endif
-               }
-       }
-}
-
-static void
-ao_radio_test_cmd(void)
-{
-       uint8_t mode = 2;
-       static __xdata radio_on;
-       ao_cmd_white();
-       if (ao_cmd_lex_c != '\n') {
-               ao_cmd_decimal();
-               mode = (uint8_t) ao_cmd_lex_u32;
-       }
-       mode++;
-       if ((mode & 2))
-               ao_radio_test(1);
-       if (mode == 3) {
-               printf ("Hit a character to stop..."); flush();
-               getchar();
-               putchar('\n');
-       }
-       if ((mode & 1))
-               ao_radio_test(0);
-}
-
-#if AO_RADIO_REG_TEST
-static void
-ao_radio_set_reg(void)
-{
-       uint8_t offset;
-       ao_cmd_hex();
-       offset = ao_cmd_lex_i;
-       if (ao_cmd_status != ao_cmd_success)
-               return;
-       ao_cmd_hex();
-       printf("RF[%x] %x", offset, RF[offset]);
-       if (ao_cmd_status == ao_cmd_success) {
-               RF[offset] = ao_cmd_lex_i;
-               printf (" -> %x", RF[offset]);
-       }
-       ao_cmd_status = ao_cmd_success;
-       printf("\n");
-}
-#endif
-
-__code struct ao_cmds ao_radio_cmds[] = {
-       { ao_radio_test_cmd,    "C <1 start, 0 stop, none both>\0Radio carrier test" },
-#if AO_RADIO_REG_TEST
-       { ao_radio_set_reg,     "V <offset> <value>\0Set radio register" },
-#endif
-       { 0,    NULL },
-};
-
-void
-ao_radio_init(void)
-{
-       uint8_t i;
-       for (i = 0; i < sizeof (radio_setup); i += 2)
-               RF[radio_setup[i]] = radio_setup[i+1];
-       ao_radio_set_packet();
-       ao_radio_dma_done = 1;
-       ao_radio_dma = ao_dma_alloc(&ao_radio_dma_done);
-       RFIF = 0;
-       RFIM = RFIM_IM_TIMEOUT|RFIM_IM_DONE;
-       IEN2 |= IEN2_RFIE;
-       ao_cmd_register(&ao_radio_cmds[0]);
-}
diff --git a/src/cc1111/ao_reboot.c b/src/cc1111/ao_reboot.c
deleted file mode 100644 (file)
index 6e1de7a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-/* Use the watchdog timer to force a complete reboot
- */
-void
-ao_reboot(void)
-{
-       WDCTL = WDCTL_EN | WDCTL_MODE_WATCHDOG | WDCTL_INT_32768;
-       ao_delay(AO_SEC_TO_TICKS(2));
-       ao_panic(AO_PANIC_REBOOT);
-}
diff --git a/src/cc1111/ao_romconfig.c b/src/cc1111/ao_romconfig.c
deleted file mode 100644 (file)
index abd51b2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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/cc1111/ao_serial.c b/src/cc1111/ao_serial.c
deleted file mode 100644 (file)
index 70293b4..0000000
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright © 2009 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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"
-
-const __code struct ao_serial_speed ao_serial_speeds[] = {
-       /* [AO_SERIAL_SPEED_4800] = */ {
-               /* .baud = */ 163,
-               /* .gcr  = */ (7 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
-       },
-       /* [AO_SERIAL_SPEED_9600] = */ {
-               /* .baud = */ 163,
-               /* .gcr  = */ (8 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
-       },
-       /* [AO_SERIAL_SPEED_19200] = */ {
-               /* .baud = */ 163,
-               /* .gcr  = */ (9 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
-       },
-       /* [AO_SERIAL_SPEED_57600] = */ {
-               /* .baud = */ 59,
-               /* .gcr =  */ (11 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
-       },
-       /* [AO_SERIAL_SPEED_115200] = */ {
-               /* .baud = */ 59,
-               /* .gcr =  */ (12 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
-       },
-};
-
-#define AO_SERIAL_SPEED_MAX    AO_SERIAL_SPEED_115200
-
-#if HAS_SERIAL_1_ALT_1
-#define SERIAL_1_RTS P0_3
-#else
-#define SERIAL_1_RTS P1_5
-#endif
-
-#if HAS_SERIAL_0_ALT_1
-#define SERIAL_0_RTS P0_5
-#else
-#define SERIAL_0_RTS P1_3
-#endif
-
-#if HAS_SERIAL_0
-
-volatile __xdata struct ao_fifo        ao_serial0_rx_fifo;
-volatile __xdata struct ao_fifo        ao_serial0_tx_fifo;
-
-void
-ao_serial0_rx_isr(void) __interrupt 2
-{
-       if (!ao_fifo_full(ao_serial0_rx_fifo))
-               ao_fifo_insert(ao_serial0_rx_fifo, U0DBUF);
-       ao_wakeup(&ao_serial0_rx_fifo);
-#if USE_SERIAL_0_STDIN
-       ao_wakeup(&ao_stdin_ready);
-#endif
-#if HAS_SERIAL_0_HW_FLOW
-       if (ao_fifo_mostly(ao_serial0_rx_fifo))
-               SERIAL_0_RTS = 1;
-#endif
-}
-
-static __xdata uint8_t ao_serial0_tx_started;
-
-static void
-ao_serial0_tx_start(void)
-{
-       if (!ao_fifo_empty(ao_serial0_tx_fifo) &&
-           !ao_serial0_tx_started)
-       {
-               ao_serial0_tx_started = 1;
-               ao_fifo_remove(ao_serial0_tx_fifo, U0DBUF);
-       }
-}
-
-void
-ao_serial0_tx_isr(void) __interrupt 7
-{
-       UTX0IF = 0;
-       ao_serial0_tx_started = 0;
-       ao_serial0_tx_start();
-       ao_wakeup(&ao_serial0_tx_fifo);
-}
-
-char
-ao_serial0_getchar(void) __critical
-{
-       char    c;
-       while (ao_fifo_empty(ao_serial0_rx_fifo))
-               ao_sleep(&ao_serial0_rx_fifo);
-       ao_fifo_remove(ao_serial0_rx_fifo, c);
-#if HAS_SERIAL_0_HW_FLOW
-       if (ao_fifo_barely(ao_serial0_rx_fifo))
-               SERIAL_0_RTS = 0;
-#endif
-       return c;
-}
-
-#if USE_SERIAL_0_STDIN
-int
-_ao_serial0_pollchar(void)
-{
-       uint8_t c;
-       if (ao_fifo_empty(ao_serial0_rx_fifo))
-               return AO_READ_AGAIN;
-       ao_fifo_remove(ao_serial0_rx_fifo,c);
-#if HAS_SERIAL_0_HW_FLOW
-       if (ao_fifo_barely(ao_serial0_rx_fifo))
-               SERIAL_0_RTS = 0;
-#endif
-       return c;
-}
-#endif
-
-void
-ao_serial0_putchar(char c) __critical
-{
-       while (ao_fifo_full(ao_serial0_tx_fifo))
-               ao_sleep(&ao_serial0_tx_fifo);
-       ao_fifo_insert(ao_serial0_tx_fifo, c);
-       ao_serial0_tx_start();
-}
-
-void
-ao_serial0_drain(void) __critical
-{
-       while (!ao_fifo_empty(ao_serial0_tx_fifo))
-               ao_sleep(&ao_serial0_tx_fifo);
-}
-
-void
-ao_serial0_set_speed(uint8_t speed)
-{
-       ao_serial0_drain();
-       if (speed > AO_SERIAL_SPEED_MAX)
-               return;
-       U0UCR |= UxUCR_FLUSH;
-       U0BAUD = ao_serial_speeds[speed].baud;
-       U0GCR = ao_serial_speeds[speed].gcr;
-}
-#endif /* HAS_SERIAL_0 */
-
-#if HAS_SERIAL_1
-
-volatile __xdata struct ao_fifo        ao_serial1_rx_fifo;
-volatile __xdata struct ao_fifo        ao_serial1_tx_fifo;
-
-void
-ao_serial1_rx_isr(void) __interrupt 3
-{
-       if (!ao_fifo_full(ao_serial1_rx_fifo))
-               ao_fifo_insert(ao_serial1_rx_fifo, U1DBUF);
-       ao_wakeup(&ao_serial1_rx_fifo);
-#if USE_SERIAL_1_STDIN
-       ao_wakeup(&ao_stdin_ready);
-#endif
-#if HAS_SERIAL_1_HW_FLOW
-       if (ao_fifo_mostly(ao_serial1_rx_fifo))
-               SERIAL_1_RTS = 1;
-#endif
-}
-
-static __xdata uint8_t ao_serial1_tx_started;
-
-static void
-ao_serial1_tx_start(void)
-{
-       if (!ao_fifo_empty(ao_serial1_tx_fifo) &&
-           !ao_serial1_tx_started)
-       {
-               ao_serial1_tx_started = 1;
-               ao_fifo_remove(ao_serial1_tx_fifo, U1DBUF);
-       }
-}
-
-void
-ao_serial1_tx_isr(void) __interrupt 14
-{
-       UTX1IF = 0;
-       ao_serial1_tx_started = 0;
-       ao_serial1_tx_start();
-       ao_wakeup(&ao_serial1_tx_fifo);
-}
-
-char
-ao_serial1_getchar(void) __critical
-{
-       char    c;
-       while (ao_fifo_empty(ao_serial1_rx_fifo))
-               ao_sleep(&ao_serial1_rx_fifo);
-       ao_fifo_remove(ao_serial1_rx_fifo, c);
-#if HAS_SERIAL_1_HW_FLOW
-       if (ao_fifo_barely(ao_serial1_rx_fifo))
-               SERIAL_1_RTS