Check for pin P2_2 low at startup and set the frequency to
434.550MHz. This value won't get written to flash, so rebooting again
will restore the configured frequency.
Signed-off-by: Keith Packard <keithp@keithp.com>
#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
* ao_config.c
*/
+#if HAS_FORCE_FREQ
+/*
+ * Set this to force the frequency to 434.550MHz
+ */
+extern __xdata uint8_t ao_force_freq;
+#endif
+
#define AO_CONFIG_MAJOR 1
#define AO_CONFIG_MINOR 11
ao_config_dirty = 1;
}
#if HAS_RADIO
+#if HAS_FORCE_FREQ
+ if (ao_force_freq)
+ ao_config.frequency = 434550;
+#endif
ao_config_set_radio();
#endif
ao_config_loaded = 1;
#include "ao.h"
#include "ao_pins.h"
+__xdata uint8_t ao_force_freq;
+
void
main(void)
{
ao_led_init(LEDS_AVAILABLE);
ao_led_on(AO_LED_RED);
+ /* A hack -- look at the debug clock pin, if it's sitting at
+ * ground, then we force the computer to idle mode instead of
+ * flight mode
+ */
+ if (P2_2 == 0) {
+ ao_flight_force_idle = 1;
+ ao_force_freq = 1;
+ while (P2_2 == 0)
+ ;
+ }
+
ao_timer_init();
ao_adc_init();
ao_cmd_init();