diff --git a/SConstruct b/SConstruct index b42218a579c..6d24da920a6 100644 --- a/SConstruct +++ b/SConstruct @@ -369,7 +369,7 @@ vscode_dist = distenv.Install( ) distenv.Precious(vscode_dist) distenv.NoClean(vscode_dist) -distenv.Alias("vscode_dist", vscode_dist) +distenv.Alias("vscode_dist", (vscode_dist, firmware_env["FW_CDB"])) # Configure shell with build tools distenv.PhonyTarget( diff --git a/firmware.scons b/firmware.scons index 004def9a999..901a762145b 100644 --- a/firmware.scons +++ b/firmware.scons @@ -249,7 +249,7 @@ fw_artifacts.extend( ) -fwcdb = fwenv.CompilationDatabase() +fwcdb = fwenv["FW_CDB"] = fwenv.CompilationDatabase() # without filtering, both updater & firmware commands would be generated in same file fwenv.Replace( COMPILATIONDB_PATH_FILTER=fwenv.subst("*${FW_FLAVOR}*"), diff --git a/lib/nfc/protocols/mf_classic/mf_classic_poller.c b/lib/nfc/protocols/mf_classic/mf_classic_poller.c index dbc32a1b51c..d846bba69bc 100644 --- a/lib/nfc/protocols/mf_classic/mf_classic_poller.c +++ b/lib/nfc/protocols/mf_classic/mf_classic_poller.c @@ -22,6 +22,7 @@ MfClassicPoller* mf_classic_poller_alloc(Iso14443_3aPoller* iso14443_3a_poller) instance->rx_plain_buffer = bit_buffer_alloc(MF_CLASSIC_MAX_BUFF_SIZE); instance->rx_encrypted_buffer = bit_buffer_alloc(MF_CLASSIC_MAX_BUFF_SIZE); instance->current_type_check = MfClassicType4k; + instance->card_state = MfClassicCardStateLost; instance->mfc_event.data = &instance->mfc_event_data; diff --git a/scripts/assets.py b/scripts/assets.py index 1099f0c330d..711c1b440b2 100755 --- a/scripts/assets.py +++ b/scripts/assets.py @@ -24,6 +24,9 @@ ICONS_TEMPLATE_C_DATA = "const uint8_t* const {name}[] = {data};\n" ICONS_TEMPLATE_C_ICONS = "const Icon {name} = {{.width={width},.height={height},.frame_count={frame_count},.frame_rate={frame_rate},.frames=_{name}}};\n" +MAX_IMAGE_WIDTH = 128 +MAX_IMAGE_HEIGHT = 64 + class Main(App): def init(self): @@ -102,6 +105,10 @@ def init(self): def _icon2header(self, file): image = file2image(file) + if image.width > MAX_IMAGE_WIDTH or image.height > MAX_IMAGE_HEIGHT: + raise Exception( + f"Image {file} is too big ({image.width}x{image.height} vs. {MAX_IMAGE_WIDTH}x{MAX_IMAGE_HEIGHT})" + ) return image.width, image.height, image.data_as_carray() def _iconIsSupported(self, filename): diff --git a/scripts/ufbt/SConstruct b/scripts/ufbt/SConstruct index 9edeb46fca1..8df1ae110ab 100644 --- a/scripts/ufbt/SConstruct +++ b/scripts/ufbt/SConstruct @@ -275,15 +275,16 @@ Default(install_and_check) # Compilation database -fwcdb = appenv.CompilationDatabase( +app_cdb = appenv.CompilationDatabase( original_app_dir.Dir(".vscode").File("compile_commands.json") ) -AlwaysBuild(fwcdb) -Precious(fwcdb) -NoClean(fwcdb) +AlwaysBuild(app_cdb) +Precious(app_cdb) +NoClean(app_cdb) if len(apps_artifacts): - Default(fwcdb) + Default(app_cdb) +Alias("cdb", app_cdb) # launch handler @@ -381,7 +382,7 @@ for config_file in project_template_dir.glob(".*"): dist_env.Precious(vscode_dist) dist_env.NoClean(vscode_dist) -dist_env.Alias("vscode_dist", vscode_dist) +dist_env.Alias("vscode_dist", (vscode_dist, app_cdb)) # Creating app from base template diff --git a/scripts/ufbt/site_tools/ufbt_help.py b/scripts/ufbt/site_tools/ufbt_help.py index ab20e2f7de9..4873b385c65 100644 --- a/scripts/ufbt/site_tools/ufbt_help.py +++ b/scripts/ufbt/site_tools/ufbt_help.py @@ -18,6 +18,8 @@ Build all FAP apps fap_{APPID}, launch APPSRC={APPID}: Build FAP app with appid={APPID}; upload & start it over USB + cdb: + regenerate "compile_commands.json" file (for IDE integration) Flashing & debugging: flash, *jflash: