moved initialization of FSK and BPSK values

pull/116/head
alanbjohnston 5 years ago committed by GitHub
parent c5f11dda88
commit 6da1423650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -489,31 +489,7 @@ int main(int argc, char * argv[]) {
other_max[i] = -1000.0; other_max[i] = -1000.0;
} }
while (loop-- != 0) { if (mode == FSK) {
frames_sent++;
#ifdef DEBUG_LOGGING
fprintf(stderr, "INFO: Battery voltage: %f V Battery Threshold %f V\n", batteryVoltage, batteryThreshold);
#endif
if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V
{
fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage);
digitalWrite(txLed, txLedOff);
digitalWrite(onLed, onLedOff);
sleep(1);
digitalWrite(onLed, onLedOn);
sleep(1);
digitalWrite(onLed, onLedOff);
sleep(1);
digitalWrite(onLed, onLedOn);
sleep(1);
digitalWrite(onLed, onLedOff);
popen("sudo shutdown -h now > /dev/null 2>&1", "r");
sleep(10);
}
if (mode == FSK) {
bitRate = 200; bitRate = 200;
rsFrames = 1; rsFrames = 1;
payloads = 1; payloads = 1;
@ -556,6 +532,32 @@ int main(int argc, char * argv[]) {
bufLen, bufLen / (samples * frameCnt), bitRate, bufLen / (samples * frameCnt * bitRate), samplePeriod); bufLen, bufLen / (samples * frameCnt), bitRate, bufLen / (samples * frameCnt * bitRate), samplePeriod);
} }
while (loop-- != 0) {
frames_sent++;
#ifdef DEBUG_LOGGING
fprintf(stderr, "INFO: Battery voltage: %f V Battery Threshold %f V\n", batteryVoltage, batteryThreshold);
#endif
if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V
{
fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage);
digitalWrite(txLed, txLedOff);
digitalWrite(onLed, onLedOff);
sleep(1);
digitalWrite(onLed, onLedOn);
sleep(1);
digitalWrite(onLed, onLedOff);
sleep(1);
digitalWrite(onLed, onLedOn);
sleep(1);
digitalWrite(onLed, onLedOff);
popen("sudo shutdown -h now > /dev/null 2>&1", "r");
sleep(10);
}
// sleep(1); // Delay 1 second // sleep(1); // Delay 1 second
ctr = 0; ctr = 0;
#ifdef DEBUG_LOGGING #ifdef DEBUG_LOGGING
@ -1046,10 +1048,10 @@ void get_tlm_fox() {
#ifdef DEBUG_LOGGING #ifdef DEBUG_LOGGING
printf("Tx LED On\n"); printf("Tx LED On\n");
#endif #endif
/*
while ((millis() - sampleTime) < (unsigned int)samplePeriod) while ((millis() - sampleTime) < (unsigned int)samplePeriod)
sleep((unsigned int)sleepTime); sleep((unsigned int)sleepTime);
*/
digitalWrite(txLed, txLedOff); digitalWrite(txLed, txLedOff);
#ifdef DEBUG_LOGGING #ifdef DEBUG_LOGGING
printf("Tx LED Off\n"); printf("Tx LED Off\n");

Loading…
Cancel
Save

Powered by TurnKey Linux.