use new overclock.elf

This commit is contained in:
Shaun Inman 2023-03-18 21:04:14 -04:00
parent 2e6a5f722f
commit 3e26e6e854
5 changed files with 19 additions and 30 deletions

View file

@ -1311,7 +1311,6 @@ static void* POW_monitorBattery(void *arg) {
void POW_init(void) {
pow.can_poweroff = 1;
pow.previous_speed = CPU_SPEED_NORMAL;
pow.can_autosleep = 1;
pow.should_warn = 0;
pow.charge = POW_LOW_CHARGE;
@ -1430,12 +1429,11 @@ void POW_powerOff(void) {
}
#define BACKLIGHT_PATH "/sys/class/backlight/backlight.2/bl_power"
#define CPU_SPEED_SET_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
#define CPU_SPEED_GET_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
void POW_setCPUSpeed(int speed) {
putInt(CPU_SPEED_SET_PATH, speed);
sync();
char cmd[32];
sprintf(cmd,"overclock.elf %d\n", speed);
system(cmd);
}
static void POW_enterSleep(void) {
@ -1443,9 +1441,6 @@ static void POW_enterSleep(void) {
putInt(BACKLIGHT_PATH, FB_BLANK_POWERDOWN);
system("killall -STOP keymon.elf");
// TODO: not sure this is necessary
// pow.previous_speed = getInt(CPU_SPEED_GET_PATH);
// POW_setCPUSpeed(CPU_SPEED_MENU);
sync();
}
static void POW_exitSleep(void) {
@ -1454,9 +1449,6 @@ static void POW_exitSleep(void) {
putInt(BACKLIGHT_PATH, FB_BLANK_UNBLANK);
SetVolume(GetVolume());
// TODO: not sure this is necessary
// POW_setCPUSpeed(pow.previous_speed);
sync();
}
static void POW_waitForWake(void) {

View file

@ -9,11 +9,6 @@ FLAG_PATH=/misc/.minstalled
echo "installing/updating"
# old rootfs.img (alpha-only)
if [ -f $SYSTEM_PATH/rootfs.img ]; then
rm $SYSTEM_PATH/rootfs.img
fi
if [ ! -f $FLAG_PATH ]; then
echo "backing up"
BAK_PATH=$TF1_PATH/bak

View file

@ -65,7 +65,6 @@ static struct cpu_opp {
int volt;
char* desc;
} cpu_opps[] = {
{ CLKMAX, VOLTMAX}, // just a smidge above 1.5GHz
{1488000, 1375000}, // 1.5GHz, MinUI Performance + launch
{1392000, 1325000}, // 1.4GHz
{1296000, 1275000}, // 1.3GHz, MinUI Normal
@ -74,7 +73,7 @@ static struct cpu_opp {
{1008000, 1100000}, // 1.0GHz, Anbernic default max, overvolted to stabilize
{ 840000, 1075000}, // 840MHz, overvolted to stabilize
{ 720000, 1025000}, // 720MHz, overvolted to stabilize
{ 504000, 1000000}, // 500MHz, overvolted to stabilize, MinUI Menus
{ 504000, 1000000}, // 500MHz, overvolted to stabilize, MinUI menus
{ 240000, 975000}, // 240MHz, overvolted to stabilize
{ 0, 0},
};
@ -101,10 +100,10 @@ int main(int argc, char* argv[]) {
if (clk>=cpu->clk) {
setcpu( cpu->clk, cpu->volt );
// TODO: this doesn't work...
// char cmd[128];
// sprintf(cmd, "echo %i > /tmp/cpu_freq", cpu->clk);
// puts(cmd);
// system(cmd);
char cmd[128];
sprintf(cmd, "echo %i > /tmp/cpu_freq\n", cpu->clk);
puts(cmd);
system(cmd);
break;
}
}