kopia lustrzana https://github.com/bristol-seds/pico-tracker
Sample si temperature at end of transmissions. Fixes broken si temperature
rodzic
5fb78df303
commit
eda44e65c9
|
@ -48,6 +48,7 @@ int telemetry_active(void);
|
|||
int telemetry_start(enum telemetry_t type, int32_t length);
|
||||
int telemetry_start_rsid(rsid_code_t rsid);
|
||||
void telemetry_stop(void);
|
||||
float telemetry_si_temperature(void);
|
||||
|
||||
float timer0_tick_init(float frequency);
|
||||
void timer0_tick_frequency(float frequency);
|
||||
|
|
|
@ -134,7 +134,7 @@ void output_telemetry_string(enum telemetry_t type)
|
|||
|
||||
/* Analogue */
|
||||
float battery = get_battery();
|
||||
float temperature = si_trx_get_temperature(); // Requires control of the radio - radio on also??
|
||||
float temperature = telemetry_si_temperature();
|
||||
|
||||
/* GPS Time */
|
||||
gps_update_time();
|
||||
|
|
|
@ -111,6 +111,10 @@ uint8_t telemetry_stop_flag = 0;
|
|||
* Is the radio currently on?
|
||||
*/
|
||||
uint8_t radio_on = 0;
|
||||
/**
|
||||
* Temperature
|
||||
*/
|
||||
float _si_temperature = 128.0;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -187,6 +191,12 @@ void telemetry_stop(void) {
|
|||
telemetry_stop_flag = 1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get the SI radio temperature at the end of the last transmission.
|
||||
*/
|
||||
float telemetry_si_temperature(void) {
|
||||
return _si_temperature;
|
||||
}
|
||||
|
||||
|
||||
uint8_t is_telemetry_finished(void) {
|
||||
|
@ -197,7 +207,11 @@ uint8_t is_telemetry_finished(void) {
|
|||
|
||||
/* Turn radio off */
|
||||
if (radio_on) {
|
||||
si_trx_off(); radio_on = 0;
|
||||
si_trx_state_ready(); /* Stop RF */
|
||||
_si_temperature = si_trx_get_temperature();
|
||||
si_trx_off(); /* Shutdown */
|
||||
|
||||
radio_on = 0;
|
||||
}
|
||||
|
||||
/* De-init timer */
|
||||
|
|
Ładowanie…
Reference in New Issue