minor menu display fixes

This commit is contained in:
King Kévin 2024-04-18 05:18:21 +02:00
parent ca87f6cd63
commit a6a4c1a6cc
1 changed files with 6 additions and 5 deletions

View File

@ -384,7 +384,7 @@ void cdc_task(void)
case 'c': // input credentials
i = 0; // reset index
menu = MENU_USER; // go to corresponding menu
str = "\r\nusername: ";
str = "\r\nenter credentials to paste\r\nusername: ";
break;
case 'b': // swap buttons
config.button_swap = !config.button_swap;
@ -418,14 +418,15 @@ void cdc_task(void)
}
break;
case 'l': // set keyboard layout
tud_cdc_write(buf, 1); // since echo will be off
tud_cdc_write_flush();
echo = false;
tud_cdc_write(buf, 1); // since echo will be off
tud_cdc_write_str("\n\r");
tud_cdc_write_flush();
for (uint8_t j = 0; j < LENGTH(name_asciimap); j++) {
snprintf(tmp, sizeof(tmp), "%02u %s\r\n", j, name_asciimap[j]);
tud_cdc_write_str_flush(tmp);
}
snprintf(tmp, sizeof(tmp), "\r\nset keyboard layout [%s]: ", name_asciimap[config.layout]);
snprintf(tmp, sizeof(tmp), "set keyboard layout [%s]: ", name_asciimap[config.layout]);
tud_cdc_write_str_flush(tmp);
i = 0; // reset index
menu = MENU_LAYOUT;
@ -462,7 +463,7 @@ void cdc_task(void)
EraseInitStruct.TypeErase = FLASH_TYPEERASE_MASSERASE;
uint32_t error;
if (HAL_FLASHEx_Erase(&EraseInitStruct, &error) != HAL_OK) {
printf("mass earse failed\r\n");
printf("mass erase failed\r\n");
}
HAL_FLASH_Lock();
HAL_FLASH_OB_Launch(); // just to restart