mirror of
https://github.com/clockworkpi/PicoCalc.git
synced 2025-12-12 10:18:54 +01:00
Revert "picocalc_keyboard: add bootmode register"
This reverts commit a690686270a1ea7eab0533f521d00cbe3c3a2806.
This commit is contained in:
parent
2f6ba71531
commit
557986bcb8
@ -58,10 +58,6 @@ enum key_state
|
||||
#define KEY_F9 0x89
|
||||
#define KEY_F10 0x90
|
||||
|
||||
#define BOOTMODE_DEFAULT 0x00 // normal boot mode
|
||||
#define BOOTMODE_SDCARD 0x01 // sdcard multiboot: loads .bin to FLASH+200K
|
||||
#define BOOTMODE_FWUPDATE 0x02 // enter BOOTSEL to upload .uf2 firmware
|
||||
|
||||
typedef void (*key_callback)(char, enum key_state);
|
||||
typedef void (*lock_callback)(bool, bool);
|
||||
|
||||
@ -70,7 +66,6 @@ void keyboard_set_key_callback(key_callback callback);
|
||||
void keyboard_set_lock_callback(lock_callback callback);
|
||||
bool keyboard_get_capslock(void);
|
||||
bool keyboard_get_numlock(void);
|
||||
uint8_t keyboard_get_bootmode(void);
|
||||
void keyboard_init(void);
|
||||
|
||||
#define NUM_OF_COLS 8
|
||||
|
||||
@ -78,8 +78,6 @@ static struct {
|
||||
|
||||
bool numlock_changed;
|
||||
bool numlock;
|
||||
|
||||
uint8_t bootmode;
|
||||
} self;
|
||||
|
||||
void output_string(char*str){
|
||||
@ -425,11 +423,6 @@ bool keyboard_get_numlock(void)
|
||||
return self.numlock;
|
||||
}
|
||||
|
||||
uint8_t keyboard_get_bootmode(void)
|
||||
{
|
||||
return self.bootmode;
|
||||
}
|
||||
|
||||
void keyboard_init(void)
|
||||
{
|
||||
struct port_config port_init;
|
||||
@ -438,8 +431,6 @@ void keyboard_init(void)
|
||||
for (int i = 0; i < MOD_LAST; ++i)
|
||||
self.mods[i] = false;
|
||||
|
||||
self.bootmode = BOOTMODE_DEFAULT;
|
||||
|
||||
// Rows
|
||||
port_init.direction = PORT_PIN_DIR_INPUT;
|
||||
port_init.input_pull = PORT_PIN_PULL_UP;
|
||||
@ -458,13 +449,5 @@ void keyboard_init(void)
|
||||
port_init.input_pull = PORT_PIN_PULL_UP;
|
||||
for(uint32_t i = 0; i < NUM_OF_BTNS; ++i)
|
||||
port_pin_set_config(btn_pins[i], &port_init);
|
||||
|
||||
//B12=left,B11=down [FWUPDATE],B10=up [SDCARD-MULTIBOOT],B9=right
|
||||
if (port_pin_get_input_level(btn_pins[10]) == 0) {
|
||||
self.bootmode = BOOTMODE_FWUPDATE;
|
||||
}
|
||||
if (port_pin_get_input_level(btn_pins[9]) == 0) {
|
||||
self.bootmode = BOOTMODE_SDCARD;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -168,11 +168,6 @@ void receiveEvent(int howMany) {
|
||||
write_buffer[1] = js_bits;
|
||||
write_buffer_len = 2;
|
||||
}break;
|
||||
case REG_ID_BOOT:{
|
||||
write_buffer[0] = reg;
|
||||
write_buffer[1] = keyboard_get_bootmode();
|
||||
write_buffer_len = 2;
|
||||
}break;
|
||||
default: {
|
||||
write_buffer[0] = 0;
|
||||
write_buffer[1] = 0;
|
||||
|
||||
@ -19,7 +19,6 @@ enum reg_id
|
||||
REG_ID_BAT = 0x0b,// battery
|
||||
REG_ID_C64_MTX = 0x0c,// read c64 matrix
|
||||
REG_ID_C64_JS = 0x0d, // joystick io bits
|
||||
REG_ID_BOOT = 0x0e, // boot mode (see keyboard.h)
|
||||
REG_ID_LAST,
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#include "reg.h"
|
||||
#include "keyboard.h"
|
||||
|
||||
static uint8_t regs[REG_ID_LAST];
|
||||
|
||||
@ -43,5 +42,4 @@ void reg_init(void)
|
||||
regs[REG_ID_BKL] = 255;//100%duty
|
||||
regs[REG_ID_BK2] = 0;
|
||||
regs[REG_ID_BAT] = 0; //default .no battery ,no charging
|
||||
regs[REG_ID_BOOT] = BOOTMODE_DEFAULT;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user