Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/arm11/drivers/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ enum
KEY_WIFI = BIT(3),
KEY_SHELL = BIT(4), // Auto clears on open
KEY_BAT_CHARGING = BIT(5), // Auto clears when charging stops
KEY_VOL_SLIDER = BIT(6)
KEY_VOL_SLIDER = BIT(6),
KEY_LOW_BATTERY = BIT(7)
};

typedef struct
Expand Down
2 changes: 1 addition & 1 deletion include/arm11/drivers/mcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C"
MCU_IRQ_BATT_CHARGE_STOP | MCU_IRQ_ACC_DATA_READY | MCU_IRQ_ACC_RW_DONE | \
MCU_IRQ_WATCHDOG | MCU_IRQ_SHELL_OPEN | MCU_IRQ_SHELL_CLOSE | \
MCU_IRQ_WIFI_PRESS | MCU_IRQ_HOME_RELEASE | MCU_IRQ_HOME_PRESS | \
MCU_IRQ_POWER_HELD | MCU_IRQ_POWER_PRESS))
MCU_IRQ_POWER_HELD | MCU_IRQ_POWER_PRESS | MCU_IRQ_LOW_BATT))


typedef struct
Expand Down
4 changes: 3 additions & 1 deletion source/arm11/drivers/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
MCU_IRQ_BATT_CHARGE_STOP | MCU_IRQ_SHELL_OPEN | \
MCU_IRQ_SHELL_CLOSE | MCU_IRQ_WIFI_PRESS | \
MCU_IRQ_HOME_RELEASE | MCU_IRQ_HOME_PRESS | \
MCU_IRQ_POWER_HELD | MCU_IRQ_POWER_PRESS)
MCU_IRQ_POWER_HELD | MCU_IRQ_POWER_PRESS | \
MCU_IRQ_LOW_BATT)

#define CPAD_THRESHOLD (400)

Expand Down Expand Up @@ -75,6 +76,7 @@ static void updateMcuHidState(void)
tmp |= state>>10 & KEY_BAT_CHARGING; // Battery started charging
if(state & BIT(14)) tmp &= ~KEY_BAT_CHARGING; // Battery stopped charging
tmp |= state>>16 & KEY_VOL_SLIDER; // Volume slider update
tmp |= state>>6 & KEY_LOW_BATTERY; // Low battery notification
g_extraKeys = tmp;
}

Expand Down