Skip to content

Commit

Permalink
SDL to framebuffer overlay + CPU clock hotkeys (#1740)
Browse files Browse the repository at this point in the history
SDL to framebuffer overlay + CPU clock hotkeys

---------

Co-authored-by: Aemiii91 <[email protected]>
Co-authored-by: Kevin Weichel <[email protected]>
  • Loading branch information
3 people authored Dec 30, 2024
1 parent 1ef1d0f commit 7b742e1
Show file tree
Hide file tree
Showing 15 changed files with 792 additions and 144 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ src/**/tree
!tree/
src/**/pippi
!pippi/
src/**/cpuclock
!cpuclock/
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ core: $(CACHE)/.setup
@cd $(SRC_DIR)/sendUDP && BUILD_DIR=$(BIN_DIR) make
@cd $(SRC_DIR)/tree && BUILD_DIR=$(BIN_DIR) make
@cd $(SRC_DIR)/pippi && BUILD_DIR=$(BIN_DIR) make
@cd $(SRC_DIR)/cpuclock && BUILD_DIR=$(BIN_DIR) make

# Build dependencies for installer
@mkdir -p $(INSTALLER_DIR)/bin
@cd $(SRC_DIR)/installUI && BUILD_DIR=$(INSTALLER_DIR)/bin/ VERSION=$(VERSION) make
Expand Down
5 changes: 4 additions & 1 deletion src/batmon/batmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static void sigHandler(int sig)
void cleanup(void)
{
remove("/tmp/percBat");
display_free();
display_close();
close(sar_fd);
}

Expand Down Expand Up @@ -442,6 +442,8 @@ float interpolatePercentage(float voltage)
return 100;
if (voltage <= VoltageCurveMapping_liion[table_size - 1].voltage)
return 0;

return -1; // Error
}

int batteryPercentage(int adcValue)
Expand All @@ -458,6 +460,7 @@ int batteryPercentage(int adcValue)
return (int)(adcValue * 2.125 - 1068);
if (adcValue >= 480)
return (int)(adcValue * 0.51613 - 243.742);
return 0;
}

// Convert ADC value to voltage
Expand Down
Loading

0 comments on commit 7b742e1

Please sign in to comment.