Update main.c print battery_saver_chack()

beta-v1.3.2-battery-saver-2
Alan Johnston 2 years ago committed by GitHub
parent 7c107b26e7
commit 326b57db66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -814,7 +814,7 @@ int main(int argc, char * argv[]) {
fprintf(stderr, "INFO: Battery voltage: %5.2f V Threshold %5.2f V Current: %6.1f mA Threshold: %6.1f mA\n", batteryVoltage, voltageThreshold, batteryCurrent, currentThreshold); fprintf(stderr, "INFO: Battery voltage: %5.2f V Threshold %5.2f V Current: %6.1f mA Threshold: %6.1f mA\n", batteryVoltage, voltageThreshold, batteryCurrent, currentThreshold);
#endif #endif
// if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V // if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V
printf("battery_saver_check() : %d \n", battery_saver_check());
/**/ /**/
#ifndef HAB #ifndef HAB
if ((batteryCurrent > currentThreshold) && (batteryVoltage < (voltageThreshold + 0.15)) && !sim_mode) if ((batteryCurrent > currentThreshold) && (batteryVoltage < (voltageThreshold + 0.15)) && !sim_mode)
@ -2250,7 +2250,6 @@ int battery_saver_check() {
} }
void battery_saver(int setting) { void battery_saver(int setting) {
return;
if (setting == ON) { if (setting == ON) {
FILE *command = popen("touch /home/pi/CubeSatSim/battery_saver", "r"); FILE *command = popen("touch /home/pi/CubeSatSim/battery_saver", "r");
pclose(command); pclose(command);

Loading…
Cancel
Save

Powered by TurnKey Linux.