Skip to content

Commit

Permalink
Merge dev (#2827)
Browse files Browse the repository at this point in the history
* fix typo in FuriHalDebuging.md (#2667)

* [FL-3317] fbt: allow strings for fap_version field in app manifests (#2672)

* [FL-3312] fix PIN retry count reset on reboot (#2671)

* api: added lib/nfc/protocols/nfc_util.h (#2674)

* Add new indexer (#2681)

* fbt: Use union for old py (#2685)

* fbt: Fix tar uid overflow when packaging (#2689)

* fbt: Fix tar uid overflow when packaging
* Fix trailing spaces

* [FL-3328] Removed user-specific data from tar artifacts (#2691)

* [FL-3327] Storage: common_rename is now POSIX compliant (#2693)

* Storage: common_rename is now POSIX compliant

* storage: check for success on storage_common_remove in file rename

---------

Co-authored-by: hedger <hedger@nanode.su>

* Services: remove deallocator for persistent services (#2692)

Co-authored-by: hedger <hedger@users.noreply.github.com>

* Storage, common_rename: check that old path is exists (#2698)

* Storage, common_rename: check that old path is exists
* Storage, common_rename: return correct status

* [FL-3315] Desktop,Rpc: desktop status subscription (#2696)

* Desktop,Rpc: desktop status subscription
* Desktop,RPC: properly handle unsubscribe

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>

* ✨ Add fr-FR-mac key layout (#2666)

Co-authored-by: あく <alleteam@gmail.com>

* [FL-3322] Infrared: respect carrier frequency and duty cycle settings (#2677)

* Make infrared_worker respect carrier frequency and duty cycle
* Update comments

Co-authored-by: あく <alleteam@gmail.com>

* USB HID report timeout (#2682)

Co-authored-by: あく <alleteam@gmail.com>

* Add Airwell Prime DCI Series and match file style (#2686)

Co-authored-by: あく <alleteam@gmail.com>

* desktop: Refactor favorites settings and allow app browser in selection (#2687)

* desktop: Refactor favorites settings and allow app browser in selection
* desktop: Gate app browser entry add, just in case
* Desktop: simplify favorite application selection
* Desktop: refactor favorite application opening routine and cleanup code
* Desktop: handle exit from external application selection

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>

* NFC: Add support for Gen4 "ultimate card" in Magic app (#2238)

* NFC: gen4 gtu detect in magic app
* NFC: more support for GTU card
* NFC: Fix Gen1 in Magic
* Allow double UIDs for MFClassic on GTU cards
* NFC: Small magic app tweaks
* nfc magic: notify card event on wiping
* nfc magic: fix power consumption
* nfc magic: disable i2c writing and fix wipe loop
* NfcMagic: correct formatting in printf
* NfcMagic: correct formatting in printf, proper version
* nfc_magic: rework card found notification and gen4 wiping

Co-authored-by: あく <alleteam@gmail.com>

* nfc: Fix MFUL tearing flags read (#2669)

Co-authored-by: gornekich <n.gorbadey@gmail.com>

* api: added toolbox/api_lock.h (#2702)

Co-authored-by: あく <alleteam@gmail.com>

* Update ac.ir (#2701)

Co-authored-by: あく <alleteam@gmail.com>

* nfc: Mifare Ultralight C detection (#2668)

* nfc: Add Mifare Ultralight C detection
* nfc: Add display name for MFUL C and hide menu items
    MFUL C unlock and emulation currently not supported, so hide from menu
    if current card is MFUL C
* nfc: Also check response when probing 3DES auth
* nfc: Hide emulate option in saved menu for MFUL if not supported
* nfc: Remove unlock options from saved menu if Ultralight C


Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>

* [LRFID] Add support for Nexkey/Nexwatch (#2680)

* [LRFID] Add support for Nexkey/Nexwatch
* Update protocol_nexwatch.c: Remove unnecessary check

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>

* Add Carrier 42QHB12D8S (#2707)

Co-authored-by: あく <alleteam@gmail.com>

* BadUSB: script execution pause (#2700)

Co-authored-by: あく <alleteam@gmail.com>

* Implement support for reading Opal card (Sydney, Australia) (#2683)

* Implement support for reading Opal card (Sydney, Australia)
* stub_parser_verify_read: used UNUSED macro
* furi_hal_rtc: expose calendaring as functions
* opal: use bit-packed struct to parse, rather than manually shifting about
* Update f18 api symbols

Co-authored-by: あく <alleteam@gmail.com>

* [FL-3295] FuriHal: add bus abstraction (#2614)

* FuriHal: add bus abstraction and port some subsystem to it
* Make PVS happy, cleanup code
* Update API symbols for f18
* F18: backport bus changes from f7
* Revert to STOP2 sleep mode
* Fix downgrading the firmware via updater
* Port iButton TIM1 to furi_hal_bus
* Port Infrared TIM1 and TIM2 to furi_hal_bus
* Just enable the timer bus
* Port furi_hal_pwm to bus API
* Fix include statement
* Port furi_hal_rfid to bus API
* Port furi_hal_subghz and others to bus API
* Remove unneeded include
* Improve furi_hal_infrared defines
* Reset LPTIM1 via furi_hal_bus API
* Crash when trying to enable an already enabled peripheral
* Better defines
* Improved checks
* Lots of macro wrappers
* Copy spi changes for f18
* Fix crashes in LFRFID system
* Fix crashes in NFC system
* Improve comments
* Create FuriHalBus.md
* Update FuriHalBus.md
* Fix crash when launching updater
* Documentation: couple small fixes in FuriHalBus
* FuriHal: fix copypaste in furi_hal_rfid_tim_reset
* FuriHal: reset radio core related peripherals on restart
* FuriHalBus: is enabled routine and bug fix for uart
* RFID HAL: accomodate furi hal bus

Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>

* [FL-3330] fbt: added hooks for build & dist environments; added FW_ORIGIN_* macro for apps & SDK (#2705)

* fbt: added hooks for build & dist environments
* Moved env hooks to an optional file
* Fixed var name
* Added fw origin to device info
* Bumped device info version
* fbt: added FIRMWARE_ORIGIN option. Different implementation for FW_ORIGIN_* C macro.
* api: bumped versions
* fbt: added fbt_options_local.py
* gitignore: cleanup

Co-authored-by: あく <alleteam@gmail.com>

* [FL-3335] Dolphin: new animation (#2713)

* [FL-3340] SubGhz: fix flipper crashes after exiting broadcast blocking message and crash cli (#2714)

* NFC: Fix gen1 writing with invalid BCC (lost fix from PR #2511) (#2710)

Co-authored-by: あく <alleteam@gmail.com>

* Update dolphin.py (#2717)

Co-authored-by: あく <alleteam@gmail.com>

* NFC: fix MFC timings (#2719)

* digital signal: add optimization
* nfc test: more restrict tests
* digital signal: build as separate library
* digital signal: remove unused flags, format sources
* digital signal: fix cflag name
* target: fix build for f18 target

Co-authored-by: あく <alleteam@gmail.com>

* FuriHal: disable bus re-initialization on early init and extra asserts for AHB1,AHB2,AHB3 which must be left intact on entering to FUS (#2725)

* [DEVOPS-18]: Add map file parser, mariadb inserter (#2732)

* [FL-3293] FuriHal: add system setting to device info, bump device info version (#2736)

* [FL-3316] Settings: add contrast adjustment (#2737)

Co-authored-by: hedger <hedger@users.noreply.github.com>

* [FL-3213] f7: add PB9 to debug pins (#2738)

Co-authored-by: hedger <hedger@users.noreply.github.com>

* [FL-3352] Dolphin: new animation (#2735)

Co-authored-by: hedger <hedger@users.noreply.github.com>

* [FL-2872] Remove unused resources  (#2740)

Co-authored-by: hedger <hedger@users.noreply.github.com>

* Serial_CLI: Fixing serial cli logger error so it sounds more concise (#2721)

Co-authored-by: hedger <hedger@users.noreply.github.com>

* Furi: smaller critical enter and critical exit macro (#2716)

* Furi: smaller critical enter and critical exit macro
* api: bumped version

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>

* [FL-3331] SubGhz: add subghz_protocol_registry external API (#2712)

* [FL-3331] SubGhz: add subghz_protocol_registry external API

* F18: fix API version

---------

Co-authored-by: hedger <hedger@nanode.su>

* [FL-3045] Fix core2 permisions (#2742)

* Fix core2 permisions

* Fix Python code style

* scripts: copro: changed int literals

* scripts: copro: shorter string line in code

---------

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>

* [FL-3246] fbt, ufbt: added checks for appid in app manifests(#2720)

Co-authored-by: あく <alleteam@gmail.com>

* Map parser licence description (#2739)

* Add map parser licence description
* Add map parser copyright text & licence note

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>

* [FL-3346] fbt: added Flipper selection when multiple are connected over USB (#2723)

* fbt: added Flipper selection when multiple are connected over USB
* scripts: serial_cli: added --port (-p) option

* added ISO15693 (NfcV) reading, saving, emulating and revealing from privacy mode (unlock) (#2316)

* added support for ISO15693 (NfcV) emulation, added support for reading SLIX tags
* SLIX: fixed crash situation when an invalid password was requested
* ISO15693: show emulate menu when opening file
* rename NfcV emulate scene to match other NfcV names
* optimize allocation size for signals
* ISO15693: further optimizations of allocation and free code
* ISO15693: reduce latency on state machine reset
* respond with block security status when option flag is set
* increased maximum memory size to match standard
  added security status handling/load/save
  added SELECT/QUIET handling
  more fine grained allocation routines and checks
  fix memset sizes
* added "Listen NfcV Reader" to sniff traffic from reader to card
* added correct description to delete menu
* also added DSFID/AFI handling and locking
* increase sniff log size
* scale NfcV frequency a bit, add echo mode, fix signal level at the end
* use symbolic modulated/unmodulated GPIO levels
* honor AFI field, decrease verbosity and removed debug code
* refactor defines for less namespace pollution by using NFCV_ prefixes
* correct an oversight that original cards return an generic error when addressing outside block range
* use inverse modulation, increasing readable range significantly
* rework and better document nfc chip initialization
* nfcv code review fixes
* Disable accidentally left on signal debug gpio output
* Improve NFCV Read/Info GUIs. Authored by @xMasterX, committed by @nvx
* Fix crash that occurs when you exit from NFCV emulation and start it again. Authored by @xMasterX, committed by @nvx
* Remove delay from emulation loop. This improves compatibility when the reader is Android.
* Lib: digital signal debug output pin info

Co-authored-by: Tiernan Messmer <tiernan.messmer@gmail.com>
Co-authored-by: MX <10697207+xMasterX@users.noreply.github.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>

* [FL-3351] github: re-enabled f18 build (#2743)

* github: re-enabled f18 build
* scripts: storage: better transfer logging
* Fix PVS warnings

Co-authored-by: あく <alleteam@gmail.com>

* Scripts: WiFi board updater (#2625)

* Scripts: wifi updater
* WiFi board updater: lint, process download error
* WiFi board updater: auto cleanup temp dir
* Scripts: fix server address

* [FL-3267] ble: refactored bt gatt characteristics setup (#2587)

* ble: refactored bt gatt characteristics setup
* ble: naming fixes, small optimizations
* ble: expanded bitfields; fixed pvs warnings
* ble: fixed pvs warnings for real
* ble: using FlipperGattCharacteristicDataPropsFixed for char[] props
* ble: removed flipper_gatt_characteristic_props_const_char
* ble: gatt: naming changes
* ble: gatt: fixed device_info service constant attrs sizes
* ble: gatt: copy descriptors to char instances; reworked hid chars to be callback-based; moved max size getter to callback with NULL data; added comments
* ble: gatt: removed hid_svc_report_data_callback
* ble: hid svc: better double loop idx naming
* ble: hid svc: simplified hid_svc_update_info
* ble: gatt: removed magic values; fixed type for HidSvcGattCharacteristicInfo
* ble: gatt: moved long uuids to separate files

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>

* [FL-3359] github: added debugapps artifact; packaging resources per-target (#2750)

* github: added debugapps artifact; packaging resources per-target
* github: target name fixes
* github: fixed path for debug apps
* scripts: dist: removed lib stub artifact
* scripts: fixed broken SDK
* github: removed unused step

* FuriHal: always clock SMPS from HSI (#2643)

* FuriHal: always clock SMPS from HSI

* FuriHal: add clock startup time check, ensure that we conform to core2 config value

* FuriHal: set sleep mode to legacy if clock startup time is too high

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>

* Core2, SRAM2: provide safety gap (#2754)

* Core2, SRAM2: use ob, provide safety gap
* thread: comment about critical section and scheduler state

* Services: simplify api (#2540)

Co-authored-by: あく <alleteam@gmail.com>

* weather_station: add oregon3 with THGR221 (#2748)

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>

* [FL-3361] fbt: stable build dates (#2751)

* scripts: using commit date for clean build timestamp; current day otherwise
* scripts: version: Removing GIT_COMMIT_DATE from final data

Co-authored-by: あく <alleteam@gmail.com>

* [FL-3284] Fix reading Mifare Classic cards with unusual access conditions and fix emulation of unknown keys (#2620)

* I was outplayed by the C programming language
* Fix emulating empty keys as 0s
* Add exceptions for Detect Reader
* Sync api_symbols.csv for F18
* Outplayed by the C language [X2]

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>

* FuriHal: remove clock startup time tracking from clean builds (#2764)

* furi_hal_nfc: fix rfalTransceiveBitsBlockingTx's 4th argument to bits count rather than bytes count (#2773)

* [FL-3376] Fixed GATT attribute order  (#2776)

* hal: gatt: swapped rx/tx serial chars order
* hal: gatt: reordered HID attrs to maintain previous order

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>

* Debug: sync apps on attach, makes it possible to debug already started app that has crashed (#2778)

* [FL-2837][FL-3270] Loader refaptoring: second encounter (#2779)

* Core: rename internal FlipperApplication to FlipperInternalApplication
* FAP Loader: move load_name_and_icon to flipper_application library
* Loader menu: rework api
* View holder: move to gui service
* Loader: simple "loading" worker
* Loader: applications dialog
* Loader: fapping
* Update f18 api
* Apps: remove fap_loader
* Libs, flipper application: store args, rename thread allocation
* Loader: error handling
* Apps: use loader error handling
* Loader: documentation
* FBT: accomodate loader
* Loader: do not raise gui error if loader is locked
* Archive: accomodate loader
* Loader: fix loading message
* Flipper: drop some old dolphin legacy
* Loader: generalize error construction

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>

* [FL-3373] Scroll acceleration (#2784)

* Support for scroll acceleration
* Revert keyboard acceleration
* Add scroll acceleration to the text box
* Remove redundant code from the file manager input handler
* Archive: slightly better scrolling
* Gui,Archive: final version of accelerated scrolling

Co-authored-by: あく <alleteam@gmail.com>

* fix: make `dialog_file_browser_set_basic_options` initialize all fields (#2756)

* fix: make `dialog_file_browser_set_basic_options` initialize all fields
* fix(GH-2756): use alternative test for `test_dialog_file_browser_set_basic_options_should_init_all_fields`

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>

* Fix M*LIB usage (#2762)

* Fix M*LIB usage
* Fix oplist definition of SubGhzFrequencyAnalyzerLogItem
* Fix oplist definition of M_CSTR_DUP_OPLIST
* Remove dependency of furi_string_utf8_decode to the internal definition of string_unicode_t
* Replace obsolete macro M_IF_DEFAULT1 to M_DEFAULT_ARGS

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>

* Actions: unit_test and updater timeouts (#2807)

* added some extra timeouts, fixed duration of units run command and minor logging changes. No list_ports yet needed
* increased timeouts
* make pvs happy

---------

Co-authored-by: doomwastaken <k.volkov@flipperdevices.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>

* LF-RFID debug: make it work (#2793)

Co-authored-by: あく <alleteam@gmail.com>

* [FL-3386] Fast FAP Loader (#2790)

* FBT: build and add FastFAP(tm) sections
* Elf file: fast loading fap files. Really fast, like x15 times faster.
* fastfap.py: cleanup unused imports
* Toolchain: 23 version
* Elf File: remove log messages
* Scripts: fix file permissions
* FBT: explicit interpreter for fastfap invocation

Co-authored-by: あく <alleteam@gmail.com>

* [FL-3388] NFC/RFID detector  (#2795)

* Field_Validation: add driver fild_validation_rfid
* Field_Validation: add fild_validation_nfc
* Field_Presence: added field validation functions to furi_hal_nfc
* Field_Presence: added field validation functions to furi_hal_rfid
* Field_Presence: add "NFC/RFID detector" app
* Field_Presence: fix GUI "NFC/RFID detector"
* NFC/RFID detector: add auto turn on backlight when field is detected
* NFC/RFID detector: fix syntax errors
* ApiSymbols: fix incorrect name
* FuriHal: filed detect naming
* FieldDetector: fix grammar

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>

* Fix furi_hal_bus related crashes in plugins (#2799)

* Fix furi_hal_bus issues in plugins
* Rework pwm is running check
* ApiSymbols: update and sync targets

Co-authored-by: あく <alleteam@gmail.com>

* Fix fr-FR-mac keylayout (#2809)

Co-authored-by: あく <alleteam@gmail.com>

* Fix roll-over in file browser and archive (#2811)

* Add Mitsubishi MSZ-AP25VGK universal ac remote (#2800)

Co-authored-by: あく <alleteam@gmail.com>

* Added Power Button for an unknown Sharp Model (#2787)

Tested by me, i just asked if I can get the remote. Tested with the universal remote before and thought you would like to add the button data

Co-authored-by: あく <alleteam@gmail.com>

* NFC: Improvements to NFC Magic app (#2760)

Ability to write gen1b tags (ignore 0x43)
Ability to write gen1 7 byte UID tags
Fix detection of non magic cards

Co-authored-by: あく <alleteam@gmail.com>

* Keynote with vertical layout (#2794)

cherry pick from:
  * https://github.com/DarkFlippers/unleashed-firmware/pull/428/files
  * https://github.com/DarkFlippers/unleashed-firmware/pull/524/files
  Co-authored-by:
    * MX <10697207+xMasterX@users.noreply.github.com>
    * gid9798 <30450294+gid9798@users.noreply.github.com>

Co-authored-by: MX <10697207+xMasterX@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>

* SLIX2 emulation support / practical use for Dymo printers (#2783)

* improve digital_signal for longer packets, also clean up code
* added SLIX2 specific features like signature and unknown keys (for issue #2781), added WRITE_PASSWORD handling
* fix NfcV AFI selection
* when NFCV_CMD_READ_MULTI_BLOCK reads beyond memory end, return the maximum possible block's content
* added SLIX2 reading
* fix NXP SYSTEMINFO response check size
* capture the first received password if none was set before
* clear stored data before reading SLIX details renamed slix2_dump functions to slix2_read
* display card block size values as decimal

Co-authored-by: あく <alleteam@gmail.com>

* NFC: Fix key invalidation logic (#2782)

* NFC: Fix key invalidation logic
* NFC: Fix crash in CLI with empty response
* Fix incorrect key conversions
* Proper call to nfc_util

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: Astra <me@astrra.space>

* [FL-3211][FL-3212] Debug apps: speaker, uart_echo with baudrate (#2812)

* Music player: move music_worker to library
* Music player: drop cli
* Debug: speaker debug app
* Debug: baudrate arg in uart_echo app
* Libs: add music_worker to api
* Libs: add music_worker to targets linker_dependencies

Co-authored-by: あく <alleteam@gmail.com>

* increased timeouts (#2816)

Co-authored-by: doomwastaken <k.volkov@flipperdevices.com>

* Furi,FuriHal: various improvements (#2819)

* Lib: adjust default contrast for ERC displays

* Furi: various improvements in check module

* Format Sources

* FurHal: ble early hardfault detection

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>

* [FL-3375] SubGhz: add CC1101 module external (#2747)

* SubGhz: add CC1101 Ext driver
* SubGhz:  move TIM2 -> TIM17 use cc1101_ext
* FuriHal: SPI move channel DMA 3,4 -> 6.7
* Documentation: fix font
* SubGhz: add work with SubGhz devices by link to device
* SubGhz: add support switching external/internal cc1101 "subghz chat"
* SubGhz: add support switching external/internal cc1101 "subghz tx" and "subghz rx"
* SubGhz: add "Radio Settings" scene
* SubGhz: add icon
* SubGhz: add supported CC1101 external module in SubGhz app
* SubGhz: fix check frequency supported radio device
* SubGhz: fix clang-formatted
* Sughz: move dirver CC1101_Ext to lib , compile cmd ./fbt launch_app APPSRC=radio_device_cc1101_ext
* SubGhz: fix CLI
* SubGhz: fix PVS
* SubGhz: delete comments
* SubGhz: fix unit_test
* Format sources
* Update api symbols and drivers targets
* Drivers: find proper place for target option
* SubGhz: external device connected method naming
* Format sources
* SubGhz:  fix module selection menu, when external is not connected
* SubGhz: fix furi_assert(device);
* SubGhz: fix split h and c
* SubGhz: furi_hal_subghz remove preset load function by name
* SubGhz: deleted comments
* Format Sources
* SubGhz: add some consts and fix unit tests
* Sync API Symbols

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>

* fix width of submenu items on Vertical orientation (#2306)

* fix width of submenu items on vertical view
* Gui: slightly better canvas width handling in submenu
* Gui: remove unused include

Co-authored-by: あく <alleteam@gmail.com>

* SubGHz: properly working with missing external driver (#2821)

* all: revert incorrect changes

* nfc app: apply correct changes

* nfc: build fixes

---------

Co-authored-by: end-me-please <90796271+end-me-please@users.noreply.github.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: Max Andreev <drunkbatya.js@gmail.com>
Co-authored-by: MX <10697207+xMasterX@users.noreply.github.com>
Co-authored-by: Yukai Li <GMMan@users.noreply.github.com>
Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: Félix Legrelle <legrelle.f@gmail.com>
Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
Co-authored-by: Nikolay Minaylov <nm29719@gmail.com>
Co-authored-by: minchogaydarov <134236905+minchogaydarov@users.noreply.github.com>
Co-authored-by: Avery <30564701+nullableVoidPtr@users.noreply.github.com>
Co-authored-by: technobulb <84107091+technobulb@users.noreply.github.com>
Co-authored-by: Sebastian Mauer <mauimauer@gmail.com>
Co-authored-by: micolous <micolous+gh@gmail.com>
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: Skorpionm <85568270+Skorpionm@users.noreply.github.com>
Co-authored-by: AloneLiberty <111039319+AloneLiberty@users.noreply.github.com>
Co-authored-by: Zoë Prosvetova <109866245+ZoeMeetAgain@users.noreply.github.com>
Co-authored-by: Astra <93453568+Astrrra@users.noreply.github.com>
Co-authored-by: DEXV <89728480+DXVVAY@users.noreply.github.com>
Co-authored-by: glebmashanov <65850300+glebmashanov@users.noreply.github.com>
Co-authored-by: g3gg0.de <git@g3gg0.de>
Co-authored-by: Tiernan Messmer <tiernan.messmer@gmail.com>
Co-authored-by: clashlab <nicolabriet@gmail.com>
Co-authored-by: Leopold <leommxj@gmail.com>
Co-authored-by: Petr Portnov | PROgrm_JARvis <gh@progrm-jarvis.ru>
Co-authored-by: PpHd <patrick.pelissier@gmail.com>
Co-authored-by: Konstantin Volkov <72250702+doomwastaken@users.noreply.github.com>
Co-authored-by: doomwastaken <k.volkov@flipperdevices.com>
Co-authored-by: Patrick Kilter <patrick.kilter@gmail.com>
Co-authored-by: Dmitry Zinin <admin@kami-no.ru>
Co-authored-by: Astra <me@astrra.space>
Co-authored-by: Slavik Nychkalo <slavik.nychkalo@gmail.com>
  • Loading branch information
1 parent 673465c commit 39b87f7
Show file tree
Hide file tree
Showing 275 changed files with 6,524 additions and 2,228 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ jobs:
- name: 'Flash unit tests firmware'
id: flashing
if: success()
timeout-minutes: 10
run: |
./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
- name: 'Wait for flipper and format ext'
id: format_ext
if: steps.flashing.outcome == 'success'
timeout-minutes: 5
run: |
source scripts/toolchain/fbtenv.sh
python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
Expand All @@ -43,6 +45,7 @@ jobs:
- name: 'Copy assets and unit data, reboot and wait for flipper'
id: copy
if: steps.format_ext.outcome == 'success'
timeout-minutes: 5
run: |
source scripts/toolchain/fbtenv.sh
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/resources /ext
Expand All @@ -53,7 +56,7 @@ jobs:
- name: 'Run units and validate results'
id: run_units
if: steps.copy.outcome == 'success'
timeout-minutes: 2.5
timeout-minutes: 7
run: |
source scripts/toolchain/fbtenv.sh
python3 scripts/testing/units.py ${{steps.device.outputs.flipper}}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/updater_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ jobs:
- name: 'Flashing target firmware'
id: first_full_flash
timeout-minutes: 10
run: |
source scripts/toolchain/fbtenv.sh
./fbt flash_usb_full PORT=${{steps.device.outputs.flipper}} FORCE=1
python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
- name: 'Validating updater'
id: second_full_flash
timeout-minutes: 10
if: success()
run: |
source scripts/toolchain/fbtenv.sh
Expand Down
2 changes: 1 addition & 1 deletion CODING_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Almost everything in flipper firmware is built around this concept.
# C coding style

- Tab is 4 spaces
- Use `fbt format` to reformat source code and check style guide before commit
- Use `./fbt format` to reformat source code and check style guide before commit

## Naming

Expand Down
1 change: 0 additions & 1 deletion applications/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Applications for main Flipper menu.

- `archive` - Archive and file manager
- `bad_usb` - Bad USB application
- `fap_loader` - External applications loader
- `gpio` - GPIO application: includes USART bridge and GPIO control
- `ibutton` - iButton application, onewire keys and more
- `infrared` - Infrared application, controls your IR devices
Expand Down
1 change: 1 addition & 0 deletions applications/debug/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ App(
"display_test",
"text_box_test",
"file_browser_test",
"speaker_debug",
],
)
10 changes: 10 additions & 0 deletions applications/debug/crash_test/application.fam
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
App(
appid="crash_test",
name="Crash Test",
apptype=FlipperAppType.DEBUG,
entry_point="crash_test_app",
cdefines=["APP_CRASH_TEST"],
requires=["gui"],
stack_size=1 * 1024,
fap_category="Debug",
)
128 changes: 128 additions & 0 deletions applications/debug/crash_test/crash_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#include <furi_hal.h>
#include <furi.h>

#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/submenu.h>

#define TAG "CrashTest"

typedef struct {
Gui* gui;
ViewDispatcher* view_dispatcher;
Submenu* submenu;
} CrashTest;

typedef enum {
CrashTestViewSubmenu,
} CrashTestView;

typedef enum {
CrashTestSubmenuCheck,
CrashTestSubmenuCheckMessage,
CrashTestSubmenuAssert,
CrashTestSubmenuAssertMessage,
CrashTestSubmenuCrash,
CrashTestSubmenuHalt,
} CrashTestSubmenu;

static void crash_test_submenu_callback(void* context, uint32_t index) {
CrashTest* instance = (CrashTest*)context;
UNUSED(instance);

switch(index) {
case CrashTestSubmenuCheck:
furi_check(false);
break;
case CrashTestSubmenuCheckMessage:
furi_check(false, "Crash test: furi_check with message");
break;
case CrashTestSubmenuAssert:
furi_assert(false);
break;
case CrashTestSubmenuAssertMessage:
furi_assert(false, "Crash test: furi_assert with message");
break;
case CrashTestSubmenuCrash:
furi_crash("Crash test: furi_crash");
break;
case CrashTestSubmenuHalt:
furi_halt("Crash test: furi_halt");
break;
default:
furi_crash("Programming error");
}
}

static uint32_t crash_test_exit_callback(void* context) {
UNUSED(context);
return VIEW_NONE;
}

CrashTest* crash_test_alloc() {
CrashTest* instance = malloc(sizeof(CrashTest));

View* view = NULL;

instance->gui = furi_record_open(RECORD_GUI);
instance->view_dispatcher = view_dispatcher_alloc();
view_dispatcher_enable_queue(instance->view_dispatcher);
view_dispatcher_attach_to_gui(
instance->view_dispatcher, instance->gui, ViewDispatcherTypeFullscreen);

// Menu
instance->submenu = submenu_alloc();
view = submenu_get_view(instance->submenu);
view_set_previous_callback(view, crash_test_exit_callback);
view_dispatcher_add_view(instance->view_dispatcher, CrashTestViewSubmenu, view);
submenu_add_item(
instance->submenu, "Check", CrashTestSubmenuCheck, crash_test_submenu_callback, instance);
submenu_add_item(
instance->submenu,
"Check with message",
CrashTestSubmenuCheckMessage,
crash_test_submenu_callback,
instance);
submenu_add_item(
instance->submenu, "Assert", CrashTestSubmenuAssert, crash_test_submenu_callback, instance);
submenu_add_item(
instance->submenu,
"Assert with message",
CrashTestSubmenuAssertMessage,
crash_test_submenu_callback,
instance);
submenu_add_item(
instance->submenu, "Crash", CrashTestSubmenuCrash, crash_test_submenu_callback, instance);
submenu_add_item(
instance->submenu, "Halt", CrashTestSubmenuHalt, crash_test_submenu_callback, instance);

return instance;
}

void crash_test_free(CrashTest* instance) {
view_dispatcher_remove_view(instance->view_dispatcher, CrashTestViewSubmenu);
submenu_free(instance->submenu);

view_dispatcher_free(instance->view_dispatcher);
furi_record_close(RECORD_GUI);

free(instance);
}

int32_t crash_test_run(CrashTest* instance) {
view_dispatcher_switch_to_view(instance->view_dispatcher, CrashTestViewSubmenu);
view_dispatcher_run(instance->view_dispatcher);
return 0;
}

int32_t crash_test_app(void* p) {
UNUSED(p);

CrashTest* instance = crash_test_alloc();

int32_t ret = crash_test_run(instance);

crash_test_free(instance);

return ret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ static void comparator_trigger_callback(bool level, void* comp_ctx) {
furi_hal_gpio_write(&gpio_ext_pa7, !level);
}

void lfrfid_debug_view_tune_callback(void* context) {
LfRfidDebug* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, 0xBA);
}

void lfrfid_debug_scene_tune_on_enter(void* context) {
LfRfidDebug* app = context;

Expand All @@ -16,6 +21,8 @@ void lfrfid_debug_scene_tune_on_enter(void* context) {

furi_hal_rfid_tim_read_start(125000, 0.5);

lfrfid_debug_view_tune_set_callback(app->tune_view, lfrfid_debug_view_tune_callback, app);

view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidDebugViewTune);
}

Expand Down
44 changes: 31 additions & 13 deletions applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ typedef struct {
uint32_t ARR;
uint32_t CCR;
int pos;
void (*update_callback)(void* context);
void* update_context;
} LfRfidTuneViewModel;

static void lfrfid_debug_view_tune_draw_callback(Canvas* canvas, void* _model) {
Expand Down Expand Up @@ -151,6 +153,18 @@ static bool lfrfid_debug_view_tune_input_callback(InputEvent* event, void* conte
consumed = false;
break;
}

if(event->key == InputKeyLeft || event->key == InputKeyRight) {
with_view_model(
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->update_callback) {
model->update_callback(model->update_context);
}
},
false);
}
}

return consumed;
Expand All @@ -161,19 +175,7 @@ LfRfidTuneView* lfrfid_debug_view_tune_alloc() {
tune_view->view = view_alloc();
view_set_context(tune_view->view, tune_view);
view_allocate_model(tune_view->view, ViewModelTypeLocking, sizeof(LfRfidTuneViewModel));

with_view_model(
tune_view->view,
LfRfidTuneViewModel * model,
{
model->dirty = true;
model->fine = false;
model->ARR = 511;
model->CCR = 255;
model->pos = 0;
},
true);

lfrfid_debug_view_tune_clean(tune_view);
view_set_draw_callback(tune_view->view, lfrfid_debug_view_tune_draw_callback);
view_set_input_callback(tune_view->view, lfrfid_debug_view_tune_input_callback);

Expand All @@ -199,6 +201,8 @@ void lfrfid_debug_view_tune_clean(LfRfidTuneView* tune_view) {
model->ARR = 511;
model->CCR = 255;
model->pos = 0;
model->update_callback = NULL;
model->update_context = NULL;
},
true);
}
Expand Down Expand Up @@ -232,3 +236,17 @@ uint32_t lfrfid_debug_view_tune_get_ccr(LfRfidTuneView* tune_view) {

return result;
}

void lfrfid_debug_view_tune_set_callback(
LfRfidTuneView* tune_view,
void (*callback)(void* context),
void* context) {
with_view_model(
tune_view->view,
LfRfidTuneViewModel * model,
{
model->update_callback = callback;
model->update_context = context;
},
false);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view);
uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view);

uint32_t lfrfid_debug_view_tune_get_ccr(LfRfidTuneView* tune_view);

void lfrfid_debug_view_tune_set_callback(
LfRfidTuneView* tune_view,
void (*callback)(void* context),
void* context);
11 changes: 11 additions & 0 deletions applications/debug/speaker_debug/application.fam
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
App(
appid="speaker_debug",
name="Speaker Debug",
apptype=FlipperAppType.DEBUG,
entry_point="speaker_debug_app",
requires=["gui", "notification"],
stack_size=2 * 1024,
order=10,
fap_category="Debug",
fap_libs=["music_worker"],
)
Loading

0 comments on commit 39b87f7

Please sign in to comment.