Clipv2: fix button reading on some models
We neet to setup the XPD to work as GPIO storage unaffected Tested on working-already Clipv2 and on a 'brickable' clipv2 Change-Id: Idcbdfb6bd50d51b7f6f7e00b21df24fac9b3a6d8
This commit is contained in:
parent
e7892c9851
commit
d1b47c2eeb
4 changed files with 15 additions and 7 deletions
|
@ -52,6 +52,7 @@ static const int rows[3] = {
|
|||
void button_init_device(void)
|
||||
{
|
||||
GPIOA_DIR &= ~((1<<7) | (1<<3));
|
||||
CCU_IO &= ~(3<<2);
|
||||
IN_DIR &= ~((1<<2) | (1<<1) | (1<<0));
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
|
|
@ -89,21 +89,22 @@ unsigned char dualboot_fuze[176] = {
|
|||
0x01, 0x20, 0x43, 0xe4, 0x04, 0x00, 0x53, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x01, 0x00, 0x83, 0xe2,
|
||||
0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0d, 0xc8
|
||||
};
|
||||
unsigned char dualboot_clipv2[220] = {
|
||||
unsigned char dualboot_clipv2[240] = {
|
||||
0x06, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x24, 0x00, 0x1f, 0xe5, 0x24, 0x10, 0x1f, 0xe5, 0x01, 0x20, 0x40, 0xe0, 0x18, 0x30, 0x1f, 0xe5,
|
||||
0x01, 0x40, 0x50, 0xe4, 0x01, 0x40, 0x43, 0xe4, 0x00, 0x00, 0x52, 0xe1, 0xfb, 0xff, 0xff, 0x1a,
|
||||
0x2c, 0x30, 0x0f, 0xe5, 0x88, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3,
|
||||
0x00, 0x10, 0x80, 0xe5, 0x7c, 0x00, 0x9f, 0xe5, 0x38, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5,
|
||||
0x2c, 0x30, 0x0f, 0xe5, 0x98, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3,
|
||||
0x00, 0x10, 0x80, 0xe5, 0x8c, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0x90, 0xe5, 0x0c, 0x10, 0xc1, 0xe3,
|
||||
0x00, 0x10, 0x80, 0xe5, 0x80, 0x00, 0x9f, 0xe5, 0x38, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5,
|
||||
0x08, 0x10, 0xa0, 0xe3, 0x20, 0x10, 0x80, 0xe5, 0x10, 0x10, 0xa0, 0xe3, 0x40, 0x10, 0x80, 0xe5,
|
||||
0x20, 0x10, 0xa0, 0xe3, 0x80, 0x10, 0x80, 0xe5, 0x00, 0x10, 0xa0, 0xe3, 0x40, 0x10, 0x80, 0xe5,
|
||||
0x05, 0x10, 0xa0, 0xe3, 0x01, 0x10, 0x51, 0xe2, 0xfd, 0xff, 0xff, 0x1a, 0x04, 0x10, 0x90, 0xe5,
|
||||
0x00, 0x00, 0x51, 0xe3, 0x02, 0x00, 0x00, 0x0a, 0x8c, 0x00, 0x1f, 0xe5, 0x8c, 0x10, 0x1f, 0xe5,
|
||||
0x01, 0x00, 0x00, 0xea, 0xa0, 0x00, 0x1f, 0xe5, 0xa0, 0x10, 0x1f, 0xe5, 0x98, 0x30, 0x1f, 0xe5,
|
||||
0x00, 0x00, 0x51, 0xe3, 0x02, 0x00, 0x00, 0x0a, 0x9c, 0x00, 0x1f, 0xe5, 0x9c, 0x10, 0x1f, 0xe5,
|
||||
0x01, 0x00, 0x00, 0xea, 0xb0, 0x00, 0x1f, 0xe5, 0xb0, 0x10, 0x1f, 0xe5, 0xa8, 0x30, 0x1f, 0xe5,
|
||||
0x02, 0x50, 0x83, 0xe2, 0x01, 0x40, 0x43, 0xe0, 0x01, 0x20, 0x50, 0xe4, 0x01, 0x20, 0x43, 0xe4,
|
||||
0x04, 0x00, 0x53, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x01, 0x00, 0x83, 0xe2, 0x00, 0x20, 0xa0, 0xe3,
|
||||
0x15, 0xff, 0x2f, 0xe1, 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0e, 0xc8
|
||||
0x15, 0xff, 0x2f, 0xe1, 0x14, 0x00, 0x0f, 0xc8, 0x0c, 0x00, 0x10, 0xc8, 0x00, 0x00, 0x0e, 0xc8
|
||||
};
|
||||
unsigned char dualboot_clipplus[184] = {
|
||||
0x06, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
|
|
@ -6,7 +6,7 @@ extern unsigned char dualboot_e200v2[176];
|
|||
extern unsigned char dualboot_c200v2[272];
|
||||
extern unsigned char dualboot_m200v4[180];
|
||||
extern unsigned char dualboot_fuze[176];
|
||||
extern unsigned char dualboot_clipv2[220];
|
||||
extern unsigned char dualboot_clipv2[240];
|
||||
extern unsigned char dualboot_clipplus[184];
|
||||
extern unsigned char dualboot_fuzev2[176];
|
||||
extern unsigned char dualboot_clipzip[232];
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
.set CGU_PROC, 0xC80F0010
|
||||
.set CGU_PERI, 0xC80F0014
|
||||
.set CGU_DBOP, 0xC80F0038
|
||||
.set CCU_IO, 0xC810000C
|
||||
.set DBOP, 0xC8120000
|
||||
.set I2C_BASE, 0xC8070000
|
||||
.set I2C_DATA, 0x00
|
||||
|
@ -111,6 +112,11 @@ uclcopy:
|
|||
.set row, (1<<4) /* enable output on D4 */
|
||||
.set col, (1<<0) /* read keyscan column D0 */
|
||||
|
||||
ldr r0, =CCU_IO
|
||||
ldr r1, [r0]
|
||||
bic r1, r1, #(3<<2) @ XPD works as general purpose IO
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPIOD
|
||||
mov r1, #((1<<5)|(1<<4)|(1<<3)) /* all rows as output */
|
||||
str r1, [r0, #0x400]
|
||||
|
|
Loading…
Reference in a new issue