Skip to content

Commit

Permalink
Provide a configurable mechanism to disable sleeping
Browse files Browse the repository at this point in the history
  • Loading branch information
jpieper committed Apr 3, 2024
1 parent e39d546 commit f61bb16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fw/power_dist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,12 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
public:
struct Config {
float current_sense_ohm = 0.0005f;
bool disable_sleep = false;

template <typename Archive>
void Serialize(Archive* a) {
a->Visit(MJ_NVP(current_sense_ohm));
a->Visit(MJ_NVP(disable_sleep));
}
};

Expand Down Expand Up @@ -902,7 +904,8 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
switch_led_.write(0);
override_pwr_.write(0);
led1_.write(1);
override_3v3_.write(status_.shutdown_timeout_ms > 0);
override_3v3_.write(config_.disable_sleep ||
status_.shutdown_timeout_ms > 0);
break;
}
case kPrecharging: {
Expand Down

0 comments on commit f61bb16

Please sign in to comment.