“Low Battery” warning in Idle Sleep

So Proffieboard will say “Low Battery” warning if it’s in Idle Sleep when battery discharged to a certain voltage, correct? How can I disable this warning? So it didn’t do any sounds when battery dies.

To ungracefully just kill low battery warning 100% I think you could comment out

case EFFECT_LOW_BATTERY: SB_LowBatt(); return;

in hybrid_font.h.
To make it only do it once your IDLE_OFF_TIME has expired would be a few more lines making it conditional.

1 Like

or, add:

void CheckLowBattery() override {}

to your prop class.
This disables the low battery warning completely.
You could also replace that function with one that works the way you want to.
For reference, the original is here:

1 Like

Perfect, thanks guys!

ignore my hackery :man_facepalming:

Your change has the advantage of leaving the turn-saber-off-when-battery-is-low is intact though.

Just killing the audible warning, yeah.
But I like that your example shows how to get it recognized in the prop and not have to edit a system level file.

So I’m interested in something similar, (modifying prop file only, leaving the system file alone).
Self-teaching briefly, it seems a derived class and/or override of a function in hybrid_font is not as easy since the quoted suggestion involves the Propbase class, whereas hybrid_font is Saberbase.

How could I “override” the SB_LowBatt() in hybrid_font from within a prop file?

I don’t think there is a way to do that.

1 Like

I know this post is nearly 3 years old but I’m so thankful this post was made. I’ll definitely have a use for this on a saberforge bushido I just installed using a fixed 18650, proffie v3 and USB-C port for charging and data transfer.

Granted the battery drain is really good with the idle off define but this will help avoid any annoying “low battery” alarms in the future

After a bit of trial and error I believe I figured out what needed to be done.

Was just adding void before CheckLowBattery() ; what it needed?

This is on the most recent ProffieOS 7.14

Not quite.
CheckLowBattery() is a call to the function that is in prop_base.h that starts with
virtual void CheckLowBattery() {
The lines about if battery monitor is low and stuff that follow are executed when that call is issued.
Because it’s a virtual function, it can be overridden in the prop file by redefining it but adding override to the new version like
void CheckLowBattery() override {
Then different (or none) commands can be put in there to be used instead .

I’ve tried a ton of different ways to do this and I’m not having any luck compiling this aside from just adding void to the call function on line 1096. Would you be able to tell me what I need to add to these lines of code, as it is here it compiles no problem but as soon as I add override to anything it doesn’t compile at all

lines 1047-1058
virtual void CheckLowBattery() {
if (battery_monitor.low()) {
if (current_style() && !current_style()->Charging()) {
LowBatteryOff();
if (millis() - last_beep_ > 15000) { // (was 5000)
STDOUT << “Low battery: " << battery_monitor.battery() << " volts\n”;
SaberBase::DoLowBatt();
last_beep_ = millis();
}
}
}
}

Line 1096
CheckLowBattery() ;

What is the goal?

Same as shtoks original post, just to be able to disable the “low battery” warning when it is low battery

So, modifying the prop is really only easier if you’re making a prop anyways.
If you’re just looking to nerf proffieOS a little, see the second post from the top.