don't start Timer0 if already started by Timer0_on

pico-v0.1
alanbjohnston 3 years ago committed by GitHub
parent cb119141c3
commit 5bb8fe66c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -275,7 +275,7 @@ void transmit_off() {
// if ((mode == AFSK) || (mode == FSK)) // if ((mode == AFSK) || (mode == FSK))
digitalWrite(PTT_PIN, HIGH); digitalWrite(PTT_PIN, HIGH);
// else if (mode == BPSK) { // else if (mode == BPSK) {
ITimer0.stopTimer(); // stop isr // ITimer0.stopTimer(); // stop isr
pwm_set_gpio_level(BPSK_PWM_A_PIN, 0); pwm_set_gpio_level(BPSK_PWM_A_PIN, 0);
pwm_set_gpio_level(BPSK_PWM_B_PIN, 0); pwm_set_gpio_level(BPSK_PWM_B_PIN, 0);
// } // }
@ -609,8 +609,8 @@ void get_tlm_fox() {
parse_payload(); parse_payload();
for (int n = 0; n < 17; n++) // for (int n = 0; n < 17; n++)
sensor[n] = 1.0; // sensor[n] = 1.0;
if (mode == FSK) if (mode == FSK)
id = 7; id = 7;
@ -727,14 +727,14 @@ void get_tlm_fox() {
battCurr = (int)(current[mapping[BAT]] + 0.5) + 2048; battCurr = (int)(current[mapping[BAT]] + 0.5) + 2048;
PSUVoltage = (int)(voltage[mapping[BUS]] * 100); PSUVoltage = (int)(voltage[mapping[BUS]] * 100);
PSUCurrent = (int)(current[mapping[BUS]] + 0.5) + 2048; PSUCurrent = (int)(current[mapping[BUS]] + 0.5) + 2048;
/*
Serial.print("voltage[PLUS_X] = "); Serial.print("voltage[PLUS_X] = ");
Serial.println(voltage[PLUS_X]); Serial.println(voltage[PLUS_X]);
Serial.print("voltage[mapping[PLUS_X]] = "); Serial.print("voltage[mapping[PLUS_X]] = ");
Serial.println(voltage[mapping[PLUS_X]]); Serial.println(voltage[mapping[PLUS_X]]);
Serial.print("posXv = "); Serial.print("posXv = ");
Serial.println(posXv); Serial.println(posXv);
*/
// if (payload == ON) // if (payload == ON)
STEMBoardFailure = 0; STEMBoardFailure = 0;
// read payload sensor if available // read payload sensor if available
@ -3171,7 +3171,7 @@ bool TimerHandler0(struct repeating_timer *t) {
void start_isr() { void start_isr() {
// return; // return;
if (!Timer0_on) {
Serial.println("Starting ISR"); Serial.println("Starting ISR");
pinMode(BPSK_CONTROL_A, OUTPUT); pinMode(BPSK_CONTROL_A, OUTPUT);
@ -3186,7 +3186,7 @@ void start_isr() {
} }
else else
Serial.println(F("Can't set ITimer0. Select another Timer, freq. or timer")); Serial.println(F("Can't set ITimer0. Select another Timer, freq. or timer"));
}
} }
void start_button_isr() { void start_button_isr() {

Loading…
Cancel
Save

Powered by TurnKey Linux.