Fix and build.

This commit is contained in:
Colin 2024-12-07 13:53:16 +08:00
parent 0f3e2187ab
commit dfe01e2958
5 changed files with 15 additions and 16 deletions

View File

@ -339,7 +339,7 @@ void handle_response_byte_msg(uart_packet_t *packet, device_t *state) {
/* Neeeeeeext byte, please! */
state->fw.address += sizeof(uint32_t);
state->fw.byte_done = true;
// state->fw.byte_done = true;
}
/* Process a request to read a firmware package from flash */
@ -354,9 +354,8 @@ void handle_heartbeat_msg(uart_packet_t *packet, device_t *state) {
return;
/* It is? Ok, kick off the firmware upgrade */
// state->fw = (fw_upgrade_state_t) {
state->fw = () {
// .upgrade_in_progress = true,
state->fw = (fw_upgrade_state_t) {
.upgrade_in_progress = true,
.byte_done = true,
.address = 0,
.checksum = 0xffffffff,

View File

@ -372,13 +372,13 @@ typedef struct {
typedef enum { IDLE, READING_PACKET, PROCESSING_PACKET } receiver_state_t;
// typedef struct {
// uint32_t address; // Address we're sending to the other box
// uint32_t checksum;
// uint16_t version;
// bool byte_done; // Has the byte been successfully transferred
// bool upgrade_in_progress; // True if firmware transfer from the other box is in progress
// } fw_upgrade_state_t;
typedef struct {
uint32_t address; // Address we're sending to the other box
uint32_t checksum;
uint16_t version;
bool byte_done; // Has the byte been successfully transferred
bool upgrade_in_progress; // True if firmware transfer from the other box is in progress
} fw_upgrade_state_t;
typedef struct {
uint8_t kbd_dev_addr; // Address of the keyboard device
@ -410,7 +410,7 @@ typedef struct {
uint32_t dma_tx_channel; // DMA TX channel we're using to send
/* Firmware */
// fw_upgrade_state_t fw; // State of the firmware upgrader
fw_upgrade_state_t fw; // State of the firmware upgrader
firmware_metadata_t _running_fw; // RAM copy of running fw metadata
bool reboot_requested; // If set, stop updating watchdog
uint64_t config_mode_timer; // Counts how long are we to remain in config mode

View File

@ -36,7 +36,7 @@
*
* */
#define HOTKEY_TOGGLE HID_KEY_CAPS_LOCK
#define HOTKEY_TOGGLE KEYBOARD_MODIFIER_RIGHTSHIFT
/**================================================== *
* ============== Mouse Speed Factor ============== *

View File

@ -23,11 +23,11 @@
hotkey_combo_t hotkeys[] = {
/* Main keyboard switching hotkey */
{.modifier = KEYBOARD_MODIFIER_LEFTCTRL,
{.modifier = KEYBOARD_MODIFIER_RIGHTCTRL,
.keys = {HOTKEY_TOGGLE},
.key_count = 1,
.pass_to_os = false,
.action_handler = &output_toggle_hotkey_handler},
.action_handler = &output_toggle_hotkey_handler}};
// /* Pressing right ALT + right CTRL toggles the slow mouse mode */
// {.modifier = KEYBOARD_MODIFIER_RIGHTALT | KEYBOARD_MODIFIER_RIGHTCTRL,

View File

@ -150,7 +150,7 @@ void request_byte(device_t *state, uint32_t address) {
.data32[0] = address,
.type = REQUEST_BYTE_MSG,
};
state->fw.byte_done = false;
// state->fw.byte_done = false;
queue_try_add(&global_state.uart_tx_queue, &packet);
}