fbt fixes for mfbt pt2 (#1951)

* fbt: split sdk management code
* scripts: fixed import handling
* fbt: sdk: reformatted paths
* scrips: dist: bundling libs as a build artifact
* fbt: sdk: better path management
* typo fix
* fbt: sdk: minor path handling fixes
* toolchain: fixed windows toolchain download
* fbt: minor refactorin
* fbt: moved sdk management code to extapps.scons
* fbt: fixed sdk symbols header path; disabled -fstack-usage
* fbt: changed pathing for .py scripts
* fbt: changed SDK_HEADERS pathing; added libusb to SDK; added icon_i.h to SDK; added hw target to SDK meta
* fbt: added libusb headers to SDK
* picopass: include cleanup; api: added subghz/registry.h; api: added mbedtls to exported headers
* picopass: fixed formatting
* fbt: fixed COPRO_ASSETS_SCRIPT
* sdk: added basic infrared apis
* toolchain: added ufbt to list of legal fbtenv callers; updated error messages
* fbt: changed manifest collection & icon processing code
* fbt: simpler srcdir lookup
* toolchain: path management fixes; fbt: fixes for fap private libs paths
* scripts: toolchain: reworked download on Windows
* toolchain: v17
* scripts: added colorlog for logging
* Github: fix unit tests

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger 2022-11-02 19:15:40 +04:00 committed by GitHub
parent abfa804ae0
commit ebc2b66372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 459 additions and 235 deletions

View File

@ -31,22 +31,26 @@ jobs:
id: connect id: connect
if: steps.compile.outcome == 'success' if: steps.compile.outcome == 'success'
run: | run: |
python3 ./scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}} . scripts/toolchain/fbtenv.sh
./scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
- name: 'Format flipper SD card' - name: 'Format flipper SD card'
id: format id: format
if: steps.connect.outcome == 'success' if: steps.connect.outcome == 'success'
run: | run: |
. scripts/toolchain/fbtenv.sh
./scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext ./scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
- name: 'Copy assets and unit tests data to flipper' - name: 'Copy assets and unit tests data to flipper'
id: copy id: copy
if: steps.format.outcome == 'success' if: steps.format.outcome == 'success'
run: | run: |
. scripts/toolchain/fbtenv.sh
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/resources /ext ./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/resources /ext
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/unit_tests /ext/unit_tests ./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/unit_tests /ext/unit_tests
- name: 'Run units and validate results' - name: 'Run units and validate results'
if: steps.copy.outcome == 'success' if: steps.copy.outcome == 'success'
run: | run: |
python3 ./scripts/testing/units.py ${{steps.device.outputs.flipper}} . scripts/toolchain/fbtenv.sh
./scripts/testing/units.py ${{steps.device.outputs.flipper}}

View File

