mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Merge remote-tracking branch 'ul/dev' into js-backport-of-backport
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
- OFW: JS modules (by @portasynthinca3)
|
||||
- TODO: list differences, move to breaking changes
|
||||
- OFW: Dolphin: Happy mode in Desktop settings (by @portasynthinca3)
|
||||
- OFW: CLI: Improvements part I, `neofetch` command, some output coloring (by @portasynthinca3)
|
||||
- OFW: CLI: Improvements part I, `neofetch` command (by @portasynthinca3), fix for lab.flipper.net (by @xMasterX)
|
||||
- GUI:
|
||||
- OFW: Add up and down button drawing functions to GUI elements (by @DerSkythe)
|
||||
- OFW: Extended icon draw function in Canvas (by @RebornedBrain)
|
||||
@@ -113,7 +113,9 @@
|
||||
- OFW: GProxII Fix Writing and Rendering Conflict (by @zinongli)
|
||||
- Desktop:
|
||||
- Fallback Poweroff prompt when power settings is unavailable (by @Willy-JL)
|
||||
- Sub-GHz: Fix GPS "Latitute" typo, switch to "Lat" and "Lon" in .sub files (#246 by @m7i-org)
|
||||
- Sub-GHz:
|
||||
- Fix GPS "Latitute" typo, switch to "Lat" and "Lon" in .sub files (#246 by @m7i-org)
|
||||
- UL: Fix zero issues in Princeton (by @xMasterX)
|
||||
- Power: Suppress Shutdown on Idle While Charging / Plugged In (#244 by @luu176)
|
||||
- Storage:
|
||||
- Fallback SD format prompt when storage settings is unavailable (by @Willy-JL)
|
||||
@@ -121,6 +123,7 @@
|
||||
- About: Fix BLE stack version string (by @Willy-JL)
|
||||
- OFW: Loader: Warn about missing SD card for main apps (by @Willy-JL)
|
||||
- NFC:
|
||||
- UL: Read Ultralight block by block (by @mishamyte)
|
||||
- OFW: Fix crash on Ultralight unlock (by @Astrrra)
|
||||
- OFW: FeliCa anti-collision fix (by @RebornedBrain)
|
||||
- OFW: Emulation freeze fixed when pressing OK repeatedly (by @RebornedBrain)
|
||||
|
||||
@@ -109,8 +109,7 @@ void cli_print_usage(const char* cmd, const char* usage, const char* arg) {
|
||||
}
|
||||
|
||||
void cli_motd(void) {
|
||||
printf(ANSI_FLIPPER_BRAND_ORANGE
|
||||
"\r\n"
|
||||
printf("\r\n"
|
||||
" _.-------.._ -,\r\n"
|
||||
" .-\"```\"--..,,_/ /`-, -, \\ \r\n"
|
||||
" .:\" /:/ /'\\ \\ ,_..., `. | |\r\n"
|
||||
@@ -124,11 +123,12 @@ void cli_motd(void) {
|
||||
" _L_ _ ___ ___ ___ ___ ____--\"`___ _ ___\r\n"
|
||||
"| __|| | |_ _|| _ \\| _ \\| __|| _ \\ / __|| | |_ _|\r\n"
|
||||
"| _| | |__ | | | _/| _/| _| | / | (__ | |__ | |\r\n"
|
||||
"|_| |____||___||_| |_| |___||_|_\\ \\___||____||___|\r\n" ANSI_RESET
|
||||
"\r\n" ANSI_FG_BR_WHITE "Welcome to " ANSI_FLIPPER_BRAND_ORANGE
|
||||
"Flipper Zero" ANSI_FG_BR_WHITE " Command Line Interface!\r\n"
|
||||
"|_| |____||___||_| |_| |___||_|_\\ \\___||____||___|\r\n"
|
||||
"\r\n"
|
||||
"Welcome to Flipper Zero Command Line Interface!\r\n"
|
||||
"Read the manual: https://docs.flipper.net/development/cli\r\n"
|
||||
"Run `help` or `?` to list available commands\r\n" ANSI_RESET "\r\n");
|
||||
"Run `help` or `?` to list available commands\r\n"
|
||||
"\r\n");
|
||||
|
||||
const Version* firmware_version = furi_hal_version_get_firmware_version();
|
||||
if(firmware_version) {
|
||||
|
||||
@@ -505,16 +505,14 @@ static NfcCommand mf_ultralight_poller_handler_read_pages(MfUltralightPoller* in
|
||||
instance->error = mf_ultralight_poller_read_page(instance, start_page, &data);
|
||||
}
|
||||
|
||||
const uint8_t read_cnt = instance->data->type == MfUltralightTypeMfulC ? 1 : 4;
|
||||
if(instance->error == MfUltralightErrorNone) {
|
||||
for(size_t i = 0; i < read_cnt; i++) {
|
||||
if(start_page + i < instance->pages_total) {
|
||||
FURI_LOG_D(TAG, "Read page %d success", start_page + i);
|
||||
instance->data->page[start_page + i] = data.page[i];
|
||||
instance->pages_read++;
|
||||
instance->data->pages_read = instance->pages_read;
|
||||
}
|
||||
if(start_page < instance->pages_total) {
|
||||
FURI_LOG_D(TAG, "Read page %d success", start_page);
|
||||
instance->data->page[start_page] = data.page[start_page];
|
||||
instance->pages_read++;
|
||||
instance->data->pages_read = instance->pages_read;
|
||||
}
|
||||
|
||||
if(instance->pages_read == instance->pages_total) {
|
||||
instance->state = MfUltralightPollerStateReadCounters;
|
||||
}
|
||||
|
||||
@@ -145,10 +145,10 @@ static uint8_t subghz_protocol_princeton_get_btn_code(void) {
|
||||
case 0xC0:
|
||||
btn = 0x30;
|
||||
break;
|
||||
case 0x03:
|
||||
case 0xF3:
|
||||
btn = 0xC0;
|
||||
break;
|
||||
case 0x0C:
|
||||
case 0xFC:
|
||||
btn = 0xC0;
|
||||
break;
|
||||
|
||||
@@ -174,16 +174,16 @@ static uint8_t subghz_protocol_princeton_get_btn_code(void) {
|
||||
break;
|
||||
// Second encoding type
|
||||
case 0x30:
|
||||
btn = 0x03;
|
||||
btn = 0xF3;
|
||||
break;
|
||||
case 0xC0:
|
||||
btn = 0x03;
|
||||
btn = 0xF3;
|
||||
break;
|
||||
case 0x03:
|
||||
case 0xF3:
|
||||
btn = 0x30;
|
||||
break;
|
||||
case 0x0C:
|
||||
btn = 0x03;
|
||||
case 0xFC:
|
||||
btn = 0xF3;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -208,15 +208,15 @@ static uint8_t subghz_protocol_princeton_get_btn_code(void) {
|
||||
break;
|
||||
// Second encoding type
|
||||
case 0x30:
|
||||
btn = 0x0C;
|
||||
btn = 0xFC;
|
||||
break;
|
||||
case 0xC0:
|
||||
btn = 0x0C;
|
||||
btn = 0xFC;
|
||||
break;
|
||||
case 0x03:
|
||||
btn = 0x0C;
|
||||
case 0xF3:
|
||||
btn = 0xFC;
|
||||
break;
|
||||
case 0x0C:
|
||||
case 0xFC:
|
||||
btn = 0x30;
|
||||
break;
|
||||
|
||||
@@ -263,10 +263,12 @@ static bool
|
||||
|
||||
// Reconstruction of the data
|
||||
// If we have 8bit button code move serial to left by 8 bits (and 4 if 4 bits)
|
||||
if(instance->generic.btn == 0x30 || instance->generic.btn == 0xC0 ||
|
||||
instance->generic.btn == 0x03 || instance->generic.btn == 0x0C) {
|
||||
if(instance->generic.btn == 0x30 || instance->generic.btn == 0xC0) {
|
||||
instance->generic.data =
|
||||
((uint64_t)instance->generic.serial << 8 | (uint64_t)instance->generic.btn);
|
||||
} else if(instance->generic.btn == 0xF3 || instance->generic.btn == 0xFC) {
|
||||
instance->generic.data =
|
||||
((uint64_t)instance->generic.serial << 8 | (uint64_t)(instance->generic.btn & 0xF));
|
||||
} else {
|
||||
instance->generic.data =
|
||||
((uint64_t)instance->generic.serial << 4 | (uint64_t)instance->generic.btn);
|
||||
@@ -313,10 +315,14 @@ static void subghz_protocol_princeton_check_remote_controller(SubGhzBlockGeneric
|
||||
// Parse button modes for second encoding type (and serial is smaller)
|
||||
// Button code is 8bit and has fixed values of one of these
|
||||
// Exclude button code for each type from serial number before parsing
|
||||
if((instance->data & 0xFF) == 0x30 || (instance->data & 0xFF) == 0xC0 ||
|
||||
(instance->data & 0xFF) == 0x03 || (instance->data & 0xFF) == 0x0C) {
|
||||
if((instance->data & 0xFF) == 0x30 || (instance->data & 0xFF) == 0xC0) {
|
||||
// Save serial and button code
|
||||
instance->serial = instance->data >> 8;
|
||||
instance->btn = instance->data & 0xFF;
|
||||
} else if((instance->data & 0xFF) == 0x03 || (instance->data & 0xFF) == 0x0C) {
|
||||
// Fix for button code 0x03 and 0x0C having zero at the beggining
|
||||
instance->serial = instance->data >> 8;
|
||||
instance->btn = (instance->data & 0xFF) | 0xF0;
|
||||
} else {
|
||||
instance->serial = instance->data >> 4;
|
||||
instance->btn = instance->data & 0xF;
|
||||
@@ -589,7 +595,7 @@ void subghz_protocol_decoder_princeton_get_string(void* context, FuriString* out
|
||||
instance->generic.data, instance->generic.data_count_bit);
|
||||
|
||||
if(instance->generic.btn == 0x30 || instance->generic.btn == 0xC0 ||
|
||||
instance->generic.btn == 0x03 || instance->generic.btn == 0x0C) {
|
||||
instance->generic.btn == 0xF3 || instance->generic.btn == 0xFC) {
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
@@ -602,7 +608,9 @@ void subghz_protocol_decoder_princeton_get_string(void* context, FuriString* out
|
||||
(uint32_t)(instance->generic.data & 0xFFFFFF),
|
||||
data_rev,
|
||||
instance->generic.serial,
|
||||
instance->generic.btn,
|
||||
(instance->generic.btn == 0xF3 || instance->generic.btn == 0xFC) ?
|
||||
instance->generic.btn & 0xF :
|
||||
instance->generic.btn,
|
||||
instance->te,
|
||||
instance->guard_time);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user