Skip to content

Commit

Permalink
Merge branch 'dev' into skorp/subghz_fix_gui
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes authored Jan 12, 2024
2 parents c6191c9 + 0789cbd commit 37343eb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion firmware.scons
Original file line number Diff line number Diff line change
Expand Up @@ -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}*"),
Expand Down
1 change: 1 addition & 0 deletions lib/nfc/protocols/mf_classic/mf_classic_poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 7 additions & 0 deletions scripts/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
13 changes: 7 additions & 6 deletions scripts/ufbt/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions scripts/ufbt/site_tools/ufbt_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 37343eb

Please sign in to comment.