Commit Graph

66 Commits

Author SHA1 Message Date
Nikolay Minaylov
f10e82c64d
[FL-3024] Locale settings (#2137)
* Locale settings
* Time/date format fix
* Locale: add docs, enums for HAL, cleanup.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-12-19 18:38:20 +09:00
Skorpionm
2dea6969fe
[FL-3040] Audio support for SubGhz (#2131)
* Furi_hal_speaker: multiple resource usage
* Furi_hal_speaker: fix multiple resource usage
* Furi_hal_speaker: fix music_player_worker
* Furi_hal_speaker: fix mutex release queue handling
* SubGhz: add furi_hal_subghz_set_debug_pin
* SubGhz: add sound SubGhz Read, SubGhz Read RAW
* furi_hal_speaker: add __attribute__((warn_unused_result)) for furi_hal_speaker_acquire()
* Furi_hal_speaker: fix review comments
* SubGhz: cleanup naming and locking timings
* SubGhz,FuriHal: fix speaker deinit logic and subghz speaker release sequence
* FuriHal: crash on speaker acquire/release from IRQ
* Furi, FuriHal: FURI_WARN_UNUSED and documentation update
* Bump api symbols version: fix broken speaker

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-12-17 07:20:10 +09:00
Shane Synan
5c3a5cd8f7
FuriHal, Power, UnitTests: battery charging voltage limit API (#2063) 2022-12-08 15:57:49 +09:00
Nikolay Minaylov
4070eeb1c9
USB HID: fix key name #2065
Co-authored-by: あく <alleteam@gmail.com>
2022-12-02 03:56:27 +09:00
Skorpionm
2a6a3a1bf7
[FL-2955], [FL-2953] SubGhz: fix RAW "Send never ends" (#1979)
* SubGhz: fix RAW "Send never ends"
* SubGhz: delete comments
* SubGhz: RAW file parsing speed increase
* SubGhz: fix level_duration_is_wait
* SubGhz: modification furi_hal_subghz_async_tx_refill
* SubGhz: furi_hal_subghz_stop_async_rx
* SubGhz: hal unit test and better async tx yield handling
* FuriHal: proper async tx end in subghz, vibro on power off
* FuriHal: variable naming in subghz
* SubGhz,FuriHal: extreme timings in subghz hal unit tests, remove memset in async tx buffer fill routine
* FuriHal: small refinements in subghz

Co-authored-by: あく <alleteam@gmail.com>
2022-11-30 20:41:23 +09:00
Georgii Surkov
0261dc3075
[FL-2957] Unified Info API, App Error, Data Xchange (#1998)
* Update protobuf definitions
* Add Property subsystem entry point function
* Key-based system info and power info function stubs
* Remove unneeded functions
* Working power info
* Working system info
* Replace #defines with string literals
* Remove unneeded field
* Simplify system info formatting
* Refactor output callback handling
* Handle the last info element correctly
* Optimise power info, rename methods
* Add comments
* Add power debug
* Remove unneeded definitions
* Rename some files and functions
* Update protobuf definitions
* Implement App GetError and DataExchange APIs
* Send GetErrorReply with correct command_id
* Add RPC debug app stub
* Add more scenes
* Add warning, increase stack size
* Add receive data exchange scene
* Improve data exchange
* Add notifications
* Update application requirements
* Bump format version for property-based infos
* Correctly reset error text
* RCP: sync protobuf repo to latest release tag

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-11-29 18:08:08 +09:00
あく
90cefe7c71
[FL-2975] Bug fixes and improvements: Furi, Input, Cli (#2004)
* Furi: configurable heap allocation tracking
* Furi: relax restriction in thread heap setter asserts, apply heap tracking setting on app start instead of thread allocation
* Furi: hide dangerous heap tracking levels in release build
* Input: fix non-working debounce
2022-11-12 12:46:04 +04:00
gornekich
bf8fd71c00
NFC magic cards support (#1966)
* nfc magic: introduce nfc app to work with magic cards
* nfc: add nfc device functions to API
* nfc magic: add bacis scenes
* nfc magic: add wrong card and write confirm scenes
* nfc magic: introduce magic lib
* nfc magic: write magic lib
* nfc magic: add write commands to magic lib
* nfc magic: work on worker
* furi_hal_nfc: add bits data exchage method to API
* nfc magic: rework with new API
* nfc magic: add check and wipe scenes
* nfc magic: add icons, gui fixes
* nfc: format python src

Co-authored-by: あく <alleteam@gmail.com>
2022-11-04 16:01:44 +09:00
あく
d68ac50efd
Storage: tree timestamps (#1971)
* Storage: tree timestamps
* Rpc: add storage timestamp
* Storage: correct timestamp owner
* Storage: update timestamp at sd mount

Co-authored-by: SG <who.just.the.doctor@gmail.com>
2022-11-04 15:26:04 +10:00
hedger
8b7a52b97b
fbt: fixed linter paths (#1930)
* fbt: fixed linter paths
* lint: changed file permissions

Co-authored-by: あく <alleteam@gmail.com>
2022-10-27 05:25:31 +09:00
あく
33892ebfb7
[FL-2818] FuriHal: add FuriHalCortexTimer, use it for i2c bus timeouts (#1900)
* FuriHal: add FuriHalCortexTimer, use it for i2c bus timeouts
* Furi: cleanup FuriHalCortexTimer sources and headers
2022-10-20 20:14:46 +03:00
gornekich
ead9f134f4
[FL-2623] Add BLE disconnect request #1686
Co-authored-by: LionZXY <nikita@kulikof.ru>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-15 02:21:23 +09:00
Sergey Gavrilov
4bf29827f8
M*LIB: non-inlined strings, FuriString primitive (#1795)
* Quicksave 1
* Header stage complete
* Source stage complete
* Lint & merge fixes
* Includes
* Documentation step 1
* FBT: output free size considering BT STACK
* Documentation step 2
* py lint
* Fix music player plugin
* unit test stage 1: string allocator, mem, getters, setters, appends, compare, search.
* unit test: string equality
* unit test: string replace
* unit test: string start_with, end_with
* unit test: string trim
* unit test: utf-8
* Rename
* Revert fw_size changes
* Simplify CLI backspace handling
* Simplify CLI character insert
* Merge fixes
* Furi: correct filenaming and spelling
* Bt: remove furi string include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-06 00:15:23 +09:00
Shane Synan
9f501034c3
Power: Also ask charger if charge done (#1378)
* power: Also ask charger if charge done
* F7: bump API Symbols version
* Lib: remove double include in bq25896.c

Co-authored-by: あく <alleteam@gmail.com>
2022-09-27 00:34:59 +09:00
Astra
3d3c422751
[FL-2674] Show error popup when NFC chip is not init/disconnected (#1722)
* Show error popup when NFC chip is not init/disconnected
* Move to dialogs for the error message
* Fix a memory leak and wrap the hal check
* F7: update api_symbols.csv, add furi_hal_nfc_is_init

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-19 21:46:56 +09:00
hedger
ed385594a3
faploader: more subsystem headers in API table (#1742)
* faploader: more subsystem headers in API table; not counting header entries for SDK version change
* subghz: removed dead function
* Adjusted API version
* hal: removed furi_hal_power_get_system_voltage
* lib: mbedtls: additional flags for .fap linkage
* fbt: rebuilding assets when git commit id changes
* fbt: removed assets rebuild on git commit id change; added explicit dependency for SDK source on compiled assets parts; removed unneeded sdk regeneration runs
* fbt: changed stock plugins to EXTERNAL apps; restored building app as a PLUGIN as a part of main fw as well as a .fap; readme fixes
* fbt: restored certain apps to PLUGIN type
* fbt: app manifests: renamed version->fap_version, added extra fields
* fbt: fixed version processing after rename

Co-authored-by: あく <alleteam@gmail.com>
2022-09-19 21:39:00 +09:00
SG
b9a766d909 [FL-2627] Flipper applications: SDK, build and debug system (#1387)
* Added support for running applications from SD card (FAPs - Flipper Application Packages)
* Added plugin_dist target for fbt to build FAPs
* All apps of type FlipperAppType.EXTERNAL and FlipperAppType.PLUGIN are built as FAPs by default
* Updated VSCode configuration for new fbt features - re-deploy stock configuration to use them
* Added debugging support for FAPs with fbt debug & VSCode
* Added public firmware API with automated versioning

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-15 02:21:03 +09:00
gornekich
1853359d78
[FL-2759], [FL-2766] NFC collect params for mfkey32 attack (#1643)
* nfc: start nfc over rpc
* nfc: add detect reader state
* nfc: add reader analyzer
* nfc: rework reader analyzer
* reader_analyzer: print collected nonces to debug
* reader analyzer: add save on SD card
* reader_analyzer: separate mfkey related part to different file
* mfkey32: add logic for collecting parameters
* nfc: rework pcap with reader analyzer
* nfc: add logger for reader
* nfc: clean up
* nfc: add detect reader view
* nfc: add detect reader and mfkey nonces scenes
* nfc: add mfkey comlplete scene
* nfc: add new assets
* nfc: fix gui
* nfc: fix iso14443-4 UID emulation
* nfc: add no sd card notification
* nfc: fix grammar

Co-authored-by: あく <alleteam@gmail.com>
2022-09-03 21:25:36 +09:00
SG
99a7d06f71
Speedup SD card & enlarge your RAM. (#1649)
* FuriHal: sram2 memory manager
* FuriHal: sram2 memory allocator
* FuriHal: allow NULL buffers for txrx in spi hal
* SD card: sector cache
* FuriHal: fix init in memory hal
* RPC: STARTUP instead SERVICE
* Memory: pool "free" command
* Thread: service can be statically allocated in a memory pool

Co-authored-by: あく <alleteam@gmail.com>
2022-08-27 13:25:47 +09:00
SG
9bfb641d3e
[FL-2529][FL-1628] New LF-RFID subsystem (#1601)
* Makefile: unit tests pack
* RFID: pulse joiner and its unit test
* Move pulse protocol helpers to appropriate place
* Drop pulse_joiner tests
* Generic protocol, protocols dictionary, unit test
* Protocol dict unit test
* iButton: protocols dictionary
* Lib: varint
* Lib: profiler
* Unit test: varint
* rfid: worker mockup
* LFRFID: em4100 unit test
* Storage: file_exist function
* rfid: fsk osc
* rfid: generic fsk demodulator
* rfid: protocol em4100
* rfid: protocol h10301
* rfid: protocol io prox xsf
* Unit test: rfid protocols
* rfid: new hal
* rfid: raw worker
* Unit test: fix error output
* rfid: worker
* rfid: plain c cli
* fw: migrate to scons
* lfrfid: full io prox support
* unit test: io prox protocol
* SubGHZ: move bit defines to source
* FSK oscillator: level duration compability
* libs: bit manipulation library
* lfrfid: ioprox protocol, use bit library and new level duration method of FSK ocillator
* bit lib: unit tests
* Bit lib: parity tests, remove every nth bit, copy bits
* Lfrfid: awid protocol
* bit lib: uint16 and uint32 getters, unit tests
* lfrfid: FDX-B read, draft version
* Minunit: better memeq assert
* bit lib: reverse, print, print regions
* Protocol dict: get protocol features, get protocol validate count
* lfrfid worker: improved read
* lfrfid raw worker: psk support
* Cli: rfid plain C cli
* protocol AWID: render
* protocol em4100: render
* protocol h10301: render
* protocol indala26: support every indala 26 scramble
* Protocol IO Prox: render
* Protocol FDX-B: advanced read
* lfrfid: remove unused test function
* lfrfid: fix os primitives
* bit lib: crc16 and unit tests
* FDX-B: save data
* lfrfid worker: increase stream size. Alloc raw worker only when needed.
* lfrfid: indala26 emulation
* lfrfid: prepare to write
* lfrfid: fdx-b emulation
* lfrfid: awid, ioprox write
* lfrfid: write t55xx w\o validation
* lfrfid: better t55xx block0 handling
* lfrfid: use new t5577 functions in worker
* lfrfid: improve protocol description
* lfrfid: write and verify
* lfrfid: delete cpp cli
* lfrfid: improve worker usage
* lfrfid-app: step to new worker
* lfrfid: old indala (I40134) load fallback
* lfrfid: indala26, recover wrong synced data
* lfrfid: remove old worker
* lfrfid app: dummy read screen
* lfrfid app: less dummy read screen
* lfrfid: generic 96-bit HID protocol (covers up to HID 37-bit)
* rename
* lfrfid: improve indala26 read
* lfrfid: generic 192-bit HID protocol (covers all HID extended)
* lfrfid: TODO about HID render
* lfrfid: new protocol FDX-A
* lfrfid-app: correct worker stop on exit
* misc fixes
* lfrfid: FDX-A and HID distinguishability has been fixed.
* lfrfid: decode HID size header and render it (#1612)
* lfrfid: rename HID96 and HID192 to HIDProx and HIDExt
* lfrfid: extra actions scene
* lfrfid: decode generic HID Proximity size lazily (#1618)
* lib: stream of data buffers concept
* lfrfid: raw file helper
* lfrfid: changed raw worker api
* lfrfid: packed varint pair
* lfrfid: read stream speedup
* lfrfid app: show read mode
* Documentation
* lfrfid app: raw read gui
* lfrfid app: storage check for raw read
* memleak fix
* review fixes
* lfrfid app: read blink color
* lfrfid app: reset key name after read
* review fixes
* lfrfid app: fix copypasted text
* review fixes
* lfrfid: disable debug gpio
* lfrfid: card detection events
* lfrfid: change validation color from magenta to green
* Update core_defines.
* lfrfid: prefix fdx-b id by zeroes
* lfrfid: parse up to 43-bit HID Proximity keys (#1640)
* Fbt: downgrade toolchain and fix PS1
* lfrfid: fix unit tests
* lfrfid app: remove printf
* lfrfid: indala26, use bit 55 as data
* lfrfid: indala26, better brief format
* lfrfid: indala26, loading fallback
* lfrfid: read timing tuning

Co-authored-by: James Ide <ide@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-08-24 00:57:39 +09:00
あく
6ee2c15854
FuriHal,About,Desktop: show provisioned region (#1589)
Co-authored-by: hedger <hedger@users.noreply.github.com>
2022-08-12 13:19:29 +03:00
あく
fae392d84e
[FL-2677] SubGhz: region provisioning (#1574)
* FuriHal: region HAL draft
* FuriHal,SubGhz: complete region provisioning.
* Rpc: fix null pointer dereference.
* Cli: device info formatting
* FuriHal: region provisioning fixes and documentation.
2022-08-11 19:21:56 +10:00
SG
eed4296890
MPU Hal (#1492)
* Furi HAL: memory protection unit
* Core: prohibit NULL dereferencing, even for reads.
* Applications: fix NULL dereference
* Core: stack protection by MPU
* MPU: stack region alignment
* Apps: fix null pointer dereferences
* Threads: fix non-null arg check
* Desktop settings: fix null pointer dereference
* Core: documented null-check hack
* Fix null dereference issues
* Apps: args check
* Core: naming fixes
* format code
* Core: remove NONNULL specifier
* FurHal: move MPU initialization to begining, fix enum naming

Co-authored-by: あく <alleteam@gmail.com>
2022-08-04 00:47:10 +09:00
gornekich
9c59bcd776
[FL-2605] NFC new design (#1364)
* nfc: add new read scene

* lib: refactore nfc library

* mifare desfire: add read card fuction

* lib nfc: add auto read worker

* nfc: add supported cards

* nfc: add mifare classic read success scene

* nfc: add troyka support

* submodule: update protobuf

* nfc: mifare classic keys cache

* nfc: rework mifare classic key cache

* Correct spelling

* nfc: add user dictionary

* nfc: introduce block read map in fff

* nfc: rework dict attack

* nfc: improve dict attack

* nfc: rework mifare classic format

* nfc: rework MFC read with Reader

* nfc: add gui for MFC read success scene

* nfc: fix dict attack view gui

* nfc: add retry and exit confirm scenes

* nfc: add retry and exit scenes navigation

* nfc: check user dictionary

* nfc: remove unused scenes

* nfc: rename functions in nfc worker

* nfc: rename mf_classic_dict_attack -> dict_attack

* nfc: change scenes names
* nfc: remove scene tick events
* nfc: rework dict calls with buffer streams
* nfc: fix notifications
* nfc: fix mf desfire navigation
* nfc: remove notification from mf classic read success
* nfc: fix read sectors calculation
* nfc: add fallback for unknown card
* nfc: show file name while emulating
* nfc: fix build
* nfc: fix memory leak
* nfc: fix desfire read
* nfc: add no dict found navigation
* nfc: add read views
* nfc: update card fix
* nfc: fix access bytes save
* nfc: add exit and retry confirm to mf ultralight read success
* nfc: introduce detect reader
* nfc: change record open arg to macros
* nfc: fix start from archive

Co-authored-by: Astra <astra@astrra.space>
Co-authored-by: あく <alleteam@gmail.com>
2022-07-27 00:30:49 +09:00
Skorpionm
ec19c11dbe
[FL-2669] SubGhz: add support for loading custom presets (#1398)
* SubGhz: load custom -preset
* SubGhz: fix error prt=0
* SubGhz: load custom preset
* SubGhz: code refactoring to support custom preset
* SubGhz: add custom presert refactoring
* SubGhz: fix alloc history alloc preset
* SubGhz: fix error load file
* SubGhz: fix start custom preset
* SubGhz: fix delete custom preset
* SubGhz: add description Custom_preset_data for CC1101
* SubGhz: debug logging and buffer size rounding

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2022-07-26 23:16:59 +09:00
あく
e3c7201a20
Furi: core refactoring and CMSIS removal part 2 (#1410)
* Furi: rename and move core
* Furi: drop CMSIS_OS header and unused api, partially refactor and cleanup the rest
* Furi: CMSIS_OS drop and refactoring.
* Furi: refactoring, remove cmsis legacy
* Furi: fix incorrect assert on queue deallocation, cleanup timer
* Furi: improve delay api, get rid of floats
* hal: dropped furi_hal_crc
* Furi: move DWT based delay to cortex HAL
* Furi: update core documentation

Co-authored-by: hedger <hedger@nanode.su>
2022-07-20 13:56:33 +03:00
Michael Marcucci
6b3625f46b
Bluetooth Remote Additions (#1330)
* Update the HID Keycodes to pull from the library
* Composite BLE Report Map, add consumer & mouse HID
* Add Mouse & keyboard bt remote, fixed media remote
* BT Keyboard remove long press shift
* Fix usb hid modifier keys
* Fixed misaligned bad usb keys
* Fix keyboard app keys
* Partial fix for bt app and linux
* Update to work across platforms
* Fix for report ids
* BtHidApp: move variable from bss to model, cleanup naming.
* FuriHal: add const to immutable data declaration

Co-authored-by: あく <alleteam@gmail.com>
2022-07-08 21:36:34 +09:00
gornekich
5769595e67
NFC emulation software tunning (#1341)
* digital_signal: optimize calculationxx
* firmware: add listen start and listen rx
* digital signal: rework with fixed point calculation
* nfc: tune timings
* nfc: fix array overflow
* mifare classic: fix key access
* nfc: rework spi bus access
* nfc: rework listen mode with st25r3916 calls
* digital signal: speed up digital_signal_append()
* digital signal: remove unused profiling
* nfc: clean up code
* nfc: correct sleep state
* nfc: add unit tests
* nfc: fix memory leak in unit test
* digital_signal: remove unused code
* nfc: fix incorrect sak load in pt memory

Co-authored-by: あく <alleteam@gmail.com>
2022-07-03 23:51:50 +09:00
あく
936a2f64b2
[FL-2580] FuriHal: add more supported radio stacks (#1301)
* FuriHal: add more supported radio stacks
* Bt: correct ble stack enum value
* Bt: update cli testing commands implementation
* Scripts: always emitting ob data to update manifest; added ob_custradio.data for non-light radio stacks
* Scripts: added stack type whitelist & disclaimer message
* ble: remove scanner
* ble: remove HCI and advances ble stacks support
* bt: correctly close RPC session before bt reinit
* Scripts: update bundler: estimating flash layout & refusing to build dangerous packages; app frame: not adding redundant log handlers
* Docs: additional details on bundling updates; fixed updater error codes
* Docs: wording fixes for OTA.md

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
2022-06-09 18:07:42 +09:00
Kevin Wallace
9c9f66a30f
nfc: add debug PCAP output, refactor Mifare DESFire following #1095 (#1294)
* nfc: refactor nfc_worker_read_mifare_desfire to use furi_hal_nfc_tx_rx
  Renames furi_hal_nfc_exchange_full to furi_hal_nfc_tx_rx_full, and
  rewrites it to use furi_hal_nfc_tx_rx.  This eliminates the final
  remaining use of furi_hal_nfc_exchange, so remove that.
* nfc: write debug.pcap when debug mode enabled
  Limited to NFC protocols that use furi_hal_nfc_tx_rx to communicate.
* switch to Doxygen style comment

Co-authored-by: Kevin Wallace <git+flipperzero@kevin.wallace.seattle.wa.us>
Co-authored-by: あく <alleteam@gmail.com>
2022-06-09 17:35:34 +09:00
Nikolay Minaylov
cfb1a0d01c
Hardware LED blinking (#1303)
* Hardware LED blinking notification messages
* Blink: fix crash on exit, reset blinking on exit
* Lib: remove unused UNUSED

Co-authored-by: あく <alleteam@gmail.com>
2022-06-09 16:33:46 +09:00
Yukai Li
0d5d4c8688
RFC: NTAG I2C support (#1227)
* nfc: Add NTAG I2C (Plus) 1K/2K read support
* nfc: Add rudimentary NTAG I2C emulation
* nfc: Closer NTAG I2C emulation plus debug logging
* nfc: Fix NTAG I2C sector select emulation
* nfc: Add security for NTAG I2C
* nfc: Send NAK correctly for MFUL reads
* nfc: Better emulate NTAG I2C SECTOR_SELECT behavior
* nfc: Fix non-I2C Ultralight read
  Per datasheet, max sector for SECTOR_SELECT is 0xfe, so 0xff is OK
  as uninit value
* nfc: Only read sig for NTAG if supported
  Attempting to read signature breaks immediate call to sector select on
  NTAG I2C original for some reason, so don't read signature if the
  command is not supported

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-05-26 15:55:29 +03:00
gornekich
d31578508a
[FL-2245] Introduce Mifare Classic Emulation (#1242)
* digital signal: introduce digital signal
* nfca: add nfca signal encoder
* nfc: add mifare classic emulation scene
* nfca: add classic emulation support to lib and hal
* mifare classic: support basic read commands
* nfc: add mifare classic menu scene
* mifare classic: start parsing commands in emulation
* mifare classic: add nested auth
* nfc: fix errors
* mifare classic: add encrypt function
* nfc: fix mifare classic save
* lib hex: add hex uint64_t ASCII parser
* flipper format: add uint64 hex format support
* nfc: add mifare classic key map
* nfc: hide mifare classic keys on emulation
* mifare classic: add NACK responce
* nfc: add partial bytes support in transparent mode
* nfc: mifare classic add shadow file support
* digital signal: move arr buffer from BSS to heap
* mifare classic: process access bits more careful
* nfca: fix memory leack
* nfc: format sources
* mifare classic: cleun up

Co-authored-by: あく <alleteam@gmail.com>
2022-05-24 17:00:15 +03:00
gornekich
2017baac48
[FL-2441] BLE add Power state, fix double connection (#1238)
* battery service: add power state charachteristic
* bt: update power state on charging / discharging events
* ble config: support only one connection
* bt: always update flow control characteristic
* bt: fix power state update
* bt: simplify updating power state
* bt: don't update flow control charachteristic
2022-05-24 16:42:02 +03:00
あく
e8de94ca00
Drop libs rtc (#1248) 2022-05-20 05:53:33 +10:00
hedger
4d6b170769
[FL-2520] FW build with -Wextra (#1185)
* Fixing compiler warnings with -Wextra
* More warnings suppression, WIP
* Even more warning fixes
* Added new lines at end of text files.
* Padding fix
* Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline
* Fixes for Secplus v1
* -additional warnings
* +-Wredundant-decls fixes
* FuriHal: print stack overflow task name in console
* FuriHal: add missing include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-05-06 16:37:10 +03:00
あく
f5175e1388
Music player rework (#1189)
* Music player: cli tool and new worker
* Music player cli: flush message
* Music player: fix note calculation
* MusicPlayer: fix # parsing and add magic
* FuriHal: improve speaker volume handling. MusicPlayer: minor sustain improvements
* MusicPlayer: fix buffer overseek
* FuriHal: drop unused variables
* MusicPlayer: LFO 4 magic
* MusicPlayer: add RTTTL parser
* MusicPlayer: refactoring and add file open dialog on start
* MusicPlayer: fix memcpy issue and more
* FuriHal: force disconnect USB on early init and then leave usb line alone for some time.
* FuriHal: switch speaker to old volume. MusicPlayer: fix incorrect note history, and drop lfo from worker.

Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
2022-05-05 12:49:59 +03:00
Georgii Surkov
01434265f6
[FL-2399, FL-2261] Tickless sleep shenanigans (#1168)
* Disable USART in sleep
* Restore UART state on suspend/resume
* FuriHal: Enable stop mode and add insomnia to I2C and SPI
* Remove IDLE interrupt
* FuriHal: add FPU isr and disable all FPU interrupt, add core2 stop mode configuration on deep sleep
* FuriHal: tie stop mode debug with debug rtc flag
* FuriHal: adjust flash latency on clock switch, tie mcu debug with RTC debug flag
* FuriHal: move resource init to early stage
* Add EXTI pending check, enable debug traps with compile-time flag
* Wrap sleep debug functions in conditional compilation
* Remove erroneous changed
* Do not use CSS, remove it from everywhere
* Enable/disable USB on VBUS connect (prototype)
* FuriHal: add LPMS and DEEPSLEEP magic, workaround state inconsistency between cores
* FuriHal: honor c1 LMPS
* USB mode switch fix
* Applications: add flags and insomnia bypass system
* Correct spelling
* FuriHal: cleanup insomnia usage, reset sleep flags on wakeup, add shutdown api
* FuriHal: extra check on reinit request
* FuriHal: rename gpio_display_rst pin to gpio_display_rst_n
* FuriHal: add debug HAL
* FuriHal: add some magic to core2 reload procedure, fix issue with crash on ble keyboard exit
* FuriHal: cleanup ble glue, add BLE_GLUE_DEBUG flag
* FuriHal: ble reinit API, move os timer to LPTIM1 for deep sleep capability, shutdown that works
* FuriHal: take insomnia while shutdown
* Remove USB switch on/off on VBUS change
* Better tick skew handling
* Improve tick consistency under load
* Add USB_HP dummy IRQ handler
* Move interrupt check closer to sleep
* Clean up includes
* Re-enable Insomnia globally
* FuriHal: enable CSS
* FuriHal: remove questionable core2 clock shenanigans
* FuriHal: use core1 RCC registers in idle timer config
* FuriHal: return back CSS handlers, add lptim isr dispatching

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: nminaylov <nm29719@gmail.com>
2022-04-29 16:29:51 +03:00
Nikolay Minaylov
0eac917f91
[FL-2163] CLI: Separate session from CLI service (#1130)
* CLI: session refactoring
* Added forgotten define
* Desktop lock state save
* Dolphin: use proper type for value returned by dolphin_state_xp_to_levelup

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-04-29 15:02:17 +03:00
hedger
7ce305fca3
[FL-2269] Core2 OTA (#1144)
* C2OTA: wip
* Update Cube to 1.13.3
* Fixed prio
* Functional Core2 updater
* Removed hardware CRC usage; code cleanup & linter fixes
* Moved hardcoded stack params to copro.mk
* Fixing CI bundling of core2 fw
* Removed last traces of hardcoded radio stack
* OB processing draft
* Python scripts cleanup
* Support for comments in ob data
* Sacrificed SD card icon in favor of faster update. Waiting for Storage fix
* Additional handling for OB mismatched values
* Description for new furi_hal apis; spelling fixes
* Rework of OB write, WIP
* Properly restarting OB verification loop
* Split update_task_workers.c
* Checking OBs after enabling post-update mode
* Moved OB verification before flashing
* Removed ob.data for custom stacks
* Fixed progress calculation for OB
* Removed unnecessary OB mask cast

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-04-27 18:53:48 +03:00
Georgii Surkov
df66f4f6ba
[FL-2480] Use SysTick as the main OS timer (#1140)
* Use SysTick as OS tick timer
* Use LPTIM2 as tickless idle timer
* Remove dummy LPTIM2 IRQ handler
* Clean up clock init code
* Rename os timer to idle timer
* Advance hal ticks along with FreeRTOS's
* Improve SysTick control during tickless idle
* Improve idle timer precision
* Correct SysTick IRQ priority
* Main, FuriHal: move system startup to separate thread
* Minor code cleanup

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-04-21 16:15:19 +03:00
gornekich
956788c09b
[FL-2369] NFC refactoring (#1095)
* nfc: clean up scenes
* nfc worker: remove field on from worker
* nfc worker: move full data exchange to furi hal
* nfc_device: check UID length
* nfc protocol: introduce mifare common API
* nfc: move common data to furi hal nfc
* nfc: rename emv_decoder -> emv
* nfc: move emv data structure to emv lib
* nfc: remove deactivate after detection
* nfc: rework furi hal nfc detect
* nfc: clean up CLI commands and type
* nfc: remove unused includes and function
* nfc: add TxRxType enum
* nfc: read mifare ultralight refactoring
* nfc: refactore mifare ultralight start
* rfal: fix custom data exchange
* nfc: refactor read bank card
* nfc: refactor read emv application
* nfc: refactor emv test emulation
* nfc: refactor uid emulation
* nfc: add limit to uid emulation logger
* fix source formatting
* furi_hal_nfc: fix data exchange full
* nfc: fix mifare ultralight type load

Co-authored-by: あく <alleteam@gmail.com>
2022-04-19 18:23:58 +03:00
あく
1623134a82
Build system improvements and bug fixes (#1129)
* Assets: recompile
* Makefile: add debug_other to main makefile
* Github: stop compilation if compiled assets not in sync with assets sources
* Assets: recompile
* Makefile: correct debug_other rule. Bt: prevent on system start hook from waiting for bt service
* Power, FuriHal: gauge self check report
* Loader: move on system start hook call to the beginning
2022-04-19 02:09:11 +03:00
あく
c078bbcb0e
[FL-2428] region name in about (#1113) 2022-04-14 18:08:29 +03:00
Skorpionm
8cc3fd579c
SubGhz: Unit_test and bugfixes (#1104)
* SubGhz: CLI add "subghz decode_raw"
* SubGhz: unit_test
* SubGhz: add Hormann_hsm_raw unit_test
* SubGhz: fix duration raw
* Unit_test: fix total test timer
* SubGHz: fix name display scher_khan
* SubGhz: fix deviation protocol kia
* SubGhz: return max name length to previous value
* FuriHal: correctly handle mute in speaker
* UnitTests: fix grammar in subghz

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-04-14 15:49:29 +03:00
Georgii Surkov
917be9c6d3
[FL-2430] Automatic Desktop Locking (#1101)
* Add Auto Lock Time setting
* Update .gitignore
* Add value_index toolbox module
* Auto locking basic implementation
* Better AutoLock implementation, edge cases and cleanup
* Fix NULL pointer crash
* Turn off backlight shortly in locked mode
* Re-enable auto lock after pin lock
* Correctly handle start when pin locked
* Use timer to hide locked hint
* Use a single state variable instead of multiple bools
* Do not call update callback recursively
* Allow input when the Unlocked hint is shown
* Add a delay to backlight switch off while locking
* Better user input handling
* Switch backlight off after pin timeout
* Correct grammar in notification settings

Co-authored-by: あく <alleteam@gmail.com>
2022-04-14 15:20:41 +03:00
hedger
e02040107b
[FL-2263] Flasher service & RAM exec (#1006)
* WIP on stripping fw
* Compact FW build - use RAM_EXEC=1 COMPACT=1 DEBUG=0
* Fixed uninitialized storage struct; small fixes to compact fw
* Flasher srv w/mocked flash ops
* Fixed typos & accomodated FFF changes
* Alternative fw startup branch
* Working load & jmp to RAM fw
* +manifest processing for stage loader; + crc verification for stage payload
* Fixed questionable code & potential leaks
* Lowered screen update rate; added radio stack update stubs; working dfu write
* Console EP with manifest & stage validation
* Added microtar lib; minor ui fixes for updater
* Removed microtar
* Removed mtar #2
* Added a better version of microtar
* TAR archive api; LFS backup & restore core
* Recursive backup/restore
* LFS worker thread
* Added system apps to loader - not visible in UI; full update process with restarts
* Typo fix
* Dropped BL & f6; tooling for updater WIP
* Minor py fixes
* Minor fixes to make it build after merge
* Ported flash workaround from BL + fixed visuals
* Minor cleanup
* Chmod + loader app search fix
* Python linter fix
* Removed usb stuff & float read support for staged loader == -10% of binary size
* Added backup/restore & update pb requests
* Added stub impl to RPC for backup/restore/update commands
* Reworked TAR to use borrowed Storage api; slightly reduced build size by removing `static string`; hidden update-related RPC behind defines
* Moved backup&restore to storage
* Fixed new message types
* Backup/restore/update RPC impl
* Moved furi_hal_crc to LL; minor fixes
* CRC HAL rework to LL
* Purging STM HAL
* Brought back minimal DFU boot mode (no gui); additional crc state checks
* Added splash screen, BROKEN usb function
* Clock init rework WIP
* Stripped graphics from DFU mode
* Temp fix for unused static fun
* WIP update picker - broken!
* Fixed UI
* Bumping version
* Fixed RTC setup
* Backup to update folder instead of ext root
* Removed unused scenes & more usb remnants from staged loader
* CI updates
* Fixed update bundle name
* Temporary restored USB handler
* Attempt to prevent .text corruption
* Comments on how I spent this Saturday
* Added update file icon
* Documentation updates
* Moved common code to lib folder
* Storage: more unit tests
* Storage: blocking dir open, differentiate file and dir when freed.
* Major refactoring; added input processing to updater to allow retrying on failures (not very useful prob). Added API for extraction of thread return value
* Removed re-init check for manifest
* Changed low-level path manipulation to toolbox/path.h; makefile cleanup; tiny fix in lint.py
* Increased update worker stack size
* Text fixes in backup CLI
* Displaying number of update stages to run; removed timeout in handling errors
* Bumping version
* Added thread cleanup for spawner thread
* Updated build targets to exclude firmware bundle from 'ALL'
* Fixed makefile for update_package; skipping VCP init for update mode (ugly)
* Switched github build from ALL to update_package
* Added +x for dist_update.sh
* Cli: add total heap size to "free" command
* Moved (RAM) suffix to build version instead of git commit no.
* DFU comment
* Some fixes suggested by clang-tidy
* Fixed recursive PREFIX macro
* Makefile: gather all new rules in updater namespace. FuriHal: rename bootloader to boot, isr safe delays
* Github: correct build target name in firmware build
* FuriHal: move target switch to boot
* Makefile: fix firmware flash
* Furi, FuriHal: move kernel start to furi, early init
* Drop bootloader related stuff
* Drop cube. Drop bootloader linker script.
* Renamed update_hl, moved constants to #defines
* Moved update-related boot mode to separate bitfield
* Reworked updater cli to single entry point; fixed crash on tar cleanup
* Added Python replacement for dist shell scripts
* Linter fixes for dist.py +x
* Fixes for environment suffix
* Dropped bash scripts
* Added dirty build flag to version structure & interfaces
* Version string escapes
* Fixed flag logic in dist.py; added support for App instances being imported and not terminating the whole program
* Fixed fw address in ReadMe.md
* Rpc: fix crash on double screen start
* Return back original boot behavior and fix jump to system bootloader
* Cleanup code, add error sequence for RTC
* Update firmware readme
* FuriHal: drop boot, restructure RTC registers usage and add header register check
* Furi goes first
* Toolchain: add ccache support
* Renamed update bundle dir

Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-04-13 23:50:25 +03:00
Nikolay Minaylov
d635890342
[FL-2297, FL-2289] Power info command, Validator fixes (#1097)
* Power info command, validator fixes
* strdup in validator, fix memory leak
* furi_hal_crypto fixed again
* FuriHal: limit ARR and CC in speaker hal
* FuriHal: LL_TIM_DisableAllOutputs in speaker stop
* Rpc: fix memory leak in screen streaming
* Get rid of crypto_enable/crypto_disable

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-04-07 18:00:45 +03:00
Nikolay Minaylov
2f3ea9494e
HAL to LL migration: GPIO, HSEM, AES (#1069)
* gpio, hsem, crypto: switch from HAL to LL/registers
* Moved GPIO initialization to furi_hal
* More HAL removed
* All HAL modules disabled
* HAL is finally removed
* hal_gpio -> furi_hal_gpio, main.h removed
* Bootloader build fix
* RTOS config moved to freertos-glue
* delay -> furi_hal_delay

Co-authored-by: あく <alleteam@gmail.com>
2022-03-30 18:23:40 +03:00
あく
489caa8e77
[FL-2392] FuriHal: refactor interrupts subsystem (#1066)
* FuriHal: refactor interrupts subsystem

* Furi,FuriHal: gather all ISRs under interrupt API, improve crtitical section and cleanup garbage

* FuriHal: mirgate ipcc and hsem to LL

* Format Sources

* FuriHal,BleGlue: move to new critical section

* Format Sources

* FuriHal: correct flash locking

* FuriHal: replace critical section with interrupt disable in OS routine, minor fixex
2022-03-30 03:37:23 +10:00