kopia lustrzana https://github.com/bristol-seds/pico-tracker
Timer tick now activated for each telemetry burst
rodzic
cbb004db7e
commit
fa4efbc79a
|
@ -315,15 +315,6 @@ int main(void)
|
|||
/* Initialise Si4060 interface */
|
||||
si_trx_init();
|
||||
|
||||
|
||||
/* Timer 0 clocks out data */
|
||||
#ifdef RTTY
|
||||
timer0_tick_init(50);
|
||||
#endif
|
||||
#ifdef CONTESTIA
|
||||
timer0_tick_init(31.25);
|
||||
#endif
|
||||
|
||||
led_on();
|
||||
|
||||
while (1) {
|
||||
|
|
|
@ -127,11 +127,17 @@ int telemetry_start(enum telemetry_t type) {
|
|||
telemetry_index = 0;
|
||||
|
||||
/* Initialise first block / character */
|
||||
|
||||
|
||||
|
||||
telemetry_string_length = TELEMETRY_STRING_MAX;
|
||||
|
||||
/* Setup timer tick */
|
||||
switch(telemetry_type) {
|
||||
case TELEMETRY_CONTESTIA:
|
||||
timer0_tick_init(31.25);
|
||||
break;
|
||||
case TELEMETRY_RTTY:
|
||||
timer0_tick_init(50);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0; /* Success */
|
||||
} else {
|
||||
|
@ -161,6 +167,9 @@ uint8_t is_telemetry_finished(void) {
|
|||
/* Turn radio off */
|
||||
si_trx_off(); radio_on = 0;
|
||||
|
||||
/* De-init timer */
|
||||
timer0_tick_deinit();
|
||||
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -285,6 +294,15 @@ void timer0_tick_init(float frequency)
|
|||
tc_enable(TC0);
|
||||
tc_start_counter(TC0);
|
||||
}
|
||||
/**
|
||||
* Disables the timer
|
||||
*/
|
||||
void timer0_tick_deinit()
|
||||
{
|
||||
tc_stop_counter(TC0);
|
||||
tc_disable(TC0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called at the symbol rate
|
||||
|
|
Ładowanie…
Reference in New Issue