@ -33,10 +33,6 @@ coreenv = SConscript(
) )
SConscript("site_scons/cc.scons", exports={"ENV": coreenv}) SConscript("site_scons/cc.scons", exports={"ENV": coreenv})
# Store root dir in environment for certain tools
coreenv["ROOT_DIR"] = Dir(".")
# Create a separate "dist" environment and add construction envs to it # Create a separate "dist" environment and add construction envs to it
distenv = coreenv.Clone( distenv = coreenv.Clone(
tools=[ tools=[
@ -233,13 +229,13 @@ distenv.PhonyTarget(
# Linter # Linter
distenv.PhonyTarget( distenv.PhonyTarget(
"lint", "lint",
"${PYTHON3} scripts/lint.py check ${LINT_SOURCES}", "${PYTHON3} ${FBT_SCRIPT_DIR}/lint.py check ${LINT_SOURCES}",
LINT_SOURCES=firmware_env["LINT_SOURCES"], LINT_SOURCES=firmware_env["LINT_SOURCES"],
) )
distenv.PhonyTarget( distenv.PhonyTarget(
"format", "format",
"${PYTHON3} scripts/lint.py format ${LINT_SOURCES}", "${PYTHON3} ${FBT_SCRIPT_DIR}/lint.py format ${LINT_SOURCES}",
LINT_SOURCES=firmware_env["LINT_SOURCES"], LINT_SOURCES=firmware_env["LINT_SOURCES"],
) )
@ -280,7 +276,7 @@ distenv.PhonyTarget(
) )
# Start Flipper CLI via PySerial's miniterm # Start Flipper CLI via PySerial's miniterm
distenv.PhonyTarget("cli", "${PYTHON3} scripts/serial_cli.py") distenv.PhonyTarget("cli", "${PYTHON3} ${FBT_SCRIPT_DIR}/serial_cli.py")
# Find blackmagic probe # Find blackmagic probe

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

View File

@ -9,7 +9,7 @@ App(
], ],
stack_size=4 * 1024, stack_size=4 * 1024,
order=30, order=30,
fap_icon="../../../assets/icons/Archive/125_10px.png", fap_icon="125_10px.png",
fap_category="Tools", fap_category="Tools",
fap_libs=["mbedtls"], fap_libs=["mbedtls"],
fap_private_libs=[ fap_private_libs=[

View File

@ -9,8 +9,6 @@
#include <furi_hal.h> #include <furi_hal.h>
#include <stdlib.h> #include <stdlib.h>
#include <st25r3916.h>
#include <rfal_analogConfig.h>
#include <rfal_rf.h> #include <rfal_rf.h>
#include <platform.h> #include <platform.h>

View File

@ -1,5 +1,4 @@
#include "rfal_picopass.h" #include "rfal_picopass.h"
#include "utils.h"
#define RFAL_PICOPASS_TXRX_FLAGS \ #define RFAL_PICOPASS_TXRX_FLAGS \
(FURI_HAL_NFC_LL_TXRX_FLAGS_CRC_TX_MANUAL | FURI_HAL_NFC_LL_TXRX_FLAGS_AGC_ON | \ (FURI_HAL_NFC_LL_TXRX_FLAGS_CRC_TX_MANUAL | FURI_HAL_NFC_LL_TXRX_FLAGS_AGC_ON | \
@ -97,7 +96,7 @@ FuriHalNfcReturn rfalPicoPassPollerSelect(uint8_t* csn, rfalPicoPassSelectRes* s
rfalPicoPassSelectReq selReq; rfalPicoPassSelectReq selReq;
selReq.CMD = RFAL_PICOPASS_CMD_SELECT; selReq.CMD = RFAL_PICOPASS_CMD_SELECT;
ST_MEMCPY(selReq.CSN, csn, RFAL_PICOPASS_UID_LEN); memcpy(selReq.CSN, csn, RFAL_PICOPASS_UID_LEN);
uint16_t recvLen = 0; uint16_t recvLen = 0;
uint32_t flags = RFAL_PICOPASS_TXRX_FLAGS; uint32_t flags = RFAL_PICOPASS_TXRX_FLAGS;
uint32_t fwt = furi_hal_nfc_ll_ms2fc(20); uint32_t fwt = furi_hal_nfc_ll_ms2fc(20);
@ -146,8 +145,8 @@ FuriHalNfcReturn rfalPicoPassPollerCheck(uint8_t* mac, rfalPicoPassCheckRes* chk
FuriHalNfcReturn ret; FuriHalNfcReturn ret;
rfalPicoPassCheckReq chkReq; rfalPicoPassCheckReq chkReq;
chkReq.CMD = RFAL_PICOPASS_CMD_CHECK; chkReq.CMD = RFAL_PICOPASS_CMD_CHECK;
ST_MEMCPY(chkReq.mac, mac, 4); memcpy(chkReq.mac, mac, 4);
ST_MEMSET(chkReq.null, 0, 4); memset(chkReq.null, 0, 4);
uint16_t recvLen = 0; uint16_t recvLen = 0;
uint32_t flags = RFAL_PICOPASS_TXRX_FLAGS; uint32_t flags = RFAL_PICOPASS_TXRX_FLAGS;
uint32_t fwt = furi_hal_nfc_ll_ms2fc(20); uint32_t fwt = furi_hal_nfc_ll_ms2fc(20);

View File

@ -12,6 +12,7 @@ App(
order=70, order=70,
sdk_headers=[ sdk_headers=[
"gui.h", "gui.h",
"icon_i.h",
"elements.h", "elements.h",
"view_dispatcher.h", "view_dispatcher.h",
"view_stack.h", "view_stack.h",

View File

@ -1,6 +1,7 @@
Import("ENV", "fw_build_meta") Import("ENV", "fw_build_meta")
from SCons.Errors import UserError from SCons.Errors import UserError
from SCons.Node import FS
import itertools import itertools
from fbt_extra.util import ( from fbt_extra.util import (
@ -14,7 +15,6 @@ env = ENV.Clone(
("compilation_db", {"COMPILATIONDB_COMSTR": "\tCDB\t${TARGET}"}), ("compilation_db", {"COMPILATIONDB_COMSTR": "\tCDB\t${TARGET}"}),
"fwbin", "fwbin",
"fbt_apps", "fbt_apps",
"fbt_sdk",
], ],
COMPILATIONDB_USE_ABSPATH=False, COMPILATIONDB_USE_ABSPATH=False,
BUILD_DIR=fw_build_meta["build_dir"], BUILD_DIR=fw_build_meta["build_dir"],
@ -112,7 +112,9 @@ lib_targets = env.BuildModules(
# Now, env is fully set up with everything to build apps # Now, env is fully set up with everything to build apps
fwenv = env.Clone() fwenv = env.Clone(FW_ARTIFACTS=[])
fw_artifacts = fwenv["FW_ARTIFACTS"]
# Set up additional app-specific build flags # Set up additional app-specific build flags
SConscript("site_scons/firmwareopts.scons", exports={"ENV": fwenv}) SConscript("site_scons/firmwareopts.scons", exports={"ENV": fwenv})
@ -130,7 +132,14 @@ if extra_int_apps := GetOption("extra_int_apps"):
if fwenv["FAP_EXAMPLES"]: if fwenv["FAP_EXAMPLES"]:
fwenv.Append(APPDIRS=[("applications/examples", False)]) fwenv.Append(APPDIRS=[("applications/examples", False)])
fwenv.LoadApplicationManifests() for app_dir, _ in env["APPDIRS"]:
app_dir_node = env.Dir("#").Dir(app_dir)
for entry in app_dir_node.glob("*"):
if isinstance(entry, FS.Dir) and not str(entry).startswith("."):
fwenv.LoadAppManifest(entry)
fwenv.PrepareApplicationsBuild() fwenv.PrepareApplicationsBuild()
# Build external apps # Build external apps
@ -138,6 +147,7 @@ if env["IS_BASE_FIRMWARE"]:
extapps = fwenv["FW_EXTAPPS"] = SConscript( extapps = fwenv["FW_EXTAPPS"] = SConscript(
"site_scons/extapps.scons", exports={"ENV": fwenv} "site_scons/extapps.scons", exports={"ENV": fwenv}
) )
fw_artifacts.append(extapps["sdk_tree"])
# Add preprocessor definitions for current set of apps # Add preprocessor definitions for current set of apps
@ -220,7 +230,10 @@ Depends(fwelf, lib_targets)
AddPostAction(fwelf, fwenv["APPBUILD_DUMP"]) AddPostAction(fwelf, fwenv["APPBUILD_DUMP"])
AddPostAction( AddPostAction(
fwelf, fwelf,
Action('${PYTHON3} "${ROOT_DIR}/scripts/fwsize.py" elf ${TARGET}', "Firmware size"), Action(
'${PYTHON3} "${BIN_SIZE_SCRIPT}" elf ${TARGET}',
"Firmware size",
),
) )
# Produce extra firmware files # Produce extra firmware files
@ -228,7 +241,7 @@ fwhex = fwenv["FW_HEX"] = fwenv.HEXBuilder("${FIRMWARE_BUILD_CFG}")
fwbin = fwenv["FW_BIN"] = fwenv.BINBuilder("${FIRMWARE_BUILD_CFG}") fwbin = fwenv["FW_BIN"] = fwenv.BINBuilder("${FIRMWARE_BUILD_CFG}")
AddPostAction( AddPostAction(
fwbin, fwbin,
Action('@${PYTHON3} "${ROOT_DIR}/scripts/fwsize.py" bin ${TARGET}'), Action('@${PYTHON3} "${BIN_SIZE_SCRIPT}" bin ${TARGET}'),
) )
fwdfu = fwenv["FW_DFU"] = fwenv.DFUBuilder("${FIRMWARE_BUILD_CFG}") fwdfu = fwenv["FW_DFU"] = fwenv.DFUBuilder("${FIRMWARE_BUILD_CFG}")
@ -238,12 +251,14 @@ fwdump = fwenv.ObjDump("${FIRMWARE_BUILD_CFG}")
Alias(fwenv["FIRMWARE_BUILD_CFG"] + "_list", fwdump) Alias(fwenv["FIRMWARE_BUILD_CFG"] + "_list", fwdump)
fw_artifacts = fwenv["FW_ARTIFACTS"] = [ fw_artifacts.extend(
fwhex, [
fwbin, fwhex,
fwdfu, fwbin,
fwenv["FW_VERSION_JSON"], fwdfu,
] fwenv["FW_VERSION_JSON"],
]
)
fwcdb = fwenv.CompilationDatabase() fwcdb = fwenv.CompilationDatabase()
@ -272,34 +287,5 @@ if should_gen_cdb_and_link_dir(fwenv, BUILD_TARGETS):
Alias(fwenv["FIRMWARE_BUILD_CFG"] + "_all", fw_artifacts) Alias(fwenv["FIRMWARE_BUILD_CFG"] + "_all", fw_artifacts)
if fwenv["IS_BASE_FIRMWARE"]:
sdk_source = fwenv.SDKPrebuilder(
"sdk_origin",
# Deps on root SDK headers and generated files
(fwenv["SDK_HEADERS"], fwenv["FW_ASSETS_HEADERS"]),
)
# Extra deps on headers included in deeper levels
Depends(sdk_source, fwenv.ProcessSdkDepends("sdk_origin.d"))
fwenv["SDK_DIR"] = fwenv.Dir("sdk")
sdk_tree = fwenv.SDKTree(fwenv["SDK_DIR"], "sdk_origin")
fw_artifacts.append(sdk_tree)
# AlwaysBuild(sdk_tree)
Alias("sdk_tree", sdk_tree)
sdk_apicheck = fwenv.SDKSymUpdater(fwenv["SDK_DEFINITION"], "sdk_origin")
Precious(sdk_apicheck)
NoClean(sdk_apicheck)
AlwaysBuild(sdk_apicheck)
Alias("sdk_check", sdk_apicheck)
sdk_apisyms = fwenv.SDKSymGenerator(
"assets/compiled/symbols.h", fwenv["SDK_DEFINITION"]
)
Alias("api_syms", sdk_apisyms)
if fwenv["FORCE"]:
fwenv.AlwaysBuild(sdk_source, sdk_tree, sdk_apicheck, sdk_apisyms)
Return("fwenv") Return("fwenv")

View File

@ -2,11 +2,10 @@ Import("env")
env.Append( env.Append(
LINT_SOURCES=["firmware"], LINT_SOURCES=["firmware"],
# SDK_HEADERS=[env.File("#/firmware/targets/furi_hal_include/furi_hal.h")],
SDK_HEADERS=[ SDK_HEADERS=[
*env.GlobRecursive("*.h", "#/firmware/targets/furi_hal_include", "*_i.h"), *env.GlobRecursive("*.h", "targets/furi_hal_include", "*_i.h"),
*env.GlobRecursive("*.h", "#/firmware/targets/f${TARGET_HW}/furi_hal", "*_i.h"), *env.GlobRecursive("*.h", "targets/f${TARGET_HW}/furi_hal", "*_i.h"),
File("#/firmware/targets/f7/platform_specific/intrinsic_export.h"), File("targets/f7/platform_specific/intrinsic_export.h"),
], ],
) )

View File

@ -1,5 +1,5 @@
entry,status,name,type,params entry,status,name,type,params
Version,+,7.0,, Version,+,7.2,,
Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli.h,,
Header,+,applications/services/cli/cli_vcp.h,, Header,+,applications/services/cli/cli_vcp.h,,
@ -7,6 +7,7 @@ Header,+,applications/services/dialogs/dialogs.h,,
Header,+,applications/services/dolphin/dolphin.h,, Header,+,applications/services/dolphin/dolphin.h,,
Header,+,applications/services/gui/elements.h,, Header,+,applications/services/gui/elements.h,,
Header,+,applications/services/gui/gui.h,, Header,+,applications/services/gui/gui.h,,
Header,+,applications/services/gui/icon_i.h,,
Header,+,applications/services/gui/modules/button_menu.h,, Header,+,applications/services/gui/modules/button_menu.h,,
Header,+,applications/services/gui/modules/button_panel.h,, Header,+,applications/services/gui/modules/button_panel.h,,
Header,+,applications/services/gui/modules/byte_input.h,, Header,+,applications/services/gui/modules/byte_input.h,,
@ -110,12 +111,42 @@ Header,+,lib/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_wwdg.h,,
Header,+,lib/flipper_application/flipper_application.h,, Header,+,lib/flipper_application/flipper_application.h,,
Header,+,lib/flipper_format/flipper_format.h,, Header,+,lib/flipper_format/flipper_format.h,,
Header,+,lib/flipper_format/flipper_format_i.h,, Header,+,lib/flipper_format/flipper_format_i.h,,
Header,+,lib/infrared/encoder_decoder/infrared.h,,
Header,+,lib/infrared/worker/infrared_transmit.h,,
Header,+,lib/infrared/worker/infrared_worker.h,,
Header,+,lib/lfrfid/lfrfid_dict_file.h,, Header,+,lib/lfrfid/lfrfid_dict_file.h,,
Header,+,lib/lfrfid/lfrfid_raw_file.h,, Header,+,lib/lfrfid/lfrfid_raw_file.h,,
Header,+,lib/lfrfid/lfrfid_raw_worker.h,, Header,+,lib/lfrfid/lfrfid_raw_worker.h,,
Header,+,lib/lfrfid/lfrfid_worker.h,, Header,+,lib/lfrfid/lfrfid_worker.h,,
Header,+,lib/lfrfid/protocols/lfrfid_protocols.h,, Header,+,lib/lfrfid/protocols/lfrfid_protocols.h,,
Header,+,lib/lfrfid/tools/bit_lib.h,, Header,+,lib/lfrfid/tools/bit_lib.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_button.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_consumer.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_desktop.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_device.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_game.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_keyboard.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_led.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_ordinal.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_power.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_simulation.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_sport.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_telephony.h,,
Header,+,lib/libusb_stm32/inc/hid_usage_vr.h,,
Header,+,lib/libusb_stm32/inc/usb.h,,
Header,+,lib/libusb_stm32/inc/usb_cdc.h,,
Header,+,lib/libusb_stm32/inc/usb_cdca.h,,
Header,+,lib/libusb_stm32/inc/usb_cdce.h,,
Header,+,lib/libusb_stm32/inc/usb_cdci.h,,
Header,+,lib/libusb_stm32/inc/usb_cdcp.h,,
Header,+,lib/libusb_stm32/inc/usb_cdcw.h,,
Header,+,lib/libusb_stm32/inc/usb_dfu.h,,
Header,+,lib/libusb_stm32/inc/usb_hid.h,,
Header,+,lib/libusb_stm32/inc/usb_std.h,,
Header,+,lib/libusb_stm32/inc/usb_tmc.h,,
Header,+,lib/libusb_stm32/inc/usbd_core.h,,
Header,+,lib/mbedtls/include/mbedtls/des.h,,
Header,+,lib/mbedtls/include/mbedtls/sha1.h,,
Header,+,lib/micro-ecc/uECC.h,, Header,+,lib/micro-ecc/uECC.h,,
Header,+,lib/one_wire/ibutton/ibutton_worker.h,, Header,+,lib/one_wire/ibutton/ibutton_worker.h,,
Header,+,lib/one_wire/maxim_crc.h,, Header,+,lib/one_wire/maxim_crc.h,,
@ -132,6 +163,7 @@ Header,+,lib/subghz/blocks/math.h,,
Header,+,lib/subghz/environment.h,, Header,+,lib/subghz/environment.h,,
Header,+,lib/subghz/protocols/raw.h,, Header,+,lib/subghz/protocols/raw.h,,
Header,+,lib/subghz/receiver.h,, Header,+,lib/subghz/receiver.h,,
Header,+,lib/subghz/registry.h,,
Header,+,lib/subghz/subghz_setting.h,, Header,+,lib/subghz/subghz_setting.h,,
Header,+,lib/subghz/subghz_tx_rx_worker.h,, Header,+,lib/subghz/subghz_tx_rx_worker.h,,
Header,+,lib/subghz/subghz_worker.h,, Header,+,lib/subghz/subghz_worker.h,,
@ -407,6 +439,7 @@ Function,-,_system_r,int,"_reent*, const char*"
Function,-,_tempnam_r,char*,"_reent*, const char*, const char*" Function,-,_tempnam_r,char*,"_reent*, const char*, const char*"
Function,-,_tmpfile_r,FILE*,_reent* Function,-,_tmpfile_r,FILE*,_reent*
Function,-,_tmpnam_r,char*,"_reent*, char*" Function,-,_tmpnam_r,char*,"_reent*, char*"
Function,-,_tzset_r,void,_reent*
Function,-,_ungetc_r,int,"_reent*, int, FILE*" Function,-,_ungetc_r,int,"_reent*, int, FILE*"
Function,-,_unsetenv_r,int,"_reent*, const char*" Function,-,_unsetenv_r,int,"_reent*, const char*"
Function,-,_vasiprintf_r,int,"_reent*, char**, const char*, __gnuc_va_list" Function,-,_vasiprintf_r,int,"_reent*, char**, const char*, __gnuc_va_list"
@ -454,6 +487,8 @@ Function,+,args_read_hex_bytes,_Bool,"FuriString*, uint8_t*, size_t"
Function,+,args_read_int_and_trim,_Bool,"FuriString*, int*" Function,+,args_read_int_and_trim,_Bool,"FuriString*, int*"
Function,+,args_read_probably_quoted_string_and_trim,_Bool,"FuriString*, FuriString*" Function,+,args_read_probably_quoted_string_and_trim,_Bool,"FuriString*, FuriString*"
Function,+,args_read_string_and_trim,_Bool,"FuriString*, FuriString*" Function,+,args_read_string_and_trim,_Bool,"FuriString*, FuriString*"
Function,-,asctime,char*,const tm*
Function,-,asctime_r,char*,"const tm*, char*"
Function,-,asin,double,double Function,-,asin,double,double
Function,-,asinf,float,float Function,-,asinf,float,float
Function,-,asinh,double,double Function,-,asinh,double,double
@ -621,6 +656,7 @@ Function,+,cli_read_timeout,size_t,"Cli*, uint8_t*, size_t, uint32_t"
Function,+,cli_session_close,void,Cli* Function,+,cli_session_close,void,Cli*
Function,+,cli_session_open,void,"Cli*, void*" Function,+,cli_session_open,void,"Cli*, void*"
Function,+,cli_write,void,"Cli*, const uint8_t*, size_t" Function,+,cli_write,void,"Cli*, const uint8_t*, size_t"
Function,-,clock,clock_t,
Function,-,copysign,double,"double, double" Function,-,copysign,double,"double, double"
Function,-,copysignf,float,"float, float" Function,-,copysignf,float,"float, float"
Function,-,copysignl,long double,"long double, long double" Function,-,copysignl,long double,"long double, long double"
@ -633,6 +669,8 @@ Function,-,cosl,long double,long double
Function,+,crc32_calc_buffer,uint32_t,"uint32_t, const void*, size_t" Function,+,crc32_calc_buffer,uint32_t,"uint32_t, const void*, size_t"
Function,+,crc32_calc_file,uint32_t,"File*, const FileCrcProgressCb, void*" Function,+,crc32_calc_file,uint32_t,"File*, const FileCrcProgressCb, void*"
Function,-,ctermid,char*,char* Function,-,ctermid,char*,char*
Function,-,ctime,char*,const time_t*
Function,-,ctime_r,char*,"const time_t*, char*"
Function,-,cuserid,char*,char* Function,-,cuserid,char*,char*
Function,+,delete_mutex,_Bool,ValueMutex* Function,+,delete_mutex,_Bool,ValueMutex*
Function,+,dialog_ex_alloc,DialogEx*, Function,+,dialog_ex_alloc,DialogEx*,
@ -659,6 +697,7 @@ Function,+,dialog_message_set_icon,void,"DialogMessage*, const Icon*, uint8_t, u
Function,+,dialog_message_set_text,void,"DialogMessage*, const char*, uint8_t, uint8_t, Align, Align" Function,+,dialog_message_set_text,void,"DialogMessage*, const char*, uint8_t, uint8_t, Align, Align"
Function,+,dialog_message_show,DialogMessageButton,"DialogsApp*, const DialogMessage*" Function,+,dialog_message_show,DialogMessageButton,"DialogsApp*, const DialogMessage*"
Function,+,dialog_message_show_storage_error,void,"DialogsApp*, const char*" Function,+,dialog_message_show_storage_error,void,"DialogsApp*, const char*"
Function,-,difftime,double,"time_t, time_t"
Function,-,digital_signal_alloc,DigitalSignal*,uint32_t Function,-,digital_signal_alloc,DigitalSignal*,uint32_t
Function,-,digital_signal_append,_Bool,"DigitalSignal*, DigitalSignal*" Function,-,digital_signal_append,_Bool,"DigitalSignal*, DigitalSignal*"
Function,-,digital_signal_free,void,DigitalSignal* Function,-,digital_signal_free,void,DigitalSignal*
@ -1475,6 +1514,8 @@ Function,-,getenv,char*,const char*
Function,-,gets,char*,char* Function,-,gets,char*,char*
Function,-,getsubopt,int,"char**, char**, char**" Function,-,getsubopt,int,"char**, char**, char**"
Function,-,getw,int,FILE* Function,-,getw,int,FILE*
Function,-,gmtime,tm*,const time_t*
Function,-,gmtime_r,tm*,"const time_t*, tm*"
Function,+,gui_add_framebuffer_callback,void,"Gui*, GuiCanvasCommitCallback, void*" Function,+,gui_add_framebuffer_callback,void,"Gui*, GuiCanvasCommitCallback, void*"
Function,+,gui_add_view_port,void,"Gui*, ViewPort*, GuiLayer" Function,+,gui_add_view_port,void,"Gui*, ViewPort*, GuiLayer"
Function,+,gui_get_framebuffer_size,size_t,Gui* Function,+,gui_get_framebuffer_size,size_t,Gui*
@ -1535,6 +1576,42 @@ Function,-,ilogbl,int,long double
Function,-,index,char*,"const char*, int" Function,-,index,char*,"const char*, int"
Function,-,infinity,double, Function,-,infinity,double,
Function,-,infinityf,float, Function,-,infinityf,float,
Function,+,infrared_alloc_decoder,InfraredDecoderHandler*,
Function,+,infrared_alloc_encoder,InfraredEncoderHandler*,
Function,+,infrared_check_decoder_ready,const InfraredMessage*,InfraredDecoderHandler*
Function,+,infrared_decode,const InfraredMessage*,"InfraredDecoderHandler*, _Bool, uint32_t"
Function,+,infrared_encode,InfraredStatus,"InfraredEncoderHandler*, uint32_t*, _Bool*"
Function,+,infrared_free_decoder,void,InfraredDecoderHandler*
Function,+,infrared_free_encoder,void,InfraredEncoderHandler*
Function,+,infrared_get_protocol_address_length,uint8_t,InfraredProtocol
Function,+,infrared_get_protocol_by_name,InfraredProtocol,const char*
Function,+,infrared_get_protocol_command_length,uint8_t,InfraredProtocol
Function,+,infrared_get_protocol_duty_cycle,float,InfraredProtocol
Function,+,infrared_get_protocol_frequency,uint32_t,InfraredProtocol
Function,+,infrared_get_protocol_name,const char*,InfraredProtocol
Function,+,infrared_is_protocol_valid,_Bool,InfraredProtocol
Function,+,infrared_reset_decoder,void,InfraredDecoderHandler*
Function,+,infrared_reset_encoder,void,"InfraredEncoderHandler*, const InfraredMessage*"
Function,+,infrared_send,void,"const InfraredMessage*, int"
Function,+,infrared_send_raw,void,"const uint32_t[], uint32_t, _Bool"
Function,+,infrared_send_raw_ext,void,"const uint32_t[], uint32_t, _Bool, uint32_t, float"
Function,+,infrared_worker_alloc,InfraredWorker*,
Function,+,infrared_worker_free,void,InfraredWorker*
Function,+,infrared_worker_get_decoded_signal,const InfraredMessage*,const InfraredWorkerSignal*
Function,+,infrared_worker_get_raw_signal,void,"const InfraredWorkerSignal*, const uint32_t**, size_t*"
Function,+,infrared_worker_rx_enable_blink_on_receiving,void,"InfraredWorker*, _Bool"
Function,+,infrared_worker_rx_enable_signal_decoding,void,"InfraredWorker*, _Bool"
Function,+,infrared_worker_rx_set_received_signal_callback,void,"InfraredWorker*, InfraredWorkerReceivedSignalCallback, void*"
Function,+,infrared_worker_rx_start,void,InfraredWorker*
Function,+,infrared_worker_rx_stop,void,InfraredWorker*
Function,+,infrared_worker_set_decoded_signal,void,"InfraredWorker*, const InfraredMessage*"
Function,+,infrared_worker_set_raw_signal,void,"InfraredWorker*, const uint32_t*, size_t"
Function,+,infrared_worker_signal_is_decoded,_Bool,const InfraredWorkerSignal*
Function,+,infrared_worker_tx_get_signal_steady_callback,InfraredWorkerGetSignalResponse,"void*, InfraredWorker*"
Function,+,infrared_worker_tx_set_get_signal_callback,void,"InfraredWorker*, InfraredWorkerGetSignalCallback, void*"
Function,+,infrared_worker_tx_set_signal_sent_callback,void,"InfraredWorker*, InfraredWorkerMessageSentCallback, void*"
Function,+,infrared_worker_tx_start,void,InfraredWorker*
Function,+,infrared_worker_tx_stop,void,InfraredWorker*
Function,+,init_mutex,_Bool,"ValueMutex*, void*, size_t" Function,+,init_mutex,_Bool,"ValueMutex*, void*, size_t"
Function,-,initstate,char*,"unsigned, char*, size_t" Function,-,initstate,char*,"unsigned, char*, size_t"
Function,+,input_get_key_name,const char*,InputKey Function,+,input_get_key_name,const char*,InputKey
@ -1634,6 +1711,8 @@ Function,+,loader_update_menu,void,
Function,+,loading_alloc,Loading*, Function,+,loading_alloc,Loading*,
Function,+,loading_free,void,Loading* Function,+,loading_free,void,Loading*
Function,+,loading_get_view,View*,Loading* Function,+,loading_get_view,View*,Loading*
Function,-,localtime,tm*,const time_t*
Function,-,localtime_r,tm*,"const time_t*, tm*"
Function,-,log,double,double Function,-,log,double,double
Function,-,log10,double,double Function,-,log10,double,double
Function,-,log10f,float,float Function,-,log10f,float,float
@ -1662,6 +1741,36 @@ Function,+,manchester_encoder_advance,_Bool,"ManchesterEncoderState*, const _Boo
Function,+,manchester_encoder_finish,ManchesterEncoderResult,ManchesterEncoderState* Function,+,manchester_encoder_finish,ManchesterEncoderResult,ManchesterEncoderState*
Function,+,manchester_encoder_reset,void,ManchesterEncoderState* Function,+,manchester_encoder_reset,void,ManchesterEncoderState*
Function,+,maxim_crc8,uint8_t,"const uint8_t*, const uint8_t, const uint8_t" Function,+,maxim_crc8,uint8_t,"const uint8_t*, const uint8_t, const uint8_t"
Function,-,mbedtls_des3_crypt_cbc,int,"mbedtls_des3_context*, int, size_t, unsigned char[8], const unsigned char*, unsigned char*"
Function,-,mbedtls_des3_crypt_ecb,int,"mbedtls_des3_context*, const unsigned char[8], unsigned char[8]"
Function,-,mbedtls_des3_free,void,mbedtls_des3_context*
Function,-,mbedtls_des3_init,void,mbedtls_des3_context*
Function,-,mbedtls_des3_set2key_dec,int,"mbedtls_des3_context*, const unsigned char[8 * 2]"
Function,-,mbedtls_des3_set2key_enc,int,"mbedtls_des3_context*, const unsigned char[8 * 2]"
Function,-,mbedtls_des3_set3key_dec,int,"mbedtls_des3_context*, const unsigned char[8 * 3]"
Function,-,mbedtls_des3_set3key_enc,int,"mbedtls_des3_context*, const unsigned char[8 * 3]"
Function,-,mbedtls_des_crypt_cbc,int,"mbedtls_des_context*, int, size_t, unsigned char[8], const unsigned char*, unsigned char*"
Function,-,mbedtls_des_crypt_ecb,int,"mbedtls_des_context*, const unsigned char[8], unsigned char[8]"
Function,-,mbedtls_des_free,void,mbedtls_des_context*
Function,-,mbedtls_des_init,void,mbedtls_des_context*
Function,-,mbedtls_des_key_check_key_parity,int,const unsigned char[8]
Function,-,mbedtls_des_key_check_weak,int,const unsigned char[8]
Function,-,mbedtls_des_key_set_parity,void,unsigned char[8]
Function,-,mbedtls_des_self_test,int,int
Function,-,mbedtls_des_setkey,void,"uint32_t[32], const unsigned char[8]"
Function,-,mbedtls_des_setkey_dec,int,"mbedtls_des_context*, const unsigned char[8]"
Function,-,mbedtls_des_setkey_enc,int,"mbedtls_des_context*, const unsigned char[8]"
Function,-,mbedtls_internal_sha1_process,int,"mbedtls_sha1_context*, const unsigned char[64]"
Function,-,mbedtls_platform_gmtime_r,tm*,"const mbedtls_time_t*, tm*"
Function,-,mbedtls_platform_zeroize,void,"void*, size_t"
Function,-,mbedtls_sha1,int,"const unsigned char*, size_t, unsigned char[20]"
Function,-,mbedtls_sha1_clone,void,"mbedtls_sha1_context*, const mbedtls_sha1_context*"
Function,-,mbedtls_sha1_finish,int,"mbedtls_sha1_context*, unsigned char[20]"
Function,-,mbedtls_sha1_free,void,mbedtls_sha1_context*
Function,-,mbedtls_sha1_init,void,mbedtls_sha1_context*
Function,-,mbedtls_sha1_self_test,int,int
Function,-,mbedtls_sha1_starts,int,mbedtls_sha1_context*
Function,-,mbedtls_sha1_update,int,"mbedtls_sha1_context*, const unsigned char*, size_t"
Function,-,mblen,int,"const char*, size_t" Function,-,mblen,int,"const char*, size_t"
Function,-,mbstowcs,size_t,"wchar_t*, const char*, size_t" Function,-,mbstowcs,size_t,"wchar_t*, const char*, size_t"
Function,-,mbtowc,int,"wchar_t*, const char*, size_t" Function,-,mbtowc,int,"wchar_t*, const char*, size_t"
@ -1702,6 +1811,7 @@ Function,-,mkostemps,int,"char*, int, int"
Function,-,mkstemp,int,char* Function,-,mkstemp,int,char*
Function,-,mkstemps,int,"char*, int" Function,-,mkstemps,int,"char*, int"
Function,-,mktemp,char*,char* Function,-,mktemp,char*,char*
Function,-,mktime,time_t,tm*
Function,-,modf,double,"double, double*" Function,-,modf,double,"double, double*"
Function,-,modff,float,"float, float*" Function,-,modff,float,"float, float*"
Function,-,modfl,long double,"long double, long double*" Function,-,modfl,long double,"long double, long double*"
@ -2210,6 +2320,8 @@ Function,+,stream_write_vaformat,size_t,"Stream*, const char*, va_list"
Function,-,strerror,char*,int Function,-,strerror,char*,int
Function,-,strerror_l,char*,"int, locale_t" Function,-,strerror_l,char*,"int, locale_t"
Function,-,strerror_r,char*,"int, char*, size_t" Function,-,strerror_r,char*,"int, char*, size_t"
Function,-,strftime,size_t,"char*, size_t, const char*, const tm*"
Function,-,strftime_l,size_t,"char*, size_t, const char*, const tm*, locale_t"
Function,+,string_stream_alloc,Stream*, Function,+,string_stream_alloc,Stream*,
Function,-,strlcat,size_t,"char*, const char*, size_t" Function,-,strlcat,size_t,"char*, const char*, size_t"
Function,+,strlcpy,size_t,"char*, const char*, size_t" Function,+,strlcpy,size_t,"char*, const char*, size_t"
@ -2224,6 +2336,8 @@ Function,-,strndup,char*,"const char*, size_t"
Function,-,strnlen,size_t,"const char*, size_t" Function,-,strnlen,size_t,"const char*, size_t"
Function,-,strnstr,char*,"const char*, const char*, size_t" Function,-,strnstr,char*,"const char*, const char*, size_t"
Function,-,strpbrk,char*,"const char*, const char*" Function,-,strpbrk,char*,"const char*, const char*"
Function,-,strptime,char*,"const char*, const char*, tm*"
Function,-,strptime_l,char*,"const char*, const char*, tm*, locale_t"
Function,+,strrchr,char*,"const char*, int" Function,+,strrchr,char*,"const char*, int"
Function,-,strsep,char*,"char**, const char*" Function,-,strsep,char*,"char**, const char*"
Function,-,strsignal,char*,int Function,-,strsignal,char*,int
@ -2313,6 +2427,9 @@ Function,+,subghz_protocol_raw_get_sample_write,size_t,SubGhzProtocolDecoderRAW*
Function,+,subghz_protocol_raw_save_to_file_init,_Bool,"SubGhzProtocolDecoderRAW*, const char*, SubGhzRadioPreset*" Function,+,subghz_protocol_raw_save_to_file_init,_Bool,"SubGhzProtocolDecoderRAW*, const char*, SubGhzRadioPreset*"
Function,+,subghz_protocol_raw_save_to_file_pause,void,"SubGhzProtocolDecoderRAW*, _Bool" Function,+,subghz_protocol_raw_save_to_file_pause,void,"SubGhzProtocolDecoderRAW*, _Bool"
Function,+,subghz_protocol_raw_save_to_file_stop,void,SubGhzProtocolDecoderRAW* Function,+,subghz_protocol_raw_save_to_file_stop,void,SubGhzProtocolDecoderRAW*
Function,+,subghz_protocol_registry_count,size_t,const SubGhzProtocolRegistry*
Function,+,subghz_protocol_registry_get_by_index,const SubGhzProtocol*,"const SubGhzProtocolRegistry*, size_t"
Function,+,subghz_protocol_registry_get_by_name,const SubGhzProtocol*,"const SubGhzProtocolRegistry*, const char*"
Function,+,subghz_receiver_alloc_init,SubGhzReceiver*,SubGhzEnvironment* Function,+,subghz_receiver_alloc_init,SubGhzReceiver*,SubGhzEnvironment*
Function,+,subghz_receiver_decode,void,"SubGhzReceiver*, _Bool, uint32_t" Function,+,subghz_receiver_decode,void,"SubGhzReceiver*, _Bool, uint32_t"
Function,+,subghz_receiver_free,void,SubGhzReceiver* Function,+,subghz_receiver_free,void,SubGhzReceiver*
@ -2411,6 +2528,7 @@ Function,+,text_input_set_validator,void,"TextInput*, TextInputValidatorCallback
Function,-,tgamma,double,double Function,-,tgamma,double,double
Function,-,tgammaf,float,float Function,-,tgammaf,float,float
Function,-,tgammal,long double,long double Function,-,tgammal,long double,long double
Function,-,time,time_t,time_t*
Function,+,timerCalculateTimer,uint32_t,uint16_t Function,+,timerCalculateTimer,uint32_t,uint16_t
Function,-,timerDelay,void,uint16_t Function,-,timerDelay,void,uint16_t
Function,+,timerIsExpired,_Bool,uint32_t Function,+,timerIsExpired,_Bool,uint32_t
@ -2429,6 +2547,7 @@ Function,-,toupper_l,int,"int, locale_t"
Function,-,trunc,double,double Function,-,trunc,double,double
Function,-,truncf,float,float Function,-,truncf,float,float
Function,-,truncl,long double,long double Function,-,truncl,long double,long double
Function,-,tzset,void,
Function,-,uECC_compress,void,"const uint8_t*, uint8_t*, uECC_Curve" Function,-,uECC_compress,void,"const uint8_t*, uint8_t*, uECC_Curve"
Function,+,uECC_compute_public_key,int,"const uint8_t*, uint8_t*, uECC_Curve" Function,+,uECC_compute_public_key,int,"const uint8_t*, uint8_t*, uECC_Curve"
Function,-,uECC_curve_private_key_size,int,uECC_Curve Function,-,uECC_curve_private_key_size,int,uECC_Curve
@ -2666,10 +2785,13 @@ Variable,-,MSIRangeTable,const uint32_t[16],
Variable,-,SmpsPrescalerTable,const uint32_t[4][6], Variable,-,SmpsPrescalerTable,const uint32_t[4][6],
Variable,+,SystemCoreClock,uint32_t, Variable,+,SystemCoreClock,uint32_t,
Variable,+,_ctype_,const char[], Variable,+,_ctype_,const char[],
Variable,-,_daylight,int,
Variable,+,_global_impure_ptr,_reent*, Variable,+,_global_impure_ptr,_reent*,
Variable,+,_impure_ptr,_reent*, Variable,+,_impure_ptr,_reent*,
Variable,-,_sys_errlist,const char*[], Variable,-,_sys_errlist,const char*[],
Variable,-,_sys_nerr,int, Variable,-,_sys_nerr,int,
Variable,-,_timezone,long,
Variable,-,_tzname,char*[2],
Variable,+,cli_vcp,CliSession, Variable,+,cli_vcp,CliSession,
Variable,+,furi_hal_i2c_bus_external,FuriHalI2cBus, Variable,+,furi_hal_i2c_bus_external,FuriHalI2cBus,
Variable,+,furi_hal_i2c_bus_power,FuriHalI2cBus, Variable,+,furi_hal_i2c_bus_power,FuriHalI2cBus,

1 entry status name type params
2 Version + 7.0 7.2
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
7 Header + applications/services/dolphin/dolphin.h
8 Header + applications/services/gui/elements.h
9 Header + applications/services/gui/gui.h
10 Header + applications/services/gui/icon_i.h
11 Header + applications/services/gui/modules/button_menu.h
12 Header + applications/services/gui/modules/button_panel.h
13 Header + applications/services/gui/modules/byte_input.h
111 Header + lib/flipper_application/flipper_application.h
112 Header + lib/flipper_format/flipper_format.h
113 Header + lib/flipper_format/flipper_format_i.h
114 Header + lib/infrared/encoder_decoder/infrared.h
115 Header + lib/infrared/worker/infrared_transmit.h
116 Header + lib/infrared/worker/infrared_worker.h
117 Header + lib/lfrfid/lfrfid_dict_file.h
118 Header + lib/lfrfid/lfrfid_raw_file.h
119 Header + lib/lfrfid/lfrfid_raw_worker.h
120 Header + lib/lfrfid/lfrfid_worker.h
121 Header + lib/lfrfid/protocols/lfrfid_protocols.h
122 Header + lib/lfrfid/tools/bit_lib.h
123 Header + lib/libusb_stm32/inc/hid_usage_button.h
124 Header + lib/libusb_stm32/inc/hid_usage_consumer.h
125 Header + lib/libusb_stm32/inc/hid_usage_desktop.h
126 Header + lib/libusb_stm32/inc/hid_usage_device.h
127 Header + lib/libusb_stm32/inc/hid_usage_game.h
128 Header + lib/libusb_stm32/inc/hid_usage_keyboard.h
129 Header + lib/libusb_stm32/inc/hid_usage_led.h
130 Header + lib/libusb_stm32/inc/hid_usage_ordinal.h
131 Header + lib/libusb_stm32/inc/hid_usage_power.h
132 Header + lib/libusb_stm32/inc/hid_usage_simulation.h
133 Header + lib/libusb_stm32/inc/hid_usage_sport.h
134 Header + lib/libusb_stm32/inc/hid_usage_telephony.h
135 Header + lib/libusb_stm32/inc/hid_usage_vr.h
136 Header + lib/libusb_stm32/inc/usb.h
137 Header + lib/libusb_stm32/inc/usb_cdc.h
138 Header + lib/libusb_stm32/inc/usb_cdca.h
139 Header + lib/libusb_stm32/inc/usb_cdce.h
140 Header + lib/libusb_stm32/inc/usb_cdci.h
141 Header + lib/libusb_stm32/inc/usb_cdcp.h
142 Header + lib/libusb_stm32/inc/usb_cdcw.h
143 Header + lib/libusb_stm32/inc/usb_dfu.h
144 Header + lib/libusb_stm32/inc/usb_hid.h
145 Header + lib/libusb_stm32/inc/usb_std.h
146 Header + lib/libusb_stm32/inc/usb_tmc.h
147 Header + lib/libusb_stm32/inc/usbd_core.h
148 Header + lib/mbedtls/include/mbedtls/des.h
149 Header + lib/mbedtls/include/mbedtls/sha1.h
150 Header + lib/micro-ecc/uECC.h
151 Header + lib/one_wire/ibutton/ibutton_worker.h
152 Header + lib/one_wire/maxim_crc.h
163 Header + lib/subghz/environment.h
164 Header + lib/subghz/protocols/raw.h
165 Header + lib/subghz/receiver.h
166 Header + lib/subghz/registry.h
167 Header + lib/subghz/subghz_setting.h
168 Header + lib/subghz/subghz_tx_rx_worker.h
169 Header + lib/subghz/subghz_worker.h
439 Function - _tempnam_r char* _reent*, const char*, const char*
440 Function - _tmpfile_r FILE* _reent*
441 Function - _tmpnam_r char* _reent*, char*
442 Function - _tzset_r void _reent*
443 Function - _ungetc_r int _reent*, int, FILE*
444 Function - _unsetenv_r int _reent*, const char*
445 Function - _vasiprintf_r int _reent*, char**, const char*, __gnuc_va_list
487 Function + args_read_int_and_trim _Bool FuriString*, int*
488 Function + args_read_probably_quoted_string_and_trim _Bool FuriString*, FuriString*
489 Function + args_read_string_and_trim _Bool FuriString*, FuriString*
490 Function - asctime char* const tm*
491 Function - asctime_r char* const tm*, char*
492 Function - asin double double
493 Function - asinf float float
494 Function - asinh double double
656 Function + cli_session_close void Cli*
657 Function + cli_session_open void Cli*, void*
658 Function + cli_write void Cli*, const uint8_t*, size_t
659 Function - clock clock_t
660 Function - copysign double double, double
661 Function - copysignf float float, float
662 Function - copysignl long double long double, long double
669 Function + crc32_calc_buffer uint32_t uint32_t, const void*, size_t
670 Function + crc32_calc_file uint32_t File*, const FileCrcProgressCb, void*
671 Function - ctermid char* char*
672 Function - ctime char* const time_t*
673 Function - ctime_r char* const time_t*, char*
674 Function - cuserid char* char*
675 Function + delete_mutex _Bool ValueMutex*
676 Function + dialog_ex_alloc DialogEx*
697 Function + dialog_message_set_text void DialogMessage*, const char*, uint8_t, uint8_t, Align, Align
698 Function + dialog_message_show DialogMessageButton DialogsApp*, const DialogMessage*
699 Function + dialog_message_show_storage_error void DialogsApp*, const char*
700 Function - difftime double time_t, time_t
701 Function - digital_signal_alloc DigitalSignal* uint32_t
702 Function - digital_signal_append _Bool DigitalSignal*, DigitalSignal*
703 Function - digital_signal_free void DigitalSignal*
1514 Function - gets char* char*
1515 Function - getsubopt int char**, char**, char**
1516 Function - getw int FILE*
1517 Function - gmtime tm* const time_t*
1518 Function - gmtime_r tm* const time_t*, tm*
1519 Function + gui_add_framebuffer_callback void Gui*, GuiCanvasCommitCallback, void*
1520 Function + gui_add_view_port void Gui*, ViewPort*, GuiLayer
1521 Function + gui_get_framebuffer_size size_t Gui*
1576 Function - index char* const char*, int
1577 Function - infinity double
1578 Function - infinityf float
1579 Function + infrared_alloc_decoder InfraredDecoderHandler*
1580 Function + infrared_alloc_encoder InfraredEncoderHandler*
1581 Function + infrared_check_decoder_ready const InfraredMessage* InfraredDecoderHandler*
1582 Function + infrared_decode const InfraredMessage* InfraredDecoderHandler*, _Bool, uint32_t
1583 Function + infrared_encode InfraredStatus InfraredEncoderHandler*, uint32_t*, _Bool*
1584 Function + infrared_free_decoder void InfraredDecoderHandler*
1585 Function + infrared_free_encoder void InfraredEncoderHandler*
1586 Function + infrared_get_protocol_address_length uint8_t InfraredProtocol
1587 Function + infrared_get_protocol_by_name InfraredProtocol const char*
1588 Function + infrared_get_protocol_command_length uint8_t InfraredProtocol
1589 Function + infrared_get_protocol_duty_cycle float InfraredProtocol
1590 Function + infrared_get_protocol_frequency uint32_t InfraredProtocol
1591 Function + infrared_get_protocol_name const char* InfraredProtocol
1592 Function + infrared_is_protocol_valid _Bool InfraredProtocol
1593 Function + infrared_reset_decoder void InfraredDecoderHandler*
1594 Function + infrared_reset_encoder void InfraredEncoderHandler*, const InfraredMessage*
1595 Function + infrared_send void const InfraredMessage*, int
1596 Function + infrared_send_raw void const uint32_t[], uint32_t, _Bool
1597 Function + infrared_send_raw_ext void const uint32_t[], uint32_t, _Bool, uint32_t, float
1598 Function + infrared_worker_alloc InfraredWorker*
1599 Function + infrared_worker_free void InfraredWorker*
1600 Function + infrared_worker_get_decoded_signal const InfraredMessage* const InfraredWorkerSignal*
1601 Function + infrared_worker_get_raw_signal void const InfraredWorkerSignal*, const uint32_t**, size_t*
1602 Function + infrared_worker_rx_enable_blink_on_receiving void InfraredWorker*, _Bool
1603 Function + infrared_worker_rx_enable_signal_decoding void InfraredWorker*, _Bool
1604 Function + infrared_worker_rx_set_received_signal_callback void InfraredWorker*, InfraredWorkerReceivedSignalCallback, void*
1605 Function + infrared_worker_rx_start void InfraredWorker*
1606 Function + infrared_worker_rx_stop void InfraredWorker*
1607 Function + infrared_worker_set_decoded_signal void InfraredWorker*, const InfraredMessage*
1608 Function + infrared_worker_set_raw_signal void InfraredWorker*, const uint32_t*, size_t
1609 Function + infrared_worker_signal_is_decoded _Bool const InfraredWorkerSignal*
1610 Function + infrared_worker_tx_get_signal_steady_callback InfraredWorkerGetSignalResponse void*, InfraredWorker*
1611 Function + infrared_worker_tx_set_get_signal_callback void InfraredWorker*, InfraredWorkerGetSignalCallback, void*
1612 Function + infrared_worker_tx_set_signal_sent_callback void InfraredWorker*, InfraredWorkerMessageSentCallback, void*
1613 Function + infrared_worker_tx_start void InfraredWorker*
1614 Function + infrared_worker_tx_stop void InfraredWorker*
1615 Function + init_mutex _Bool ValueMutex*, void*, size_t
1616 Function - initstate char* unsigned, char*, size_t
1617 Function + input_get_key_name const char* InputKey
1711 Function + loading_alloc Loading*
1712 Function + loading_free void Loading*
1713 Function + loading_get_view View* Loading*
1714 Function - localtime tm* const time_t*
1715 Function - localtime_r tm* const time_t*, tm*
1716 Function - log double double
1717 Function - log10 double double
1718 Function - log10f float float
1741 Function + manchester_encoder_finish ManchesterEncoderResult ManchesterEncoderState*
1742 Function + manchester_encoder_reset void ManchesterEncoderState*
1743 Function + maxim_crc8 uint8_t const uint8_t*, const uint8_t, const uint8_t
1744 Function - mbedtls_des3_crypt_cbc int mbedtls_des3_context*, int, size_t, unsigned char[8], const unsigned char*, unsigned char*
1745 Function - mbedtls_des3_crypt_ecb int mbedtls_des3_context*, const unsigned char[8], unsigned char[8]
1746 Function - mbedtls_des3_free void mbedtls_des3_context*
1747 Function - mbedtls_des3_init void mbedtls_des3_context*
1748 Function - mbedtls_des3_set2key_dec int mbedtls_des3_context*, const unsigned char[8 * 2]
1749 Function - mbedtls_des3_set2key_enc int mbedtls_des3_context*, const unsigned char[8 * 2]
1750 Function - mbedtls_des3_set3key_dec int mbedtls_des3_context*, const unsigned char[8 * 3]
1751 Function - mbedtls_des3_set3key_enc int mbedtls_des3_context*, const unsigned char[8 * 3]
1752 Function - mbedtls_des_crypt_cbc int mbedtls_des_context*, int, size_t, unsigned char[8], const unsigned char*, unsigned char*
1753 Function - mbedtls_des_crypt_ecb int mbedtls_des_context*, const unsigned char[8], unsigned char[8]
1754 Function - mbedtls_des_free void mbedtls_des_context*
1755 Function - mbedtls_des_init void mbedtls_des_context*
1756 Function - mbedtls_des_key_check_key_parity int const unsigned char[8]
1757 Function - mbedtls_des_key_check_weak int const unsigned char[8]
1758 Function - mbedtls_des_key_set_parity void unsigned char[8]
1759 Function - mbedtls_des_self_test int int
1760 Function - mbedtls_des_setkey void uint32_t[32], const unsigned char[8]
1761 Function - mbedtls_des_setkey_dec int mbedtls_des_context*, const unsigned char[8]
1762 Function - mbedtls_des_setkey_enc int mbedtls_des_context*, const unsigned char[8]
1763 Function - mbedtls_internal_sha1_process int mbedtls_sha1_context*, const unsigned char[64]
1764 Function - mbedtls_platform_gmtime_r tm* const mbedtls_time_t*, tm*
1765 Function - mbedtls_platform_zeroize void void*, size_t
1766 Function - mbedtls_sha1 int const unsigned char*, size_t, unsigned char[20]
1767 Function - mbedtls_sha1_clone void mbedtls_sha1_context*, const mbedtls_sha1_context*
1768 Function - mbedtls_sha1_finish int mbedtls_sha1_context*, unsigned char[20]
1769 Function - mbedtls_sha1_free void mbedtls_sha1_context*
1770 Function - mbedtls_sha1_init void mbedtls_sha1_context*
1771 Function - mbedtls_sha1_self_test int int
1772 Function - mbedtls_sha1_starts int mbedtls_sha1_context*
1773 Function - mbedtls_sha1_update int mbedtls_sha1_context*, const unsigned char*, size_t
1774 Function - mblen int const char*, size_t
1775 Function - mbstowcs size_t wchar_t*, const char*, size_t
1776 Function - mbtowc int wchar_t*, const char*, size_t
1811 Function - mkstemp int char*
1812 Function - mkstemps int char*, int
1813 Function - mktemp char* char*
1814 Function - mktime time_t tm*
1815 Function - modf double double, double*
1816 Function - modff float float, float*
1817 Function - modfl long double long double, long double*
2320 Function - strerror char* int
2321 Function - strerror_l char* int, locale_t
2322 Function - strerror_r char* int, char*, size_t
2323 Function - strftime size_t char*, size_t, const char*, const tm*
2324 Function - strftime_l size_t char*, size_t, const char*, const tm*, locale_t
2325 Function + string_stream_alloc Stream*
2326 Function - strlcat size_t char*, const char*, size_t
2327 Function + strlcpy size_t char*, const char*, size_t
2336 Function - strnlen size_t const char*, size_t
2337 Function - strnstr char* const char*, const char*, size_t
2338 Function - strpbrk char* const char*, const char*
2339 Function - strptime char* const char*, const char*, tm*
2340 Function - strptime_l char* const char*, const char*, tm*, locale_t
2341 Function + strrchr char* const char*, int
2342 Function - strsep char* char**, const char*
2343 Function - strsignal char* int
2427 Function + subghz_protocol_raw_save_to_file_init _Bool SubGhzProtocolDecoderRAW*, const char*, SubGhzRadioPreset*
2428 Function + subghz_protocol_raw_save_to_file_pause void SubGhzProtocolDecoderRAW*, _Bool
2429 Function + subghz_protocol_raw_save_to_file_stop void SubGhzProtocolDecoderRAW*
2430 Function + subghz_protocol_registry_count size_t const SubGhzProtocolRegistry*
2431 Function + subghz_protocol_registry_get_by_index const SubGhzProtocol* const SubGhzProtocolRegistry*, size_t
2432 Function + subghz_protocol_registry_get_by_name const SubGhzProtocol* const SubGhzProtocolRegistry*, const char*
2433 Function + subghz_receiver_alloc_init SubGhzReceiver* SubGhzEnvironment*
2434 Function + subghz_receiver_decode void SubGhzReceiver*, _Bool, uint32_t
2435 Function + subghz_receiver_free void SubGhzReceiver*
2528 Function - tgamma double double
2529 Function - tgammaf float float
2530 Function - tgammal long double long double
2531 Function - time time_t time_t*
2532 Function + timerCalculateTimer uint32_t uint16_t
2533 Function - timerDelay void uint16_t
2534 Function + timerIsExpired _Bool uint32_t
2547 Function - trunc double double
2548 Function - truncf float float
2549 Function - truncl long double long double
2550 Function - tzset void
2551 Function - uECC_compress void const uint8_t*, uint8_t*, uECC_Curve
2552 Function + uECC_compute_public_key int const uint8_t*, uint8_t*, uECC_Curve
2553 Function - uECC_curve_private_key_size int uECC_Curve
2785 Variable - SmpsPrescalerTable const uint32_t[4][6]
2786 Variable + SystemCoreClock uint32_t
2787 Variable + _ctype_ const char[]
2788 Variable - _daylight int
2789 Variable + _global_impure_ptr _reent*
2790 Variable + _impure_ptr _reent*
2791 Variable - _sys_errlist const char*[]
2792 Variable - _sys_nerr int
2793 Variable - _timezone long
2794 Variable - _tzname char*[2]
2795 Variable + cli_vcp CliSession
2796 Variable + furi_hal_i2c_bus_external FuriHalI2cBus
2797 Variable + furi_hal_i2c_bus_power FuriHalI2cBus

View File

@ -17,12 +17,12 @@ env.Append(
"lib/print", "lib/print",
], ],
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/one_wire/one_wire_host_timing.h"), File("one_wire/one_wire_host_timing.h"),
File("#/lib/one_wire/one_wire_host.h"), File("one_wire/one_wire_host.h"),
File("#/lib/one_wire/one_wire_slave.h"), File("one_wire/one_wire_slave.h"),
File("#/lib/one_wire/one_wire_device.h"), File("one_wire/one_wire_device.h"),
File("#/lib/one_wire/ibutton/ibutton_worker.h"), File("one_wire/ibutton/ibutton_worker.h"),
File("#/lib/one_wire/maxim_crc.h"), File("one_wire/maxim_crc.h"),
], ],
) )

View File

@ -15,7 +15,7 @@ env.Append(
], ],
SDK_HEADERS=env.GlobRecursive( SDK_HEADERS=env.GlobRecursive(
"*_ll_*.h", "*_ll_*.h",
"#/lib/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc/", Dir("STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc/"),
exclude="*usb.h", exclude="*usb.h",
), ),
) )

View File

@ -5,7 +5,7 @@ env.Append(
"#/lib/flipper_application", "#/lib/flipper_application",
], ],
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/flipper_application/flipper_application.h"), File("flipper_application.h"),
], ],
) )

View File

@ -5,8 +5,8 @@ env.Append(
"#/lib/flipper_format", "#/lib/flipper_format",
], ],
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/flipper_format/flipper_format.h"), File("flipper_format.h"),
File("#/lib/flipper_format/flipper_format_i.h"), File("flipper_format_i.h"),
], ],
) )

View File

@ -5,6 +5,11 @@ env.Append(
"#/lib/infrared/encoder_decoder", "#/lib/infrared/encoder_decoder",
"#/lib/infrared/worker", "#/lib/infrared/worker",
], ],
SDK_HEADERS=[
File("encoder_decoder/infrared.h"),
File("worker/infrared_worker.h"),
File("worker/infrared_transmit.h"),
],
) )

View File

@ -8,12 +8,12 @@ env.Append(
"#/lib/lfrfid", "#/lib/lfrfid",
], ],
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/lfrfid/lfrfid_worker.h"), File("lfrfid_worker.h"),
File("#/lib/lfrfid/lfrfid_raw_worker.h"), File("lfrfid_raw_worker.h"),
File("#/lib/lfrfid/lfrfid_raw_file.h"), File("lfrfid_raw_file.h"),
File("#/lib/lfrfid/lfrfid_dict_file.h"), File("lfrfid_dict_file.h"),
File("#/lib/lfrfid/tools/bit_lib.h"), File("tools/bit_lib.h"),
File("#/lib/lfrfid/protocols/lfrfid_protocols.h"), File("protocols/lfrfid_protocols.h"),
], ],
) )

View File

@ -7,6 +7,10 @@ env.Append(
CPPDEFINES=[ CPPDEFINES=[
("USB_PMASIZE", "0x400"), ("USB_PMASIZE", "0x400"),
], ],
SDK_HEADERS=env.GlobRecursive(
"*.h",
Dir("libusb_stm32/inc"),
),
) )

View File

@ -5,6 +5,10 @@ env.Append(
"#/lib/mbedtls", "#/lib/mbedtls",
"#/lib/mbedtls/include", "#/lib/mbedtls/include",
], ],
SDK_HEADERS=[
File("mbedtls/include/mbedtls/des.h"),
File("mbedtls/include/mbedtls/sha1.h"),
],
) )

View File

@ -13,7 +13,7 @@ env.Append(
"PB_ENABLE_MALLOC", "PB_ENABLE_MALLOC",
], ],
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/micro-ecc/uECC.h"), File("micro-ecc/uECC.h"),
], ],
) )

View File

@ -98,7 +98,7 @@ for wrapped_fn in wrapped_fn_list:
env.Append( env.Append(
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/print/wrappers.h"), File("wrappers.h"),
], ],
) )

View File

@ -5,18 +5,19 @@ env.Append(
"#/lib/subghz", "#/lib/subghz",
], ],
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/subghz/environment.h"), File("environment.h"),
File("#/lib/subghz/receiver.h"), File("receiver.h"),
File("#/lib/subghz/subghz_worker.h"), File("registry.h"),
File("#/lib/subghz/subghz_tx_rx_worker.h"), File("subghz_worker.h"),
File("#/lib/subghz/transmitter.h"), File("subghz_tx_rx_worker.h"),
File("#/lib/subghz/protocols/raw.h"), File("transmitter.h"),
File("#/lib/subghz/blocks/const.h"), File("protocols/raw.h"),
File("#/lib/subghz/blocks/decoder.h"), File("blocks/const.h"),
File("#/lib/subghz/blocks/encoder.h"), File("blocks/decoder.h"),
File("#/lib/subghz/blocks/generic.h"), File("blocks/encoder.h"),
File("#/lib/subghz/blocks/math.h"), File("blocks/generic.h"),
File("#/lib/subghz/subghz_setting.h"), File("blocks/math.h"),
File("subghz_setting.h"),
], ],
) )

View File

@ -2,6 +2,10 @@
#include "types.h" #include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SubGhzEnvironment SubGhzEnvironment; typedef struct SubGhzEnvironment SubGhzEnvironment;
typedef struct SubGhzProtocolRegistry SubGhzProtocolRegistry; typedef struct SubGhzProtocolRegistry SubGhzProtocolRegistry;
@ -37,3 +41,7 @@ const SubGhzProtocol* subghz_protocol_registry_get_by_index(
* @return Number of protocols * @return Number of protocols
*/ */
size_t subghz_protocol_registry_count(const SubGhzProtocolRegistry* protocol_registry); size_t subghz_protocol_registry_count(const SubGhzProtocolRegistry* protocol_registry);
#ifdef __cplusplus
}
#endif

View File

@ -8,23 +8,23 @@ env.Append(
"#/lib/toolbox", "#/lib/toolbox",
], ],
SDK_HEADERS=[ SDK_HEADERS=[
File("#/lib/toolbox/manchester_decoder.h"), File("manchester_decoder.h"),
File("#/lib/toolbox/manchester_encoder.h"), File("manchester_encoder.h"),
File("#/lib/toolbox/path.h"), File("path.h"),
File("#/lib/toolbox/random_name.h"), File("random_name.h"),
File("#/lib/toolbox/hmac_sha256.h"), File("hmac_sha256.h"),
File("#/lib/toolbox/crc32_calc.h"), File("crc32_calc.h"),
File("#/lib/toolbox/dir_walk.h"), File("dir_walk.h"),
File("#/lib/toolbox/md5.h"), File("md5.h"),
File("#/lib/toolbox/args.h"), File("args.h"),
File("#/lib/toolbox/saved_struct.h"), File("saved_struct.h"),
File("#/lib/toolbox/version.h"), File("version.h"),
File("#/lib/toolbox/tar/tar_archive.h"), File("tar/tar_archive.h"),
File("#/lib/toolbox/stream/stream.h"), File("stream/stream.h"),
File("#/lib/toolbox/stream/file_stream.h"), File("stream/file_stream.h"),
File("#/lib/toolbox/stream/string_stream.h"), File("stream/string_stream.h"),
File("#/lib/toolbox/stream/buffered_file_stream.h"), File("stream/buffered_file_stream.h"),
File("#/lib/toolbox/protocols/protocol_dict.h"), File("protocols/protocol_dict.h"),
], ],
) )

View File

@ -1,11 +1,11 @@
import SCons import SCons
from SCons.Subst import quote_spaces from SCons.Subst import quote_spaces
from SCons.Errors import StopError from SCons.Errors import StopError
from SCons.Node.FS import _my_normcase
import re import re
import os import os
import random
import string
WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)") WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)")
@ -41,3 +41,14 @@ def link_dir(target_path, source_path, is_windows):
def single_quote(arg_list): def single_quote(arg_list):
return " ".join(f"'{arg}'" if " " in arg else str(arg) for arg in arg_list) return " ".join(f"'{arg}'" if " " in arg else str(arg) for arg in arg_list)
def extract_abs_dir_path(node):
if isinstance(node, SCons.Node.FS.EntryProxy):
node = node.get()
for repo_dir in node.get_all_rdirs():
if os.path.exists(repo_dir.abspath):
return repo_dir.abspath
raise StopError(f"Can't find absolute path for {node.name}")

View File

@ -37,6 +37,21 @@ def _get_tool_version(env, tool):
def generate(env, **kw): def generate(env, **kw):
if not env.get("VERBOSE", False):
env.SetDefault(
CCCOMSTR="\tCC\t${SOURCE}",
CXXCOMSTR="\tCPP\t${SOURCE}",
ASCOMSTR="\tASM\t${SOURCE}",
ARCOMSTR="\tAR\t${TARGET}",
RANLIBCOMSTR="\tRANLIB\t${TARGET}",
LINKCOMSTR="\tLINK\t${TARGET}",
INSTALLSTR="\tINSTALL\t${TARGET}",
APPSCOMSTR="\tAPPS\t${TARGET}",
VERSIONCOMSTR="\tVERSION\t${TARGET}",
STRIPCOMSTR="\tSTRIP\t${TARGET}",
OBJDUMPCOMSTR="\tOBJDUMP\t${TARGET}",
)
for orig_tool in (asm, gcc, gxx, ar, gnulink, strip, gdb, objdump): for orig_tool in (asm, gcc, gxx, ar, gnulink, strip, gdb, objdump):
orig_tool.generate(env) orig_tool.generate(env)
env.SetDefault( env.SetDefault(

View File

@ -2,7 +2,7 @@ from SCons.Builder import Builder
from SCons.Action import Action from SCons.Action import Action
from SCons.Warnings import warn, WarningOnByDefault from SCons.Warnings import warn, WarningOnByDefault
import SCons import SCons
import os.path from ansi.color import fg
from fbt.appmanifest import ( from fbt.appmanifest import (
FlipperAppType, FlipperAppType,
@ -16,21 +16,20 @@ from fbt.appmanifest import (
# AppBuildset env["APPBUILD"] - contains subset of apps, filtered for current config # AppBuildset env["APPBUILD"] - contains subset of apps, filtered for current config
def LoadApplicationManifests(env): def LoadAppManifest(env, entry):
appmgr = env["APPMGR"] = AppManager() try:
for app_dir, _ in env["APPDIRS"]: APP_MANIFEST_NAME = "application.fam"
app_dir_node = env.Dir("#").Dir(app_dir) manifest_glob = entry.glob(APP_MANIFEST_NAME)
if len(manifest_glob) == 0:
raise FlipperManifestException(
f"Folder {entry}: manifest {APP_MANIFEST_NAME} is missing"
)
for entry in app_dir_node.glob("*", ondisk=True, source=True): app_manifest_file_path = manifest_glob[0].rfile().abspath
if isinstance(entry, SCons.Node.FS.Dir) and not str(entry).startswith("."): env["APPMGR"].load_manifest(app_manifest_file_path, entry)
try: env.Append(PY_LINT_SOURCES=[app_manifest_file_path])
app_manifest_file_path = os.path.join( except FlipperManifestException as e:
entry.abspath, "application.fam" warn(WarningOnByDefault, str(e))
)
appmgr.load_manifest(app_manifest_file_path, entry)
env.Append(PY_LINT_SOURCES=[app_manifest_file_path])
except FlipperManifestException as e:
warn(WarningOnByDefault, str(e))
def PrepareApplicationsBuild(env): def PrepareApplicationsBuild(env):
@ -46,12 +45,12 @@ def PrepareApplicationsBuild(env):
def DumpApplicationConfig(target, source, env): def DumpApplicationConfig(target, source, env):
print(f"Loaded {len(env['APPMGR'].known_apps)} app definitions.") print(f"Loaded {len(env['APPMGR'].known_apps)} app definitions.")
print("Firmware modules configuration:") print(fg.boldgreen("Firmware modules configuration:"))
for apptype in FlipperAppType: for apptype in FlipperAppType:
app_sublist = env["APPBUILD"].get_apps_of_type(apptype) app_sublist = env["APPBUILD"].get_apps_of_type(apptype)
if app_sublist: if app_sublist:
print( print(
f"{apptype.value}:\n\t", fg.green(f"{apptype.value}:\n\t"),
", ".join(app.appid for app in app_sublist), ", ".join(app.appid for app in app_sublist),
) )
@ -65,8 +64,11 @@ def build_apps_c(target, source, env):
def generate(env): def generate(env):
env.AddMethod(LoadApplicationManifests) env.AddMethod(LoadAppManifest)
env.AddMethod(PrepareApplicationsBuild) env.AddMethod(PrepareApplicationsBuild)
env.SetDefault(
APPMGR=AppManager(),
)
env.Append( env.Append(
BUILDERS={ BUILDERS={

View File

@ -1,11 +1,10 @@
import SCons
from SCons.Builder import Builder from SCons.Builder import Builder
from SCons.Action import Action from SCons.Action import Action
from SCons.Node.FS import File from SCons.Errors import SConsEnvironmentError
import os import os
import subprocess import subprocess
from ansi.color import fg
def icons_emitter(target, source, env): def icons_emitter(target, source, env):
@ -13,7 +12,6 @@ def icons_emitter(target, source, env):
target[0].File(env.subst("${ICON_FILE_NAME}.c")), target[0].File(env.subst("${ICON_FILE_NAME}.c")),
target[0].File(env.subst("${ICON_FILE_NAME}.h")), target[0].File(env.subst("${ICON_FILE_NAME}.h")),
] ]
source = env.GlobRecursive("*.*", env["ICON_SRC_DIR"])
return target, source return target, source
@ -86,7 +84,7 @@ def proto_ver_generator(target, source, env):
) )
except (subprocess.CalledProcessError, EnvironmentError) as e: except (subprocess.CalledProcessError, EnvironmentError) as e:
# Not great, not terrible # Not great, not terrible
print("Git: fetch failed") print(fg.boldred("Git: fetch failed"))
try: try:
git_describe = _invoke_git( git_describe = _invoke_git(
@ -94,10 +92,8 @@ def proto_ver_generator(target, source, env):
source_dir=src_dir, source_dir=src_dir,
) )
except (subprocess.CalledProcessError, EnvironmentError) as e: except (subprocess.CalledProcessError, EnvironmentError) as e:
print("Git: describe failed") raise SConsEnvironmentError("Git: describe failed")
Exit("git error")
# print("describe=", git_describe)
git_major, git_minor = git_describe.split(".") git_major, git_minor = git_describe.split(".")
version_file_data = ( version_file_data = (
"#pragma once", "#pragma once",
@ -116,7 +112,7 @@ def CompileIcons(env, target_dir, source_dir, *, icon_bundle_name="assets_icons"
icons = env.IconBuilder( icons = env.IconBuilder(
target_dir, target_dir,
ICON_SRC_DIR=source_dir, source_dir,
ICON_FILE_NAME=icon_bundle_name, ICON_FILE_NAME=icon_bundle_name,
) )
env.Depends(icons, icons_src) env.Depends(icons, icons_src)
@ -125,8 +121,8 @@ def CompileIcons(env, target_dir, source_dir, *, icon_bundle_name="assets_icons"
def generate(env): def generate(env):
env.SetDefault( env.SetDefault(
ASSETS_COMPILER="${ROOT_DIR.abspath}/scripts/assets.py", ASSETS_COMPILER="${FBT_SCRIPT_DIR}/assets.py",
NANOPB_COMPILER="${ROOT_DIR.abspath}/lib/nanopb/generator/nanopb_generator.py", NANOPB_COMPILER="${ROOT_DIR}/lib/nanopb/generator/nanopb_generator.py",
) )
env.AddMethod(CompileIcons) env.AddMethod(CompileIcons)
@ -143,7 +139,7 @@ def generate(env):
BUILDERS={ BUILDERS={
"IconBuilder": Builder( "IconBuilder": Builder(
action=Action( action=Action(
'${PYTHON3} "${ASSETS_COMPILER}" icons ${ICON_SRC_DIR} ${TARGET.dir} --filename ${ICON_FILE_NAME}', '${PYTHON3} "${ASSETS_COMPILER}" icons ${ABSPATHGETTERFUNC(SOURCE)} ${TARGET.dir} --filename ${ICON_FILE_NAME}',
"${ICONSCOMSTR}", "${ICONSCOMSTR}",
), ),
emitter=icons_emitter, emitter=icons_emitter,

View File

@ -103,7 +103,7 @@ def DistCommand(env, name, source, **kw):
command = env.Command( command = env.Command(
target, target,
source, source,
'@${PYTHON3} "${ROOT_DIR.abspath}/scripts/sconsdist.py" copy -p ${DIST_PROJECTS} -s "${DIST_SUFFIX}" ${DIST_EXTRA}', '@${PYTHON3} "${DIST_SCRIPT}" copy -p ${DIST_PROJECTS} -s "${DIST_SUFFIX}" ${DIST_EXTRA}',
**kw, **kw,
) )
env.Pseudo(target) env.Pseudo(target)
@ -121,6 +121,9 @@ def generate(env):
env.SetDefault( env.SetDefault(
COPRO_MCU_FAMILY="STM32WB5x", COPRO_MCU_FAMILY="STM32WB5x",
SELFUPDATE_SCRIPT="${FBT_SCRIPT_DIR}/selfupdate.py",
DIST_SCRIPT="${FBT_SCRIPT_DIR}/sconsdist.py",
COPRO_ASSETS_SCRIPT="${FBT_SCRIPT_DIR}/assets.py",
) )
env.Append( env.Append(
@ -128,7 +131,7 @@ def generate(env):
"UsbInstall": Builder( "UsbInstall": Builder(
action=[ action=[
Action( Action(
'${PYTHON3} "${ROOT_DIR.abspath}/scripts/selfupdate.py" dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}/update.fuf' '${PYTHON3} "${SELFUPDATE_SCRIPT}" dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}/update.fuf'
), ),
Touch("${TARGET}"), Touch("${TARGET}"),
] ]
@ -136,7 +139,7 @@ def generate(env):
"CoproBuilder": Builder( "CoproBuilder": Builder(
action=Action( action=Action(
[ [
'${PYTHON3} "${ROOT_DIR.abspath}/scripts/assets.py" ' '${PYTHON3} "${COPRO_ASSETS_SCRIPT}" '
"copro ${COPRO_CUBE_DIR} " "copro ${COPRO_CUBE_DIR} "
"${TARGET} ${COPRO_MCU_FAMILY} " "${TARGET} ${COPRO_MCU_FAMILY} "
"--cube_ver=${COPRO_CUBE_VERSION} " "--cube_ver=${COPRO_CUBE_VERSION} "

View File

@ -1,15 +1,18 @@
import shutil
from SCons.Builder import Builder from SCons.Builder import Builder
from SCons.Action import Action from SCons.Action import Action
from SCons.Errors import UserError from SCons.Errors import UserError
import SCons.Warnings import SCons.Warnings
import os
import pathlib
from fbt.elfmanifest import assemble_manifest_data from fbt.elfmanifest import assemble_manifest_data
from fbt.appmanifest import FlipperApplication, FlipperManifestException from fbt.appmanifest import FlipperApplication, FlipperManifestException
from fbt.sdk.cache import SdkCache from fbt.sdk.cache import SdkCache
from fbt.util import extract_abs_dir_path
import os
import pathlib
import itertools import itertools
import shutil
from ansi.color import fg from ansi.color import fg
@ -62,7 +65,7 @@ def BuildAppElf(env, app):
lib_src_root_path = os.path.join(app_work_dir, "lib", lib_def.name) lib_src_root_path = os.path.join(app_work_dir, "lib", lib_def.name)
app_env.AppendUnique( app_env.AppendUnique(
CPPPATH=list( CPPPATH=list(
app_env.Dir(lib_src_root_path).Dir(incpath).srcnode() app_env.Dir(lib_src_root_path).Dir(incpath).srcnode().rfile().abspath
for incpath in lib_def.fap_include_paths for incpath in lib_def.fap_include_paths
), ),
) )
@ -82,7 +85,12 @@ def BuildAppElf(env, app):
*lib_def.cflags, *lib_def.cflags,
], ],
CPPDEFINES=lib_def.cdefines, CPPDEFINES=lib_def.cdefines,
CPPPATH=list(map(app._appdir.Dir, lib_def.cincludes)), CPPPATH=list(
map(
lambda cpath: extract_abs_dir_path(app._appdir.Dir(cpath)),
lib_def.cincludes,
)
),
) )
lib = private_lib_env.StaticLibrary( lib = private_lib_env.StaticLibrary(
@ -157,7 +165,6 @@ def prepare_app_metadata(target, source, env):
app = env["APP"] app = env["APP"]
meta_file_name = source[0].path + ".meta" meta_file_name = source[0].path + ".meta"
with open(meta_file_name, "wb") as f: with open(meta_file_name, "wb") as f:
# f.write(f"hello this is {app}")
f.write( f.write(
assemble_manifest_data( assemble_manifest_data(
app_manifest=app, app_manifest=app,
@ -236,7 +243,10 @@ def fap_dist_action(target, source, env):
def generate(env, **kw): def generate(env, **kw):
env.SetDefault(EXT_APPS_WORK_DIR=kw.get("EXT_APPS_WORK_DIR")) env.SetDefault(
EXT_APPS_WORK_DIR=kw.get("EXT_APPS_WORK_DIR"),
APP_RUN_SCRIPT="${FBT_SCRIPT_DIR}/runfap.py",
)
if not env["VERBOSE"]: if not env["VERBOSE"]:
env.SetDefault( env.SetDefault(

View File

@ -46,7 +46,9 @@ def prebuild_sdk_emitter(target, source, env):
def prebuild_sdk_create_origin_file(target, source, env): def prebuild_sdk_create_origin_file(target, source, env):
mega_file = env.subst("${TARGET}.c", target=target[0]) mega_file = env.subst("${TARGET}.c", target=target[0])
with open(mega_file, "wt") as sdk_c: with open(mega_file, "wt") as sdk_c:
sdk_c.write("\n".join(f"#include <{h.path}>" for h in env["SDK_HEADERS"])) sdk_c.write(
"\n".join(f"#include <{h.srcnode().path}>" for h in env["SDK_HEADERS"])
)
class SdkMeta: class SdkMeta:
@ -62,18 +64,25 @@ class SdkMeta:
"cc_args": self._wrap_scons_vars("$CCFLAGS $_CCCOMCOM"), "cc_args": self._wrap_scons_vars("$CCFLAGS $_CCCOMCOM"),
"cpp_args": self._wrap_scons_vars("$CXXFLAGS $CCFLAGS $_CCCOMCOM"), "cpp_args": self._wrap_scons_vars("$CXXFLAGS $CCFLAGS $_CCCOMCOM"),
"linker_args": self._wrap_scons_vars("$LINKFLAGS"), "linker_args": self._wrap_scons_vars("$LINKFLAGS"),
"linker_script": self.env.subst("${LINKER_SCRIPT_PATH}"), "linker_libs": self.env.subst("${LIBS}"),
"app_ep_subst": self.env.subst("${APP_ENTRY}"),
"sdk_path_subst": self.env.subst("${SDK_DIR_SUBST}"),
"hardware": self.env.subst("${TARGET_HW}"),
} }
with open(json_manifest_path, "wt") as f: with open(json_manifest_path, "wt") as f:
json.dump(meta_contents, f, indent=4) json.dump(meta_contents, f, indent=4)
def _wrap_scons_vars(self, vars: str): def _wrap_scons_vars(self, vars: str):
expanded_vars = self.env.subst(vars, target=Entry("dummy")) expanded_vars = self.env.subst(
vars,
target=Entry("dummy"),
)
return expanded_vars.replace("\\", "/") return expanded_vars.replace("\\", "/")
class SdkTreeBuilder: class SdkTreeBuilder:
SDK_DIR_SUBST = "SDK_ROOT_DIR" SDK_DIR_SUBST = "SDK_ROOT_DIR"
SDK_APP_EP_SUBST = "SDK_APP_EP_SUBST"
def __init__(self, env, target, source) -> None: def __init__(self, env, target, source) -> None:
self.env = env self.env = env
@ -87,6 +96,11 @@ class SdkTreeBuilder:
self.sdk_root_dir = target[0].Dir(".") self.sdk_root_dir = target[0].Dir(".")
self.sdk_deploy_dir = self.sdk_root_dir.Dir(self.target_sdk_dir_name) self.sdk_deploy_dir = self.sdk_root_dir.Dir(self.target_sdk_dir_name)
self.sdk_env = self.env.Clone(
APP_ENTRY=self.SDK_APP_EP_SUBST,
SDK_DIR_SUBST=self.SDK_DIR_SUBST,
)
def _parse_sdk_depends(self): def _parse_sdk_depends(self):
deps_file = self.source[0] deps_file = self.source[0]
with open(deps_file.path, "rt") as deps_f: with open(deps_file.path, "rt") as deps_f:
@ -95,38 +109,36 @@ class SdkTreeBuilder:
self.header_depends = list( self.header_depends = list(
filter(lambda fname: fname.endswith(".h"), depends.split()), filter(lambda fname: fname.endswith(".h"), depends.split()),
) )
self.header_depends.append(self.env.subst("${LINKER_SCRIPT_PATH}")) self.header_depends.append(self.sdk_env.subst("${LINKER_SCRIPT_PATH}"))
self.header_depends.append(self.env.subst("${SDK_DEFINITION}")) self.header_depends.append(self.sdk_env.subst("${SDK_DEFINITION}"))
self.header_dirs = sorted( self.header_dirs = sorted(
set(map(os.path.normpath, map(os.path.dirname, self.header_depends))) set(map(os.path.normpath, map(os.path.dirname, self.header_depends)))
) )
def _generate_sdk_meta(self): def _generate_sdk_meta(self):
filtered_paths = [self.target_sdk_dir_name] filtered_paths = ["."]
full_fw_paths = list( full_fw_paths = list(
map( map(
os.path.normpath, os.path.normpath,
(self.env.Dir(inc_dir).relpath for inc_dir in self.env["CPPPATH"]), (
self.sdk_env.Dir(inc_dir).relpath
for inc_dir in self.sdk_env["CPPPATH"]
),
) )
) )
sdk_dirs = ", ".join(f"'{dir}'" for dir in self.header_dirs) sdk_dirs = ", ".join(f"'{dir}'" for dir in self.header_dirs)
filtered_paths.extend( filtered_paths.extend(
map( filter(lambda path: path in sdk_dirs, full_fw_paths),
self.build_sdk_file_path,
filter(lambda path: path in sdk_dirs, full_fw_paths),
)
) )
filtered_paths = list(map(self.build_sdk_file_path, filtered_paths))
sdk_env = self.env.Clone() self.sdk_env.Replace(
sdk_env.Replace(
CPPPATH=filtered_paths, CPPPATH=filtered_paths,
LINKER_SCRIPT=self.env.subst("${APP_LINKER_SCRIPT}"),
ORIG_LINKER_SCRIPT_PATH=self.env["LINKER_SCRIPT_PATH"], ORIG_LINKER_SCRIPT_PATH=self.env["LINKER_SCRIPT_PATH"],
LINKER_SCRIPT_PATH=self.build_sdk_file_path("${ORIG_LINKER_SCRIPT_PATH}"), LINKER_SCRIPT_PATH=self.build_sdk_file_path("${ORIG_LINKER_SCRIPT_PATH}"),
) )
meta = SdkMeta(self.sdk_env, self)
meta = SdkMeta(sdk_env, self)
meta.save_to(self.target[0].path) meta.save_to(self.target[0].path)
def build_sdk_file_path(self, orig_path: str) -> str: def build_sdk_file_path(self, orig_path: str) -> str:
@ -211,7 +223,7 @@ def validate_sdk_cache(source, target, env):
current_sdk = SdkCollector() current_sdk = SdkCollector()
current_sdk.process_source_file_for_sdk(source[0].path) current_sdk.process_source_file_for_sdk(source[0].path)
for h in env["SDK_HEADERS"]: for h in env["SDK_HEADERS"]:
current_sdk.add_header_to_sdk(pathlib.Path(h.path).as_posix()) current_sdk.add_header_to_sdk(pathlib.Path(h.srcnode().path).as_posix())
sdk_cache = SdkCache(target[0].path) sdk_cache = SdkCache(target[0].path)
sdk_cache.validate_api(current_sdk.get_api()) sdk_cache.validate_api(current_sdk.get_api())

View File

@ -12,11 +12,14 @@ def version_emitter(target, source, env):
def generate(env): def generate(env):
env.SetDefault(
VERSION_SCRIPT="${FBT_SCRIPT_DIR}/version.py",
)
env.Append( env.Append(
BUILDERS={ BUILDERS={
"VersionBuilder": Builder( "VersionBuilder": Builder(
action=Action( action=Action(
'${PYTHON3} "${ROOT_DIR.abspath}/scripts/version.py" generate -t ${TARGET_HW} -o ${TARGET.dir.posix} --dir "${ROOT_DIR}"', '${PYTHON3} "${VERSION_SCRIPT}" generate -t ${TARGET_HW} -o ${TARGET.dir.posix} --dir "${ROOT_DIR}"',
"${VERSIONCOMSTR}", "${VERSIONCOMSTR}",
), ),
emitter=version_emitter, emitter=version_emitter,

View File

@ -8,7 +8,8 @@ __NM_ARM_BIN = "arm-none-eabi-nm"
def generate(env): def generate(env):
env.SetDefault( env.SetDefault(
BIN2DFU="${ROOT_DIR.abspath}/scripts/bin2dfu.py", BIN2DFU="${FBT_SCRIPT_DIR}/bin2dfu.py",
BIN_SIZE_SCRIPT="${FBT_SCRIPT_DIR}/fwsize.py",
OBJCOPY=__OBJCOPY_ARM_BIN, # FIXME OBJCOPY=__OBJCOPY_ARM_BIN, # FIXME
NM=__NM_ARM_BIN, # FIXME NM=__NM_ARM_BIN, # FIXME
) )

View File

@ -1,6 +1,7 @@
import logging import logging
import argparse import argparse
import sys import sys
import colorlog
class App: class App:
@ -10,7 +11,7 @@ class App:
self.parser = argparse.ArgumentParser() self.parser = argparse.ArgumentParser()
self.parser.add_argument("-d", "--debug", action="store_true", help="Debug") self.parser.add_argument("-d", "--debug", action="store_true", help="Debug")
# Logging # Logging
self.logger = logging.getLogger() self.logger = colorlog.getLogger()
# Application specific initialization # Application specific initialization
self.init() self.init()
@ -21,10 +22,17 @@ class App:
self.log_level = logging.DEBUG if self.args.debug else logging.INFO self.log_level = logging.DEBUG if self.args.debug else logging.INFO
self.logger.setLevel(self.log_level) self.logger.setLevel(self.log_level)
if not self.logger.hasHandlers(): if not self.logger.hasHandlers():
self.handler = logging.StreamHandler(sys.stdout) self.handler = colorlog.StreamHandler(sys.stdout)
self.handler.setLevel(self.log_level) self.handler.setLevel(self.log_level)
self.formatter = logging.Formatter( self.formatter = colorlog.ColoredFormatter(
"%(asctime)s [%(levelname)s] %(message)s" "%(log_color)s%(asctime)s [%(levelname)s] %(message)s",
log_colors={
"DEBUG": "cyan",
# "INFO": "white",
"WARNING": "yellow",
"ERROR": "red",
"CRITICAL": "red,bg_white",
},
) )
self.handler.setFormatter(self.formatter) self.handler.setFormatter(self.formatter)
self.logger.addHandler(self.handler) self.logger.addHandler(self.handler)

View File

@ -131,7 +131,9 @@ class Main(App):
self.copy_single_project(project) self.copy_single_project(project)
self.logger.info( self.logger.info(
fg.green(f"Firmware binaries can be found at:\n\t{self.output_dir_path}") fg.boldgreen(
f"Firmware binaries can be found at:\n\t{self.output_dir_path}"
)
) )
if self.args.version: if self.args.version:
@ -167,7 +169,7 @@ class Main(App):
if (bundle_result := UpdateMain(no_exit=True)(bundle_args)) == 0: if (bundle_result := UpdateMain(no_exit=True)(bundle_args)) == 0:
self.logger.info( self.logger.info(
fg.green( fg.boldgreen(
f"Use this directory to self-update your Flipper:\n\t{bundle_dir}" f"Use this directory to self-update your Flipper:\n\t{bundle_dir}"
) )
) )

0
scripts/testing/await_flipper.py Normal file → Executable file
View File

0
scripts/testing/units.py Normal file → Executable file
View File

View File

@ -13,19 +13,22 @@ if not [%FBT_NOENV%] == [] (
exit /b 0 exit /b 0
) )
set "FLIPPER_TOOLCHAIN_VERSION=16" set "FLIPPER_TOOLCHAIN_VERSION=17"
set "FBT_TOOLCHAIN_ROOT=%FBT_ROOT%\toolchain\x86_64-windows"
if [%FBT_TOOLCHAIN_ROOT%] == [] (
set "FBT_TOOLCHAIN_ROOT=%FBT_ROOT%\toolchain\x86_64-windows"
)
if not exist "%FBT_TOOLCHAIN_ROOT%" ( if not exist "%FBT_TOOLCHAIN_ROOT%" (
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%" powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%" "%FBT_TOOLCHAIN_ROOT%"
) )
if not exist "%FBT_TOOLCHAIN_ROOT%\VERSION" ( if not exist "%FBT_TOOLCHAIN_ROOT%\VERSION" (
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%" powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%" "%FBT_TOOLCHAIN_ROOT%"
) )
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_ROOT%\VERSION" set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_ROOT%\VERSION"
if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" ( if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" (
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%" powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" "%flipper_toolchain_version%" "%FBT_TOOLCHAIN_ROOT%"
) )

View File

@ -5,7 +5,7 @@
# public variables # public variables
DEFAULT_SCRIPT_PATH="$(pwd -P)"; DEFAULT_SCRIPT_PATH="$(pwd -P)";
SCRIPT_PATH="${SCRIPT_PATH:-$DEFAULT_SCRIPT_PATH}"; SCRIPT_PATH="${SCRIPT_PATH:-$DEFAULT_SCRIPT_PATH}";
FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"16"}"; FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"17"}";
FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}"; FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}";
fbtenv_show_usage() fbtenv_show_usage()
@ -62,7 +62,7 @@ fbtenv_check_sourced()
fbtenv_show_usage; fbtenv_show_usage;
return 1; return 1;
fi fi
case ${0##*/} in dash|-dash|bash|-bash|ksh|-ksh|sh|-sh|*.sh|fbt) case ${0##*/} in dash|-dash|bash|-bash|ksh|-ksh|sh|-sh|*.sh|fbt|ufbt)
return 0;; return 0;;
esac esac
fbtenv_show_usage; fbtenv_show_usage;
@ -76,8 +76,8 @@ fbtenv_chck_many_source()
return 0; return 0;
fi fi
fi fi
echo "Warning! FBT environment script sourced more than once!"; echo "Warning! FBT environment script was sourced more than once!";
echo "This may signal that you are making mistakes, please open a new shell!"; echo "You might be doing things wrong, please open a new shell!";
return 1; return 1;
} }
@ -93,8 +93,8 @@ fbtenv_set_shell_prompt()
fbtenv_check_script_path() fbtenv_check_script_path()
{ {
if [ ! -x "$SCRIPT_PATH/fbt" ]; then if [ ! -x "$SCRIPT_PATH/fbt" ] && [ ! -x "$SCRIPT_PATH/ufbt" ] ; then
echo "Please source this script being into flipperzero-firmware root directory, or specify 'SCRIPT_PATH' manually"; echo "Please source this script from [u]fbt root directory, or specify 'SCRIPT_PATH' variable manually";
echo "Example:"; echo "Example:";
printf "\tSCRIPT_PATH=lang/c/flipperzero-firmware source lang/c/flipperzero-firmware/scripts/fbtenv.sh\n"; printf "\tSCRIPT_PATH=lang/c/flipperzero-firmware source lang/c/flipperzero-firmware/scripts/fbtenv.sh\n";
echo "If current directory is right, type 'unset SCRIPT_PATH' and try again" echo "If current directory is right, type 'unset SCRIPT_PATH' and try again"
@ -108,7 +108,7 @@ fbtenv_get_kernel_type()
SYS_TYPE="$(uname -s)"; SYS_TYPE="$(uname -s)";
ARCH_TYPE="$(uname -m)"; ARCH_TYPE="$(uname -m)";
if [ "$ARCH_TYPE" != "x86_64" ] && [ "$SYS_TYPE" != "Darwin" ]; then if [ "$ARCH_TYPE" != "x86_64" ] && [ "$SYS_TYPE" != "Darwin" ]; then
echo "Now we provide toolchain only for x86_64 arhitecture, sorry.."; echo "We only provide toolchain for x86_64 CPUs, sorry..";
return 1; return 1;
fi fi
if [ "$SYS_TYPE" = "Darwin" ]; then if [ "$SYS_TYPE" = "Darwin" ]; then
@ -119,10 +119,10 @@ fbtenv_get_kernel_type()
TOOLCHAIN_ARCH_DIR="$FBT_TOOLCHAIN_PATH/toolchain/x86_64-linux"; TOOLCHAIN_ARCH_DIR="$FBT_TOOLCHAIN_PATH/toolchain/x86_64-linux";
TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-linux-flipper-$FBT_TOOLCHAIN_VERSION.tar.gz"; TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-linux-flipper-$FBT_TOOLCHAIN_VERSION.tar.gz";
elif echo "$SYS_TYPE" | grep -q "MINGW"; then elif echo "$SYS_TYPE" | grep -q "MINGW"; then
echo "In MinGW shell use \"fbt.cmd\" instead of \"fbt\""; echo "In MinGW shell use \"[u]fbt.cmd\" instead of \"[u]fbt\"";
return 1; return 1;
else else
echo "Your system is not recognized. Sorry.. Please report us your configuration."; echo "Your system configuration is not supported. Sorry.. Please report us your configuration.";
return 1; return 1;
fi fi
return 0; return 0;
@ -142,7 +142,7 @@ fbtenv_check_rosetta()
fbtenv_check_tar() fbtenv_check_tar()
{ {
printf "Checking tar.."; printf "Checking for tar..";
if ! tar --version > /dev/null 2>&1; then if ! tar --version > /dev/null 2>&1; then
echo "no"; echo "no";
return 1; return 1;
@ -153,7 +153,7 @@ fbtenv_check_tar()
fbtenv_check_downloaded_toolchain() fbtenv_check_downloaded_toolchain()
{ {
printf "Checking downloaded toolchain tgz.."; printf "Checking if downloaded toolchain tgz exists..";
if [ ! -f "$FBT_TOOLCHAIN_PATH/toolchain/$TOOLCHAIN_TAR" ]; then if [ ! -f "$FBT_TOOLCHAIN_PATH/toolchain/$TOOLCHAIN_TAR" ]; then
echo "no"; echo "no";
return 1; return 1;
@ -204,7 +204,7 @@ fbtenv_unpack_toolchain()
fbtenv_clearing() fbtenv_clearing()
{ {
printf "Clearing.."; printf "Cleaning up..";
if [ -n "${FBT_TOOLCHAIN_PATH:-""}" ]; then if [ -n "${FBT_TOOLCHAIN_PATH:-""}" ]; then
rm -rf "${FBT_TOOLCHAIN_PATH:?}/toolchain/"*.tar.gz; rm -rf "${FBT_TOOLCHAIN_PATH:?}/toolchain/"*.tar.gz;
rm -rf "${FBT_TOOLCHAIN_PATH:?}/toolchain/"*.part; rm -rf "${FBT_TOOLCHAIN_PATH:?}/toolchain/"*.part;

View File

@ -1,34 +1,46 @@
Set-StrictMode -Version 2.0 Set-StrictMode -Version 2.0
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
$repo_root = (Get-Item "$PSScriptRoot\..\..").FullName # TODO: fix
$download_dir = (Get-Item "$PSScriptRoot\..\..").FullName
$toolchain_version = $args[0] $toolchain_version = $args[0]
$toolchain_url = "https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-windows-flipper-$toolchain_version.zip" $toolchain_target_path = $args[1]
$toolchain_zip = "gcc-arm-none-eabi-10.3-x86_64-windows-flipper-$toolchain_version.zip"
$toolchain_dir = "gcc-arm-none-eabi-10.3-x86_64-windows-flipper"
if (Test-Path -LiteralPath "$repo_root\toolchain\x86_64-windows") { $toolchain_url = "https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-x86_64-windows-flipper-$toolchain_version.zip"
$toolchain_dist_folder = "gcc-arm-none-eabi-10.3-x86_64-windows-flipper"
$toolchain_zip = "$toolchain_dist_folder-$toolchain_version.zip"
$toolchain_zip_temp_path = "$download_dir\$toolchain_zip"
$toolchain_dist_temp_path = "$download_dir\$toolchain_dist_folder"
if (Test-Path -LiteralPath "$toolchain_target_path") {
Write-Host -NoNewline "Removing old Windows toolchain.." Write-Host -NoNewline "Removing old Windows toolchain.."
Remove-Item -LiteralPath "$repo_root\toolchain\x86_64-windows" -Force -Recurse Remove-Item -LiteralPath "$toolchain_target_path" -Force -Recurse
Write-Host "done!" Write-Host "done!"
} }
if (!(Test-Path -Path "$repo_root\$toolchain_zip" -PathType Leaf)) { if (!(Test-Path -Path "$toolchain_zip_temp_path" -PathType Leaf)) {
Write-Host -NoNewline "Downloading Windows toolchain.." Write-Host -NoNewline "Downloading Windows toolchain.."
$wc = New-Object net.webclient $wc = New-Object net.webclient
$wc.Downloadfile("$toolchain_url", "$repo_root\$toolchain_zip") $wc.Downloadfile("$toolchain_url", "$toolchain_zip_temp_path")
Write-Host "done!" Write-Host "done!"
} }
if (!(Test-Path -LiteralPath "$repo_root\toolchain")) { if (!(Test-Path -LiteralPath "$toolchain_target_path\..")) {
New-Item "$repo_root\toolchain" -ItemType Directory New-Item "$toolchain_target_path\.." -ItemType Directory -Force
} }
Write-Host -NoNewline "Extracting Windows toolchain.." Write-Host -NoNewline "Extracting Windows toolchain.."
# This is faster than Expand-Archive
Add-Type -Assembly "System.IO.Compression.Filesystem" Add-Type -Assembly "System.IO.Compression.Filesystem"
[System.IO.Compression.ZipFile]::ExtractToDirectory("$repo_root\$toolchain_zip", "$repo_root\") [System.IO.Compression.ZipFile]::ExtractToDirectory("$toolchain_zip_temp_path", "$download_dir")
Move-Item -Path "$repo_root\$toolchain_dir" -Destination "$repo_root\toolchain\x86_64-windows" # Expand-Archive -LiteralPath "$toolchain_zip_temp_path" -DestinationPath "$download_dir"
Write-Host -NoNewline "moving.."
Move-Item -LiteralPath "$toolchain_dist_temp_path" -Destination "$toolchain_target_path"
Write-Host "done!" Write-Host "done!"
Write-Host -NoNewline "Cleaning up temporary files.." Write-Host -NoNewline "Cleaning up temporary files.."
Remove-Item -LiteralPath "$repo_root\$toolchain_zip" -Force Remove-Item -LiteralPath "$toolchain_zip_temp_path" -Force
Write-Host "done!" Write-Host "done!"
# dasdasd

View File

@ -30,10 +30,9 @@ ENV.AppendUnique(
"-ffunction-sections", "-ffunction-sections",
"-fsingle-precision-constant", "-fsingle-precision-constant",
"-fno-math-errno", "-fno-math-errno",
"-fstack-usage", # Generates .su files with stack usage information
# "-fstack-usage",
"-g", "-g",
# "-Wno-stringop-overread",
# "-Wno-stringop-overflow",
], ],
CPPDEFINES=[ CPPDEFINES=[
"_GNU_SOURCE", "_GNU_SOURCE",

View File

@ -1,5 +1,10 @@
from SCons.Platform import TempFileMunge from SCons.Platform import TempFileMunge
from fbt.util import tempfile_arg_esc_func, single_quote, wrap_tempfile from fbt.util import (
tempfile_arg_esc_func,
single_quote,
wrap_tempfile,
extract_abs_dir_path,
)
import os import os
import multiprocessing import multiprocessing
@ -52,6 +57,12 @@ coreenv = VAR_ENV.Clone(
MAXLINELENGTH=2048, MAXLINELENGTH=2048,
PROGSUFFIX=".elf", PROGSUFFIX=".elf",
ENV=forward_os_env, ENV=forward_os_env,
SINGLEQUOTEFUNC=single_quote,
ABSPATHGETTERFUNC=extract_abs_dir_path,
# Setting up temp file parameters - to overcome command line length limits
TEMPFILEARGESCFUNC=tempfile_arg_esc_func,
FBT_SCRIPT_DIR=Dir("#/scripts"),
ROOT_DIR=Dir("#"),
) )
# If DIST_SUFFIX is set in environment, is has precedence (set by CI) # If DIST_SUFFIX is set in environment, is has precedence (set by CI)
@ -60,24 +71,6 @@ if os_suffix := os.environ.get("DIST_SUFFIX", None):
DIST_SUFFIX=os_suffix, DIST_SUFFIX=os_suffix,
) )
# print(coreenv.Dump())
if not coreenv["VERBOSE"]:
coreenv.SetDefault(
CCCOMSTR="\tCC\t${SOURCE}",
CXXCOMSTR="\tCPP\t${SOURCE}",
ASCOMSTR="\tASM\t${SOURCE}",
ARCOMSTR="\tAR\t${TARGET}",
RANLIBCOMSTR="\tRANLIB\t${TARGET}",
LINKCOMSTR="\tLINK\t${TARGET}",
INSTALLSTR="\tINSTALL\t${TARGET}",
APPSCOMSTR="\tAPPS\t${TARGET}",
VERSIONCOMSTR="\tVERSION\t${TARGET}",
STRIPCOMSTR="\tSTRIP\t${TARGET}",
OBJDUMPCOMSTR="\tOBJDUMP\t${TARGET}",
# GDBCOMSTR="\tGDB\t${SOURCE}",
# GDBPYCOMSTR="\tGDB-PY\t${SOURCE}",
)
# Default value for commandline options # Default value for commandline options
SetOption("num_jobs", multiprocessing.cpu_count()) SetOption("num_jobs", multiprocessing.cpu_count())
@ -90,12 +83,7 @@ SetOption("max_drift", 1)
# Random task queue - to discover isses with build logic faster # Random task queue - to discover isses with build logic faster
# SetOption("random", 1) # SetOption("random", 1)
# Setting up temp file parameters - to overcome command line length limits
coreenv["TEMPFILEARGESCFUNC"] = tempfile_arg_esc_func
wrap_tempfile(coreenv, "LINKCOM") wrap_tempfile(coreenv, "LINKCOM")
wrap_tempfile(coreenv, "ARCOM") wrap_tempfile(coreenv, "ARCOM")
coreenv["SINGLEQUOTEFUNC"] = single_quote
Return("coreenv") Return("coreenv")

View File

@ -3,10 +3,9 @@ from SCons.Errors import UserError
Import("ENV") Import("ENV")
from fbt.appmanifest import FlipperAppType from fbt.appmanifest import FlipperAppType
appenv = ENV.Clone( appenv = ENV["APPENV"] = ENV.Clone(
tools=[ tools=[
( (
"fbt_extapps", "fbt_extapps",
@ -17,6 +16,7 @@ appenv = ENV.Clone(
}, },
), ),
"fbt_assets", "fbt_assets",
"fbt_sdk",
] ]
) )
@ -66,6 +66,7 @@ extapps = appenv["_extapps"] = {
"validators": {}, "validators": {},
"dist": {}, "dist": {},
"resources_dist": None, "resources_dist": None,
"sdk_tree": None,
} }
@ -115,10 +116,41 @@ if appsrc := appenv.subst("$APPSRC"):
app_manifest, fap_file, app_validator = appenv.GetExtAppFromPath(appsrc) app_manifest, fap_file, app_validator = appenv.GetExtAppFromPath(appsrc)
appenv.PhonyTarget( appenv.PhonyTarget(
"launch_app", "launch_app",
'${PYTHON3} scripts/runfap.py ${SOURCE} --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"', '${PYTHON3} "${APP_RUN_SCRIPT}" ${SOURCE} --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"',
source=fap_file, source=fap_file,
FAP_CATEGORY=app_manifest.fap_category, FAP_CATEGORY=app_manifest.fap_category,
) )
appenv.Alias("launch_app", app_validator) appenv.Alias("launch_app", app_validator)
# SDK management
sdk_origin_path = "${BUILD_DIR}/sdk_origin"
sdk_source = appenv.SDKPrebuilder(
sdk_origin_path,
# Deps on root SDK headers and generated files
(appenv["SDK_HEADERS"], appenv["FW_ASSETS_HEADERS"]),
)
# Extra deps on headers included in deeper levels
Depends(sdk_source, appenv.ProcessSdkDepends(f"{sdk_origin_path}.d"))
appenv["SDK_DIR"] = appenv.Dir("${BUILD_DIR}/sdk")
sdk_tree = extapps["sdk_tree"] = appenv.SDKTree(appenv["SDK_DIR"], sdk_origin_path)
# AlwaysBuild(sdk_tree)
Alias("sdk_tree", sdk_tree)
sdk_apicheck = appenv.SDKSymUpdater(appenv["SDK_DEFINITION"], sdk_origin_path)
Precious(sdk_apicheck)
NoClean(sdk_apicheck)
AlwaysBuild(sdk_apicheck)
Alias("sdk_check", sdk_apicheck)
sdk_apisyms = appenv.SDKSymGenerator(
"${BUILD_DIR}/assets/compiled/symbols.h", appenv["SDK_DEFINITION"]
)
Alias("api_syms", sdk_apisyms)
if appenv["FORCE"]:
appenv.AlwaysBuild(sdk_source, sdk_tree, sdk_apicheck, sdk_apisyms)
Return("extapps") Return("extapps")