Skip to content

Commit

Permalink
Merge remote-tracking branch 'ofw/dev' into mntm-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Jul 31, 2024
2 parents 114ca2e + 59eb749 commit b4c24e6
Show file tree
Hide file tree
Showing 46 changed files with 497 additions and 439 deletions.
4 changes: 1 addition & 3 deletions .sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
"clangd": {
"enabled": true,
"initializationOptions": {
// Use with toolchain version 39+
// Set `"binary": "custom",` option in LSP-clangd config to use toolchain clangd
// "custom_command": ["toolchain/current/bin/clangd"],

"custom_command": ["toolchain/current/bin/clangd"],
"clangd.compile-commands-dir": "build/latest",
"clangd.header-insertion": "never",
"clangd.query-driver": "**/arm-none-eabi-*",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/example/settings.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"SConstruct": "python",
"*.fam": "python"
},
// "clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@",
"clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@",
"clangd.arguments": [
"--query-driver=**/arm-none-eabi-*",
"--compile-commands-dir=${workspaceFolder}/build/latest",
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
### Added:
- OFW: iButton: Support ID writing (by @Astrrra)
- FBT: Add `-Wundef` to compiler options (by @hedger)

### Updated:
- Apps:
- Seader: Remove some optional asn1 fields (by @bettse)
- NFC Playlist: Fix extension check and error messages (by @acegoal07)
- OFW: FBT: Toolchain v39 (by @hedger)

### Fixed:
- OFW: NFC: Fix plantain balance string (by @Astrrra)
- OFW: JS: Ensure proper closure of variadic function in `mjs_array` (by @derskythe)

### Removed:
4 changes: 2 additions & 2 deletions applications/main/ibutton/ibutton_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void ibutton_cli_write(Cli* cli, FuriString* args) {
}

if(!(ibutton_protocols_get_features(protocols, ibutton_key_get_protocol_id(key)) &
iButtonProtocolFeatureWriteBlank)) {
iButtonProtocolFeatureWriteId)) {
ibutton_cli_print_usage();
break;
}
Expand All @@ -152,7 +152,7 @@ void ibutton_cli_write(Cli* cli, FuriString* args) {
ibutton_cli_print_key(protocols, key);
printf("Press Ctrl+C to abort\r\n");

ibutton_worker_write_blank_start(worker, key);
ibutton_worker_write_id_start(worker, key);
while(true) {
uint32_t flags = furi_event_flag_wait(
write_context.event, EVENT_FLAG_IBUTTON_COMPLETE, FuriFlagWaitAny, 100);
Expand Down
2 changes: 1 addition & 1 deletion applications/main/ibutton/ibutton_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

typedef enum {
iButtonWriteModeInvalid,
iButtonWriteModeBlank,
iButtonWriteModeId,
iButtonWriteModeCopy,
} iButtonWriteMode;

Expand Down
10 changes: 5 additions & 5 deletions applications/main/ibutton/scenes/ibutton_scene_read_key_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ typedef enum {
SubmenuIndexSave,
SubmenuIndexEmulate,
SubmenuIndexViewData,
SubmenuIndexWriteBlank,
SubmenuIndexWriteId,
SubmenuIndexWriteCopy,
} SubmenuIndex;

Expand All @@ -30,11 +30,11 @@ void ibutton_scene_read_key_menu_on_enter(void* context) {
ibutton_scene_read_key_menu_submenu_callback,
ibutton);

if(features & iButtonProtocolFeatureWriteBlank) {
if(features & iButtonProtocolFeatureWriteId) {
submenu_add_item(
submenu,
"Write ID",
SubmenuIndexWriteBlank,
SubmenuIndexWriteId,
ibutton_scene_read_key_menu_submenu_callback,
ibutton);
}
Expand Down Expand Up @@ -78,8 +78,8 @@ bool ibutton_scene_read_key_menu_on_event(void* context, SceneManagerEvent event
dolphin_deed(DolphinDeedIbuttonEmulate);
} else if(event.event == SubmenuIndexViewData) {
scene_manager_next_scene(scene_manager, iButtonSceneViewData);
} else if(event.event == SubmenuIndexWriteBlank) {
ibutton->write_mode = iButtonWriteModeBlank;
} else if(event.event == SubmenuIndexWriteId) {
ibutton->write_mode = iButtonWriteModeId;
scene_manager_next_scene(scene_manager, iButtonSceneWrite);
} else if(event.event == SubmenuIndexWriteCopy) {
ibutton->write_mode = iButtonWriteModeCopy;
Expand Down
10 changes: 5 additions & 5 deletions applications/main/ibutton/scenes/ibutton_scene_saved_key_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

enum SubmenuIndex {
SubmenuIndexEmulate,
SubmenuIndexWriteBlank,
SubmenuIndexWriteId,
SubmenuIndexWriteCopy,
SubmenuIndexEdit,
SubmenuIndexRename,
Expand All @@ -20,9 +20,9 @@ void ibutton_scene_saved_key_menu_on_enter(void* context) {

submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, ibutton_submenu_callback, ibutton);

if(features & iButtonProtocolFeatureWriteBlank) {
if(features & iButtonProtocolFeatureWriteId) {
submenu_add_item(
submenu, "Write ID", SubmenuIndexWriteBlank, ibutton_submenu_callback, ibutton);
submenu, "Write ID", SubmenuIndexWriteId, ibutton_submenu_callback, ibutton);
}

if(features & iButtonProtocolFeatureWriteCopy) {
Expand Down Expand Up @@ -55,8 +55,8 @@ bool ibutton_scene_saved_key_menu_on_event(void* context, SceneManagerEvent even
if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
dolphin_deed(DolphinDeedIbuttonEmulate);
} else if(event.event == SubmenuIndexWriteBlank) {
ibutton->write_mode = iButtonWriteModeBlank;
} else if(event.event == SubmenuIndexWriteId) {
ibutton->write_mode = iButtonWriteModeId;
scene_manager_next_scene(scene_manager, iButtonSceneWrite);
} else if(event.event == SubmenuIndexWriteCopy) {
ibutton->write_mode = iButtonWriteModeCopy;
Expand Down
4 changes: 2 additions & 2 deletions applications/main/ibutton/scenes/ibutton_scene_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ void ibutton_scene_write_on_enter(void* context) {

ibutton_worker_write_set_callback(worker, ibutton_scene_write_callback, ibutton);

if(ibutton->write_mode == iButtonWriteModeBlank) {
if(ibutton->write_mode == iButtonWriteModeId) {
furi_string_set(tmp, "Writing ID");
ibutton_worker_write_blank_start(worker, key);
ibutton_worker_write_id_start(worker, key);

} else if(ibutton->write_mode == iButtonWriteModeCopy) {
furi_string_set(tmp, "Full Writing");
Expand Down
2 changes: 1 addition & 1 deletion applications/main/nfc/plugins/supported_cards/plantain.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static bool plantain_parse(const NfcDevice* device, FuriString* parsed_data) {
}

furi_string_printf(
parsed_data, "\e#Plantain\nNo.: %llu?\nBalance:%lu\n", card_number, balance);
parsed_data, "\e#Plantain\nNo.: %llu\nBalance: %lu\n", card_number, balance);
parsed = true;
} while(false);

Expand Down
4 changes: 2 additions & 2 deletions applications/services/cli/cli_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void cli_command_sysctl_heap_track(Cli* cli, FuriString* args, void* context) {
} else if(!furi_string_cmp(args, "main")) {
furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackModeMain);
printf("Heap tracking enabled for application main thread");
#if FURI_DEBUG
#ifdef FURI_DEBUG
} else if(!furi_string_cmp(args, "tree")) {
furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackModeTree);
printf("Heap tracking enabled for application main and child threads");
Expand All @@ -289,7 +289,7 @@ void cli_command_sysctl_print_usage(void) {
printf("Cmd list:\r\n");

printf("\tdebug <0|1>\t - Enable or disable system debug\r\n");
#if FURI_DEBUG
#ifdef FURI_DEBUG
printf("\theap_track <none|main|tree|all>\t - Set heap allocation tracking mode\r\n");
#else
printf("\theap_track <none|main>\t - Set heap allocation tracking mode\r\n");
Expand Down
5 changes: 2 additions & 3 deletions applications/services/desktop/views/desktop_view_locked.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#include <projdefs.h>
#include <stdint.h>
#include <furi.h>

#include <gui/elements.h>
#include <gui/icon.h>
#include <gui/view.h>

#include <assets_icons.h>
#include <locale/locale.h>
#include <momentum/momentum.h>

#include <desktop/desktop_settings.h>
#include "../desktop_i.h"
#include "desktop_view_locked.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@

#include <furi.h>
#include <stdint.h>
#include <stdio.h>
#include <projdefs.h>
#include <input/input.h>

#include <gui/canvas.h>
#include <gui/view.h>

Expand Down
8 changes: 4 additions & 4 deletions applications/services/rpc/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool rpc_pb_stream_read(pb_istream_t* istream, pb_byte_t* buf, size_t count) {
}
}

#if SRV_RPC_DEBUG
#ifdef SRV_RPC_DEBUG
rpc_debug_print_data("INPUT", buf, bytes_received);
#endif

Expand Down Expand Up @@ -271,7 +271,7 @@ static int32_t rpc_session_worker(void* context) {
bool message_decode_failed = false;

if(pb_decode_ex(&istream, &PB_Main_msg, session->decoded_message, PB_DECODE_DELIMITED)) {
#if SRV_RPC_DEBUG
#ifdef SRV_RPC_DEBUG
FURI_LOG_I(TAG, "INPUT:");
rpc_debug_print_message(session->decoded_message);
#endif
Expand Down Expand Up @@ -463,7 +463,7 @@ void rpc_send(RpcSession* session, PB_Main* message) {

pb_ostream_t ostream = PB_OSTREAM_SIZING;

#if SRV_RPC_DEBUG
#ifdef SRV_RPC_DEBUG
FURI_LOG_I(TAG, "OUTPUT:");
rpc_debug_print_message(message);
#endif
Expand All @@ -476,7 +476,7 @@ void rpc_send(RpcSession* session, PB_Main* message) {

pb_encode_ex(&ostream, &PB_Main_msg, message, PB_ENCODE_DELIMITED);

#if SRV_RPC_DEBUG
#ifdef SRV_RPC_DEBUG
rpc_debug_print_data("OUTPUT", buffer, ostream.bytes_written);
#endif

Expand Down
4 changes: 2 additions & 2 deletions applications/settings/system/system_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void debug_changed(VariableItem* item) {
const char* const heap_trace_mode_text[] = {
"None",
"Main",
#if FURI_DEBUG
#ifdef FURI_DEBUG
"Tree",
"All",
#endif
Expand All @@ -101,7 +101,7 @@ const char* const heap_trace_mode_text[] = {
const uint32_t heap_trace_mode_value[] = {
FuriHalRtcHeapTrackModeNone,
FuriHalRtcHeapTrackModeMain,
#if FURI_DEBUG
#ifdef FURI_DEBUG
FuriHalRtcHeapTrackModeTree,
FuriHalRtcHeapTrackModeAll,
#endif
Expand Down
Loading

0 comments on commit b4c24e6

Please sign in to comment.