![]() | ||
Views: 1,579,275 | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 09-01-24 01:56 AM |
Guest: |
Main - Posts by kasai07 |
kasai07 |
| ||
Newcomer Normal user Level: 5 Posts: 1/3 EXP: 280 Next: 249 Since: 09-10-16 Last post: 2911 days ago Last view: 2894 days ago |
Hello
sorry for my english i'm french and I do not know too much English here's what I did size_t HID_Flag()
{ return i2cReadRegister(I2C_DEV_MCU, 0x10); } size_t Level3D() { return i2cReadRegister(I2C_DEV_MCU, 0x08); } size_t VolumeLevel() { return i2cReadRegister(I2C_DEV_MCU, 0x09); } size_t BatteryLevel() { return i2cReadRegister(I2C_DEV_MCU, 0x0B); } #define BUTTON_POWER 1
#define BUTTON_HOME 8 #define BUTTON_WIFI10 u32 padflag_state; u32 InputWait() { static u64 delay = 0; u32 pad_state_old = HID_STATE; delay = (delay) ? 72 : 128; timer_start(); u32 HIDFlag = 0; while (true) { padflag_state = 0; HIDFlag = HID_Flag(); if (HIDFlag == 0x01){padflag_state = BUTTON_POWER;return 0;} if (HIDFlag == 0x04){padflag_state = BUTTON_HOME;return 0;} if (HIDFlag == 0x10){padflag_state = BUTTON_WIFI;return 0;} u32 pad_state = HID_STATE; if (!(~pad_state & BUTTON_ANY)) { // no buttons pressed pad_state_old = pad_state; delay = 0; continue; } if ((pad_state == pad_state_old) && (!(~pad_state & BUTTON_ARROW) || (delay && (timer_msec() < delay)))) continue; //Make sure the key is pressed u32 t_pressed = 0; for(; (t_pressed < 0x13000) && (pad_state == HID_STATE); t_pressed++); if (t_pressed >= 0x13000)return ~pad_state; } } } else if (padflag_state == BUTTON_POWER) { DeinitFS(); PowerOff(); } else if (padflag_state == BUTTON_HOME) { DeinitFS(); Reboot(); } |
kasai07 |
| ||
Newcomer Normal user Level: 5 Posts: 2/3 EXP: 280 Next: 249 Since: 09-10-16 Last post: 2911 days ago Last view: 2894 days ago |
Hello
sorry for my english i'm french and I do not know too much English here's what I did Code HID for A9LH "fs.c"
size_t Level3D() { return i2cReadRegister(I2C_DEV_MCU, 0x08); } size_t VolumeLevel() { return i2cReadRegister(I2C_DEV_MCU, 0x09); } size_t HID_Flag() { return i2cReadRegister(I2C_DEV_MCU, 0x10); } size_t BatteryLevel() { return i2cReadRegister(I2C_DEV_MCU, 0x0B); } "hid.h"
#define BUTTON_POWER 1 #define BUTTON_HOME 2 #define BUTTON_WIFI 3 u32 padflag_state; "hid.c" u32 InputWait() { static u64 delay = 0; u32 pad_state_old = HID_STATE; delay = (delay) ? 72 : 128; timer_start(); u32 HIDFlag = 0; while (true) { padflag_state = 0; HIDFlag = HID_Flag(); if (HIDFlag == 0x01){ padflag_state = BUTTON_POWER; return 0; } if (HIDFlag == 0x04){ padflag_state = BUTTON_HOME; return 0; } if (HIDFlag == 0x10){ padflag_state = BUTTON_WIFI; return 0; } u32 pad_state = HID_STATE; if (!(~pad_state & BUTTON_ANY)) { // no buttons pressed pad_state_old = pad_state; delay = 0; continue; } if ((pad_state == pad_state_old) && (!(~pad_state & BUTTON_ARROW) || (delay && (timer_msec() < delay)))) continue; //Make sure the key is pressed u32 t_pressed = 0; for(; (t_pressed < 0x13000) && (pad_state == HID_STATE); t_pressed++); if (t_pressed >= 0x13000)return ~pad_state; } } "menu.c"
missing buttons works
} else if (padflag_state == BUTTON_POWER) { DeinitFS(); PowerOff(); } else if (padflag_state == BUTTON_HOME) { DeinitFS(); Reboot(); } http://3dbrew.org/wiki/I2C_Registers |
kasai07 |
| ||
Newcomer Normal user Level: 5 Posts: 3/3 EXP: 280 Next: 249 Since: 09-10-16 Last post: 2911 days ago Last view: 2894 days ago |
sorry it worked before but not the stop button and home |
Main - Posts by kasai07 |
Page rendered in 0.018 seconds. (2048KB of memory used) MySQL - queries: 22, rows: 65/65, time: 0.006 seconds. ![]() © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |