10 seconds pips for UBSEDS12

ubseds12
Richard Meadows 2015-12-19 21:30:02 +00:00
rodzic 1c2b939256
commit d81a19ef78
3 zmienionych plików z 23 dodań i 17 usunięć

Wyświetl plik

@ -30,9 +30,8 @@
*/ */
#define PIPS_RATE 1 #define PIPS_RATE 1
#define PIPS_LENGTH_MS 50 #define PIPS_LENGTH_MS 200
#define PIPS_ON_FREQUENCY (1000 / PIPS_LENGTH_MS) #define PIPS_FREQUENCY (1000 / PIPS_LENGTH_MS)
#define PIPS_OFF_FREQUENCY PIPS_RATE
#endif /* PIPS_H */ #endif /* PIPS_H */

Wyświetl plik

@ -381,15 +381,12 @@ int main(void)
} }
telemetry_trigger_flag = 0; telemetry_trigger_flag = 0;
/* End pips */ /* Pips */
telemetry_stop(); telemetry_start(TELEMETRY_PIPS, 10);
while (telemetry_active()) { while (telemetry_active()) {
system_sleep(); system_sleep();
} }
/* Watchdog */
//wdt_reset_count();
/* Send the next packet */ /* Send the next packet */
output_telemetry_string(TELEMETRY_CONTESTIA); output_telemetry_string(TELEMETRY_CONTESTIA);
@ -401,8 +398,6 @@ int main(void)
/* aprs_trigger_flag = 0; */ /* aprs_trigger_flag = 0; */
/* Pips */
telemetry_start(TELEMETRY_PIPS, 0xFFFF);
/* Measure XOSC against gps timepulse */ /* Measure XOSC against gps timepulse */
measure_xosc(XOSC_MEASURE_TIMEPULSE, xosc_measure_callback); measure_xosc(XOSC_MEASURE_TIMEPULSE, xosc_measure_callback);

Wyświetl plik

@ -123,6 +123,8 @@ float _si_temperature = 128.0;
*/ */
int32_t _aprs_frequency = 0; int32_t _aprs_frequency = 0;
uint32_t pips_tick;
/** /**
* Returns 1 if we're currently outputting. * Returns 1 if we're currently outputting.
*/ */
@ -153,7 +155,8 @@ int telemetry_start(enum telemetry_t type, int32_t length) {
timer0_tick_init(RTTY_BITRATE); timer0_tick_init(RTTY_BITRATE);
break; break;
case TELEMETRY_PIPS: case TELEMETRY_PIPS:
timer0_tick_init(PIPS_OFF_FREQUENCY); pips_tick = 0;
timer0_tick_init(PIPS_FREQUENCY);
break; break;
case TELEMETRY_APRS: case TELEMETRY_APRS:
timer0_tick_init(AX25_TICK_RATE); timer0_tick_init(AX25_TICK_RATE);
@ -340,18 +343,27 @@ void telemetry_tick(void) {
case TELEMETRY_PIPS: /* ---- ---- A pips mode! */ case TELEMETRY_PIPS: /* ---- ---- A pips mode! */
if (!radio_on) { /* Turn on */ if (pips_tick == 0) { /* Turn on */
/* Pips: Cw */
si_trx_on(SI_MODEM_MOD_TYPE_CW, TELEMETRY_FREQUENCY, 1); radio_on = 1;
timer0_tick_frequency(PIPS_ON_FREQUENCY);
} else { /* Turn off */ if (!radio_on) { /* Turn on */
/* Pips: Cw */
si_trx_on(SI_MODEM_MOD_TYPE_CW, TELEMETRY_FREQUENCY, 1); radio_on = 1;
}
} else if (pips_tick == 1) { /* Turn off */
si_trx_off(); radio_on = 0; si_trx_off(); radio_on = 0;
timer0_tick_frequency(PIPS_OFF_FREQUENCY);
/* next pip */
telemetry_index++; telemetry_index++;
/* Maybe finished */
if (is_telemetry_finished()) return; if (is_telemetry_finished()) return;
} else if (pips_tick == PIPS_FREQUENCY-1) {
pips_tick = 0; break;
} }
pips_tick++;
break; break;
} }
} }