1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 20:49:49 +04:00

Compare commits

...

1305 Commits

Author SHA1 Message Date
MX
fc6adcbeb1 WIP - Implement header(preambula) lookup
Bits = unknown
0 = unknown
1 = unknown
2023-02-15 00:42:28 +03:00
MX
842b497829 Show RSSI in weather station app and in pocsag pager app 2023-02-14 01:44:02 +03:00
MX
928d57b050 Small fixes and updates 2023-02-13 22:06:01 +03:00
MX
641934f8dd Update readme & changelog 2023-02-13 21:39:21 +03:00
MX
de07313173 Merge pull request #335 from assasinfil/nice-one
Nice one encoder
2023-02-13 21:11:03 +03:00
assasinfil
921db0bb22 Bugfix 2023-02-13 21:04:11 +03:00
MX
f93462667c Remove 467.75 From freq analyzer since it has too much noise
Frequency is still can be used, just excluded from FA to avoid false detections
2023-02-13 20:54:03 +03:00
assasinfil
c56eaae89d Data save fix 2023-02-13 20:49:39 +03:00
assasinfil
185bb3277a Test fix 2023-02-13 19:58:07 +03:00
MX
b5a60dc10b Merge branch 'fz-dev' into dev 2023-02-13 19:30:36 +03:00
MX
f4af57d15a Revert "Temp fix of broken ibutton emulation"
This reverts commit 1831902fbd.
2023-02-13 19:29:48 +03:00
MX
0abb88842a Merge pull request #334 from Willy-JL/last-filebrowser-fixes
(Hopefully) last filebrowser fixes
2023-02-13 19:18:47 +03:00
Nikolay Minaylov
bc06d407f3 [FL-3113] BadUSB: disable CDC mode, USB mode switch fix (#2394) 2023-02-14 00:43:29 +09:00
Willy-JL
cb89bb9628 Fix archive sorting (skip on big folders) 2023-02-13 14:54:23 +00:00
Willy-JL
fbf99d6cb3 Skip browser inputs while loading / sorting 2023-02-13 14:54:15 +00:00
hedger
d0c6c3402c Updater visual fixes (#2391)
* updater: removed unused code; fbt: fixed build error processing in certain cases
* updater: simplified internal pre-update state
* updater: rebalanced stage weights; fixed progress hiccups
2023-02-13 23:07:53 +09:00
Georgii Surkov
5a730e3adc [FL-3107] Fix Cyfral & Metakom emulation (#2392)
* Fix Cyfral & Metakom emulation

Co-authored-by: あく <alleteam@gmail.com>
2023-02-13 20:33:15 +09:00
WillyJL
628f089c42 Mark debug app as debug not external (#2387) 2023-02-13 13:10:36 +09:00
MX
3accc005e7 Fix message 2023-02-13 03:31:16 +03:00
MX
e08b10fa3c Send default build and extra pack in the end in case of tg faults 2023-02-13 02:54:12 +03:00
MX
9007f0e360 Send extra pack builds instead of default one to telegram 2023-02-13 02:31:04 +03:00
MX
8608ba01aa Update changelog 2023-02-13 00:53:40 +03:00
MX
3747f95d5a Fix external cc1101 module issues
SubGHz HAL fixes, by @Quen0n
2023-02-13 00:43:58 +03:00
MX
6c4334e7cb Rename functions and cleanup a bit 2023-02-13 00:41:50 +03:00
MX
d247eb43de Fbt format 2023-02-12 23:58:16 +03:00
MX
ca12057426 Fix large folders parsing 2023-02-12 23:55:39 +03:00
MX
8b22952dac Merge pull request #333 from ClaraCrazy/fix-filebrowser
Fix file browser update issues
2023-02-12 20:09:06 +03:00
MX
70af1e3bfb Merge branch 'dev' into fix-filebrowser 2023-02-12 20:04:00 +03:00
MX
896a78c645 Use 17 (1W) pin for subghz debug mode 2023-02-12 20:02:27 +03:00
Willy-JL
37b84a9dbb Remove unnecessary sarcastic comment 2023-02-12 12:28:40 +00:00
Willy-JL
5a2f693551 File browser load speed improvements (skip redraw) 2023-02-12 11:22:52 +00:00
Willy-JL
82f77edc70 Fix file browser back history 2023-02-12 11:22:37 +00:00
Willy-JL
80b8a0dddb Fix file browser clownage comment 2023-02-12 11:22:23 +00:00
MX
5d8acc2210 Update changelog 2023-02-12 05:06:42 +03:00
MX
e96bae8473 Merge pull request #327 from ClaraCrazy/dev
Update filebrowser
2023-02-12 03:00:00 +03:00
Willy-JL
89a07d3573 Merge branch 'dev' of https://github.com/ClaraCrazy/filebrowser-updates into dev 2023-02-11 23:49:45 +00:00
Willy-JL
fb4e2e02be Hide files in browser while still loading 2023-02-11 23:49:29 +00:00
MX
c1e2d2443a Merge branch 'dev' into filebrowser 2023-02-12 02:48:52 +03:00
MX
08acbda895 Allow 467.75 MHz by default 2023-02-12 02:48:20 +03:00
MX
02fad884fb Merge pull request #328 from jbohack/dev
added support for subghz pagers
2023-02-12 02:45:49 +03:00
Clara K
6f37c25bdb Merge pull request #1 from DarkFlippers/dev
SubGHz HAL Fixes
2023-02-12 00:45:07 +01:00
MX
27012b6be7 SubGHz HAL Fixes 2023-02-12 02:41:11 +03:00
assasinfil
d179199a42 Need fix 2023-02-12 00:01:43 +03:00
jbohack
73a9425f73 added the common pager frequency to the frequency list 2023-02-11 15:20:34 -05:00
jbohack
462836346e added pager modulation for restaurant pagers
credit to jimi for the modulation :)
2023-02-11 15:16:09 -05:00
MX
a4c28ed5bf Show internal memory only in DEBUG mode + other fixes
Remove unused imports and remove my old code that used to hide layouts and tmp history folders, this was removed in dev but somehow was added back here
2023-02-11 21:59:22 +03:00
MX
b8deb931c2 Merge branch 'dev' into filebrowser 2023-02-11 21:47:21 +03:00
MX
1831902fbd Temp fix of broken ibutton emulation
Reverted lib changes and added old api

TODO: Find what causes that issue, issue also present in official dev branch
2023-02-11 21:09:39 +03:00
Willy-JL
99b126f0ef Fix archive tab switch code 2023-02-11 17:34:43 +00:00
assasinfil
f388a7ecab Bit fix 2023-02-11 20:26:18 +03:00
assasinfil
92d55ec90f Fix 2023-02-11 20:09:36 +03:00
assasinfil
f86582b99e Fix 2023-02-11 20:09:01 +03:00
assasinfil
c2545a2f7b Encoder fix 2023-02-11 19:18:42 +03:00
MX
9d2297410e fbt format 2023-02-11 18:28:58 +03:00
VerstreuteSeele
371f3b3869 De-xtreme-ify the code 2023-02-11 16:13:49 +01:00
VerstreuteSeele
6b99999566 Update browser 2023-02-11 15:49:00 +01:00
Clara K
11f3464e1b Update archive_browser_view.h 2023-02-11 15:41:18 +01:00
Clara K
e5bef61364 Update archive_browser_view.c 2023-02-11 15:40:46 +01:00
Clara K
c0afbf659a Update archive_browser.h 2023-02-11 15:40:11 +01:00
Clara K
a6dc16a98c Add Internal Tab 2023-02-11 15:39:30 +01:00
MX
aa646c7590 Update changelog
add forgotten change
2023-02-11 04:53:56 +03:00
MX
416a6425de Disable New Year Animation 2023-02-11 04:33:47 +03:00
MX
24a4ae8014 Fix external module timings drift
TODO: Need to improve both modules timing accuracy
2023-02-11 03:57:31 +03:00
MX
7b4f1e5d26 Temp fix discord dev notifications 2023-02-11 03:17:39 +03:00
MX
ec2d0588df Merge pull request #324 from Bon-Jorik/patch-1
Add NFC keys
2023-02-11 03:06:04 +03:00
MX
433db87976 Update changelog 2023-02-11 03:05:38 +03:00
scaff.walker
0f2bf693c1 Update mf_classic_dict.nfc 2023-02-11 02:26:56 +03:00
scaff.walker
01f5167577 Update mf_classic_dict.nfc 2023-02-11 02:25:32 +03:00
scaff.walker
6a3f1cb9e4 Update mf_classic_dict.nfc 2023-02-11 02:20:52 +03:00
MX
56b4de7e5d Finally fix discord notifications 2023-02-11 02:07:42 +03:00
MX
285c324e8d Try to fix notification pt1 2023-02-11 01:27:02 +03:00
MX
4e0c2b99a9 testing with escape chars 2023-02-11 01:18:35 +03:00
MX
ac31be8db8 test discord webhook 2023-02-11 01:12:05 +03:00
scaff.walker
6e21e204ab Update mf_classic_dict.nfc 2023-02-11 00:30:49 +03:00
MX
2298cc1d7b Update readme and changelog 2023-02-10 23:48:52 +03:00
MX
81064f8e43 Alutech display text fixes 2023-02-10 23:32:49 +03:00
MX
db012807f5 Merge branch 'fz-dev' into dev 2023-02-10 22:53:51 +03:00
MX
bd2d7bf42f Small fixes 2023-02-10 22:48:35 +03:00
MX
e9df7c9b72 Merge pull request #322 from assasinfil/alutech_at_4n
Alutech at 4n
2023-02-10 22:33:04 +03:00
assasinfil
14331a197b Timeout after preambula fix 2023-02-10 21:52:13 +03:00
assasinfil
e40444b526 Iterators fix 2023-02-10 21:49:28 +03:00
assasinfil
0521bd4320 Encoder full realization 2023-02-10 21:42:07 +03:00
assasinfil
6871c2c142 Encoder fix 2023-02-10 20:34:27 +03:00
assasinfil
b79cac4473 Encoder completed with bad crc 2023-02-10 19:03:32 +03:00
MX
66ab192cd7 Merge pull request #321 from assasinfil/kinggates_stylo_4k
Kinggates stylo 4k
2023-02-10 16:52:36 +03:00
MX
2c22061580 Merge pull request #318 from amec0e/dev
Updated infrared assets
2023-02-10 16:52:07 +03:00
MX
97087fadb9 Merge pull request #316 from notmarek/dev
Fix CTRL-SHIFT in mousejacker
2023-02-10 16:51:51 +03:00
assasinfil
affef106ea Merge remote-tracking branch 'origin/dev' into alutech_at_4n 2023-02-10 16:38:27 +03:00
assasinfil
5cf4f5fab4 Cleanup 2023-02-10 16:32:30 +03:00
assasinfil
d9f6b02da5 Hop fix 2023-02-10 16:17:56 +03:00
assasinfil
a551317cc2 Encoder fix 2023-02-10 15:55:31 +03:00
Pierce
3eacb0c715 Fixed typo in nfc_magic_scene_wrong_card.c (#2382) 2023-02-10 21:52:53 +09:00
assasinfil
0e0046c803 Merge remote-tracking branch 'origin/dev' into kinggates_stylo_4k 2023-02-10 14:16:25 +03:00
MX
36f1283bb3 Fix: line was hidden under image in decode raw 2023-02-10 03:58:09 +03:00
MX
1b1f58408d SubGHz Decode Raw GUI fixes 2023-02-10 02:25:30 +03:00
MX
4e02ac3442 Fix external CC1101 support and internal module debug 2023-02-10 02:09:29 +03:00
MX
a098e0561e Temp fix
BUG: Now sound works but sending signal with sound on doesn't actually send signal!!!
Need to return previous implementation with 2 channel Timer or find another way
2023-02-10 00:56:29 +03:00
MX
175287ee0a Fix again 2023-02-09 23:56:36 +03:00
assasinfil
7d866fade1 Merge remote-tracking branch 'origin/dev' into kinggates_stylo_4k 2023-02-09 23:29:06 +03:00
MX
c5e225656d Throw in some copy pastas
temp solution, maybe not temp, maybe its forever
2023-02-09 23:25:00 +03:00
assasinfil
a49c8d5a08 Merge remote-tracking branch 'origin/dev' into kinggates_stylo_4k 2023-02-09 23:22:40 +03:00
MX
07093d072f Fix Debug pin 2023-02-09 23:21:36 +03:00
assasinfil
727c21d60a Merge branch 'dev' into kinggates_stylo_4k 2023-02-09 22:47:53 +03:00
assasinfil
2bd80f510a Init encoder 2023-02-09 22:45:02 +03:00
MX
fda38c9d04 Debug pin setting for subghz protocol development
When DEBUG is on in settings, you can turn on debug pin in radio settings now, DO NOT use it if you don't know what it is!!!!
2023-02-09 22:41:12 +03:00
MX
16a5b13be4 Max 55 signals Seems stable, setting it to 55 for now
Subghz history
2023-02-09 22:12:03 +03:00
assasinfil
05be200762 Hop len fix 2023-02-09 21:37:54 +03:00
assasinfil
b47174d206 Completed encoder 2023-02-09 21:26:10 +03:00
assasinfil
502e8d1d8d Small fix 2023-02-09 21:17:16 +03:00
assasinfil
5d6ce87259 Encoder fix 2023-02-09 19:06:41 +03:00
MX
1707a1d1a4 Update changelog 2023-02-09 18:58:04 +03:00
MX
7927fa371e Update readme 2023-02-09 18:25:46 +03:00
MX
ef2c668e31 Small GUI fixes
remove static line in subghz receiver because now we have RSSI line
2023-02-09 18:01:52 +03:00
MX
fe3862e113 Merge branch 'fz-dev' into dev 2023-02-09 17:52:59 +03:00
MX
539c4e2dd0 Fixes & imporvements
Use our custom icon for Bin RAW
2023-02-09 17:49:28 +03:00
MX
b9351649ed Merge branch 'fz-dev' into dev 2023-02-09 17:48:50 +03:00
MX
be33e099be Fix read raw GUI
Now showing internal or external module usage properly
2023-02-09 17:22:19 +03:00
MX
ba36f4672c Throw away Kostily & Velosipedy
Ne bag a ficha, bolshe ne nuzhna
2023-02-09 17:21:40 +03:00
Max Andreev
67c2d1cf61 Migrating CI/CD to Linode S3 (#2380)
* Test PVS linode S3
* Migrating to Linode S3
* Disable PVS action debug
* Fix pvs_studio.yml
2023-02-09 19:42:41 +09:00
assasinfil
e17877b6a1 Kinggates stylo 4k tx realization
Co-authored-by: MX <10697207+xMasterX@users.noreply.github.com>
2023-02-09 12:57:22 +03:00
Skorpionm
82c730b6be SubGhz: fix cc1101_read_fifo func (#2379) 2023-02-09 14:45:30 +09:00
Petr Portnov | PROgrm_JARvis
4265057ee8 feat: add missing const qualifiers (#2233)
* feat: make `ViewPort` getters const
* feat: make tx-buffers const
* feat: make `canvas_get_buffer_size` const
* feat: make `canvas` methods const
* feat: make `icon_animation` methods const
* feat: make `scene_manager` methods const
* feat: make `loader` method const
* feat: make `canvas_get_font_params` const

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-09 13:58:01 +09:00
Skorpionm
163be139eb SubGhz: add protocol BinRAW (binarization of data quantized by the minimum correlated duration) (#2322)
* SubGhz: add protocol DataRAW (binarization of data quantized by the minimum correlated duration)
* SubGhz: fix name history
* SubGhz: add encoder Data_RAW protocol
* SubGhz: decreasing the size of the LevelDuration structure
* SubGhz: history, added check that there is free RAM
* SubGhz: checking for free memory, support to pass without gap
* SubGhz: add running average to average the result, auto cut noise at the end of a burst
* SubGhz: support for repeating sequences
* SubGhz: fix secplus_v2 decoder
* SubGhz: bin_RAW fix add history
* SubGhz: add debug
* SubGhz: debug refactoring
* FURI_LOG: add FURI_LOG_RAW_x formatted string output like printf
* SubGhz: fix new FURI_LOG metod
* FURI_LOG: fix unit test
* SubGhz: add enable/disable BinRAW protocol decoding
* SubGhz: fix PVS
* SubGhz: forcibly turn off the speaker when exiting SubGhz
* SubGhz: adaptive adjustment to the noise level

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-09 13:48:06 +09:00
Patrick Cunningham
71871949ec Picopass: show elite key used from dictionary (#2119)
* show elite key used from dictionary
* remove space so it fits on screen

Co-authored-by: あく <alleteam@gmail.com>
2023-02-09 12:47:16 +09:00
Victor Nikitchuk
d7ecc95de4 Firmware fixes and improvements for flashing via blackmagic (#2321)
Co-authored-by: quen0n <quen0n@github.com>
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2023-02-09 12:40:04 +09:00
MX
a7a4f9b885 SubGhz hal fixes 2023-02-08 23:31:27 +03:00
MX
eaffe0ec17 Fix small bugs 2023-02-08 21:45:23 +03:00
MX
3890c7f9fa Merge branch 'fz-dev' into dev 2023-02-08 21:26:56 +03:00
MX
6f44900e05 Update API symbols 2023-02-08 21:24:21 +03:00
hedger
a005087636 fbt: building fap_dist for compact gh build; accessor: fixed for latest ibutton changes (#2377)
* fbt: building fap_dist as default target; accessor: fixed for latest ibutton changes
* fbt: not building fap_dist as default target; github: doing fap_dist for compact builds

Co-authored-by: あく <alleteam@gmail.com>
2023-02-09 03:16:05 +09:00
Eric Betts
8f2f2d810a Move CSN space to revent overflow (#2232)
Co-authored-by: あく <alleteam@gmail.com>
2023-02-09 03:06:42 +09:00
MX
d02c586b92 Merge branch 'fz-dev' into dev 2023-02-08 21:05:17 +03:00
MX
ed78c4ca04 Fixes 2023-02-08 20:49:06 +03:00
Skorpionm
db1a8f8014 [FL-3099] SubGhz: add protocol KingGates Stylo4k (#2368)
* [FL-3099] SubGhz: add protocol KingGates Stylo4k
* SubGhz: add unit test file
* f7: api: reverted symbols

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-09 02:47:39 +09:00
amec0e
6c517d5030 Updated tv.ir
Updated last checked
2023-02-08 17:44:15 +00:00
amec0e
575cce48af Updated projectors.ir
New additions
2023-02-08 17:43:39 +00:00
amec0e
4de21410b7 Updated fans.ir
New additions
2023-02-08 17:43:06 +00:00
amec0e
f0c3cde2f3 Updated audio.ir
New additions
2023-02-08 17:42:37 +00:00
amec0e
3993f2b89c Update ac.ir
Updated last Checked
2023-02-08 17:40:46 +00:00
itsweekly
39841bd5a9 Universal Projector Remote (#2343)
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-02-09 02:28:34 +09:00
MX
2006bd1c95 Add linear delta 3 support to bruteforcer 2023-02-08 20:21:15 +03:00
Skorpionm
bf4d00a7d1 [FL-3100] SubGhz: add protocol Nice One (#2358)
* SubGhz: add protocol Nice One
* SubGhz: fix annotation
* SubGhz: add unit test

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-09 02:20:28 +09:00
MX
bbc1ba62fc Merge branch 'fz-dev' into dev 2023-02-08 20:12:10 +03:00
Skorpionm
31259d5304 [FL-3091] SubGhz: add protocol Alutech at-4n (#2352)
* GubGhz: add protocol Alutech at-4n
* SubGhz: fix syntax
* SubGhz: fix subghz_protocol_decoder_alutech_at_4n_get_hash_data
* SubGhz: add unit test alutech at-4n
* SubGhz: add name key

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-09 01:59:49 +09:00
Skorpionm
0afc4a8982 [FL-3092] SubGhz: add DOOYA protocol (#2178)
* SubGhz: add DOOYA protocol
* SubGhz: add unit_test DOOYA protocol
* SubGhz: fix protocol Dooya

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-09 01:37:24 +09:00
MX
c8cf3e41a7 Fix that sound switcher was not present in read raw 2023-02-08 18:48:28 +03:00
Brandon Weeks
8288a08eb3 SubGhz: add protocol "Linear Delta-3" (#2239)
* SubGhz: add protocol "Linear Delta-3"
* SubGhz: fix Leniar Delta 3
* BadUSB: mask pvs studio warning for valid code

Co-authored-by: SkorP <skorpionm@yandex.ru>
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: Skorpionm <85568270+Skorpionm@users.noreply.github.com>
2023-02-09 00:26:45 +09:00
MX
985e9f3d74 Merge branch 'fz-dev' into dev 2023-02-08 18:20:37 +03:00
MX
b1f581239b BadUSB: Keyboard Layouts (#2256)
* BadUSB: Keyboard Layouts
* Apply requested changes pt1
* Add layout file check when we loading config

Co-authored-by: Nikolay Minaylov <nm29719@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-02-09 00:01:00 +09:00
MX
d6d7a5ece2 Fix merge issue 2023-02-08 17:48:07 +03:00
MX
0dccbe28bb Merge branch 'fz-dev' into dev 2023-02-08 17:15:17 +03:00
Skorpionm
99253a0e28 [FL-3093, FL-3087] SubGhz: Fix Raw write, add short duration filter setting (#2300)
* SubGhz: Fix recording RAW files, sometimes could not start at a high level
* SubGhz:  subghz_worker, add short duration filter setting
* SubGhz: capture raw timings in cli. Furi: clear pending interrupts on ISR set/reset
* SubGhz: fix start  duration in furi_hal_subghz_start_async_rx
* [FL-3093] SubGhz: hopping issue in some regions
* [FL-3087] SubGhz: fix delete-ok issue
* SubGhz: remove copypasta from rx_raw cli command

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-08 22:20:42 +09:00
MX
30081b79c4 Mirror my changes to badusb layouts from PR 2023-02-08 16:10:47 +03:00
MX
e31e880264 Merge branch 'fz-dev' into dev 2023-02-08 15:26:23 +03:00
あく
cee9b640b3 Update Missing SD Card icon from PR 2373 (#2376) 2023-02-08 15:45:33 +04:00
あく
20f98050f2 Github: disable f18 build (#2375) 2023-02-08 13:38:09 +03:00
MX
cdfd9891b7 Fix debug accessor app 2023-02-08 12:57:23 +03:00
MX
468d0ea966 Merge branch 'fz-dev' into dev 2023-02-08 12:43:07 +03:00
Michal Suchánek
00076deece SCons: do not include backup files in build (#2221)
* SCons: do not include backup files in build
* fbt: now GlobRecursive by default excludes backup files
* fbt: added backup file exclusion to plain libs

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: あく <alleteam@gmail.com>
2023-02-08 18:35:38 +09:00
LTVA1
23ecc186c2 Custom font set function (#2261)
* custom font set function
* update API symbols
* add example of custom font usage
* delete u8g2 dependency in example custom font
* rename to canvas_set_custom_u8g2_font
* now change the name in ALL places

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2023-02-08 18:26:17 +09:00
MX
b7c2b9eff1 Change API version back 2023-02-08 12:23:04 +03:00
MX
81316255f9 Fix after merge issues pt1 2023-02-08 12:22:11 +03:00
MX
6c768f2019 Merge branch 'fz-dev' into dev 2023-02-08 12:09:57 +03:00
Liam Hays
111c7557b3 Fix minor UI inconsistencies and bugs (#2361)
* Changed blue LED to cyan in NFC Magic and Picopass apps.
* Fix capitalization of ATQA and UID in NFC Add Manually wizard.
* Fix reselection of "Saved" menu item in NFC and RFID apps.
* Fix double back press after deleting a file in the SubGhz browser.
* Make NFC app behave like other apps: return to the file browser after deleting a file.
* Rename NfcSceneSetAtqua to NfcSceneSetAtqa.
* Save selected menu items in NFC Magic and Picopass apps in a way that always works.
* Restore previous selection in Universal Remotes menu.
* Other way to do universal remote menu saving, and NFC Extra Actions saves last selection.

Co-authored-by: あく <alleteam@gmail.com>
2023-02-08 17:08:50 +09:00
Georgii Surkov
7a3a1aaf0d [FL-3057] Allow use of any suitable pin for 1-Wire devices (#2350)
* Add 1-wire thermometer example app stub
* Working 1-wire thermometer app
* Refactor app to use threads
* Clean up code, add comments
* Add CRC checking
* Increase update period
* Fix error in fbt
* Revert the old update period
* Use settable pin in onewire_host
* Use settable pin for onewire_slave
* Clear EXTI flag after callback, make private methods static in onewire_slave
* Do not hardcode GPIO pin number
* Remove iButton hal from furi_hal_rfid
* Remove most of furi_hal_ibutton
* Add some of furi_hal_ibutton back
* Slightly neater code
* Fix formatting
* Fix PVS-studio warnings
* Update CODEOWNERS
* Add furi_hal_gpio_get_ext_pin_number
* Create README.md
* FuriHal: move furi_hal_gpio_get_ext_pin_number to resources

---------

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-08 14:40:44 +09:00
Sergey Gavrilov
e3d473bf42 [FL-2435] SD over SPI improvements (#2204)
* get rid of BSP layer
* sector_cache: init in any case
* new sd-spi driver: init
* Delete stm32_adafruit_sd.c.old
* Delete spi_sd_hal.c.old
* Storage: faster api lock primitive
* Threads: priority control
* Flags: correct error code
* Spi: dma mode
* SD-card: use DMA for big blocks of SPI data
* Fix wrong SD_TOKEN_START_DATA_MULTIPLE_BLOCK_WRITE value
* do not memset cache if it is NULL
* remove top-level timeouts
* sd hal: disable debug
* Furi HAL: DMA
* Furi HAL RFID: use furi_hal_dma
* Furi HAL DMA: tests
* Furi HAL DMA: docs
* rollback "Furi HAL RFID: use furi_hal_dma"
* 4 channels taken from DMA manager for core HAL.
* Furi HAL DMA: live fast, die young
* RPC tests: increase message buffer
* SPI HAL: use second DMA instance
* sd hal: new CID getter
* SPI hal: use non-DMA version if kernel is not running
* IR hal: generalize DMA definition
* storage: add CID data to sd info
* RFID hal: generalize DMA definition
* SUBGHZ hal: generalize DMA definition. Core hal moved to DMA2.
* Storage: small optimizations, removal of extra mutex
* Storage: redundant macro
* SD hal: more timeouts
* SPI hal: DMA init
* Target: make furi_hal_spi_dma_init symbol private
* Update F18 api symbols

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-08 13:41:22 +09:00
hedger
224d0aefe4 [FL-2733] multitarget support for fbt (#2209)
* First part of multitarget porting
* Delete firmware/targets/f7/Inc directory
* Delete firmware/targets/f7/Src directory
* gpio: cli fixes; about: using version from HAL
* sdk: path fixes
* gui: include fixes
* applications: more include fixes
* gpio: ported to new apis
* hal: introduced furi_hal_target_hw.h; libs: added one_wire
* hal: f18 target
* github: also build f18 by default
* typo fix
* fbt: removed extra checks on app list
* api: explicitly bundling select mlib headers with sdk
* hal: f18: changed INPUT_DEBOUNCE_TICKS to match f7
* cleaned up commented out code
* docs: added info on hw targets
* docs: targets: formatting fixes
* f18: fixed link error
* f18: fixed API version to match f7
* docs: hardware: minor wording fixes
* faploader: added fw target check
* docs: typo fixes
* github: not building komi target by default
* fbt: support for `targets` field for built-in apps
* github: reworked build flow to exclude app_set; fbt: removed komi-specific appset; added additional target buildset check
* github: fixed build; nfc: fixed pvs warnings
* attempt to fix target id
* f7, f18: removed certain HAL function from public API
* apps: debug: enabled bt_debug_app for f18
* Targets: backport input pins configuration routine from F7 to F18

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-08 01:33:05 +09:00
MX
e4c9568867 Merge branch 'fz-dev' into dev 2023-02-07 18:37:30 +03:00
MX
0ee04fb968 Merge branch 'fz-dev' into dev 2023-02-07 18:36:02 +03:00
あく
1eda913367 [FL-3075] Pin Reset (#2367)
* Nfc: fix PVS warnings
* Factory reset combo, initial version
* Recovery screen and correct input pin initialization
* Better pin and factory reset message
* Down to cancel factory reset
2023-02-08 01:35:49 +10:00
Marek Veselý
3df5a99968 Fix CTRL-SHIFT in mousejacker 2023-02-07 15:56:02 +01:00
Krzysztof Zdulski
d035872cf6 nfc: Add mifare classic value block commands (#2317)
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-02-07 12:21:25 +09:00
Round-Pi
1ff5843ee6 battery info temperature shown in C or F based on settings (#2360)
* battery Info temperature displays C or F
* PowerSettings: add locale module to dependencies

Co-authored-by: あく <alleteam@gmail.com>
2023-02-07 12:05:52 +09:00
MX
f116e8165f Merge branch 'fz-dev' into dev 2023-02-06 22:46:17 +03:00
Wild Rat
147f42a2b7 Add Daikin FTXM20M & Mitsubishi SRK63HE (#2349)
Co-authored-by: あく <alleteam@gmail.com>
2023-02-07 00:49:34 +09:00
nas
79d45c97f9 AleX83Xpert/add f keys to keyboard layout (#2362)
* Assets: png images for F1..F12 keys: Will be used for HID keyboard layout
* HID KEYBOARD F1..F12 keys were added
  - a new row with functional keys was added
  - logic for displaying the keyboard layout was improved
* HidApp: hid functional keys by default

Co-authored-by: あく <alleteam@gmail.com>
2023-02-07 00:24:05 +09:00
Sergey Gavrilov
6e179bda1f Script that can find programmer and flash firmware via it. (#2193)
* Init
* Fallback to networked interface
* remove unneeded cmsis_dap_backend
* serial number
* windows :(
* remove jlink, fix path handling
* scripts: program: path normalization
* scripts: program: path normalization: second encounter

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: あく <alleteam@gmail.com>
2023-02-06 23:56:36 +09:00
Max Andreev
9f279ac872 [FL-2744] SPI Mem Manager C port (#1860)
Co-authored-by: あく <alleteam@gmail.com>
2023-02-06 23:03:29 +09:00
MX
72f250195c Playing games now affect Flipper's level
All games now will increase flipper's level when you start them or win in some of them

Games with endless play like tetris or flappy bird has no winning logic so they will increase level only when you start them
2023-02-05 15:39:10 +03:00
MX
246dcdb23f Merge pull request #311 from Round-Pi/from-upstream
battery info temperature shown in C or F based on settings
2023-02-05 02:47:19 +03:00
Cathy Nguyen
683b5cdc82 battery info temperature shown in inp/metric units 2023-02-04 16:17:18 -05:00
MX
92135f8f06 update readme 2023-02-04 17:53:07 +03:00
MX
771dc95a44 Update changelog 2023-02-04 17:38:09 +03:00
MX
cc8066d9a0 ???
for some reason fbt says it should be removed
need to find why it differs from ofw
2023-02-04 16:09:40 +03:00
MX
bbe55aa9d6 Change example custom font app type to DEBUG
so it will not be compiled in release builds
2023-02-04 15:54:18 +03:00
MX
5a7d6fcc63 Update readme 2023-02-04 01:21:09 +03:00
MX
66e606fe96 upd submodule 2023-02-03 23:48:18 +03:00
MX
425f8f0254 Merge branch 'fz-dev' into dev 2023-02-03 23:45:57 +03:00
あく
52680fd14e FreeRTOS: update to 10.5.1 (#2353) 2023-02-04 04:09:20 +10:00
MX
559c4567cb Rename: Radio settings -> Radio Settings 2023-02-03 17:43:17 +03:00
MX
8c50225da4 Fix issue with external module settings
It was possible to set it to external module without module connected, and as it saves its state in memory, all other plugins that uses subghz will not work, now we checking for module when you changing that setting
2023-02-03 17:20:10 +03:00
MX
edddfbcb2c Merge pull request #307 from quen0n/ext_cc1101
External CC1101 support
2023-02-03 15:44:57 +03:00
MX
bfbcce030c Fix GUI issues
Fix secplus v1 text too
2023-02-03 15:39:02 +03:00
Victor
5458157924 Added external CC1101 support 2023-02-02 22:47:50 +03:00
MX
7edf90c2e5 Merge branch 'fz-dev' into dev 2023-02-02 18:28:52 +03:00
AloneLiberty
46fb86265c NFC: fix creating MF Classic tags from "Add Manually" menu (BCC calulation and ATQA/SAK writing) (#2342)
* NFC: fix creating MF Classic cards from "Add Manually" menu (BCC calculation and AQTA/SAK writing)
* NFC: Fix BCC/SAK/ATQA in unit_tests and SAK in nfc_generate_mf_classic

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2023-02-02 22:18:39 +07:00
MX
52bcf27c2a Update readme
Clock uses system locale settings
2023-02-02 15:12:35 +03:00
MX
3c52dca0c2 Fix mouse jiggler merge issue 2023-02-02 14:31:03 +03:00
MX
ed4b2b3362 Merge remote-tracking branch 'LTVA1/patch-custom-font' into dev 2023-02-02 14:27:17 +03:00
MX
b05cba931b Update UniTemp
https://github.com/quen0n/unitemp-flipperzero/tree/master
2023-02-02 14:01:23 +03:00
MX
1d46df70a9 Update ProtoView
https://github.com/antirez/protoview
2023-02-02 13:54:14 +03:00
MX
f45f2a45da Remove invalid keys from mf classic dict 2023-02-02 13:46:53 +03:00
MX
a0d5aa0c7b Merge pull request #303 from DocKuro/mouse_jiggler_interval_selction_added
Added movement interval in mouse_jiggler USB & BLE
2023-02-02 13:38:34 +03:00
Emanuele Conti
cee11464de Merge branch 'mouse_jiggler_interval_selction_added' of https://github.com/DocKuro/unleashed-firmware into mouse_jiggler_interval_selction_added 2023-02-02 10:33:54 +00:00
Emanuele Conti
a617ce1813 used FuriString instead of string_t 2023-02-02 10:32:07 +00:00
MX
05641378d9 Fixed 2023-02-02 13:20:58 +03:00
MX
fbe7209817 Use FuriString instead of string_t 2023-02-02 13:16:00 +03:00
MX
c630e351fc Merge branch 'dev' into mouse_jiggler_interval_selction_added 2023-02-02 12:56:43 +03:00
MX
26b5b7e406 Merge pull request #305 from teeebor/feature/solitaire-and-blackjack-flipper-score
Solitaire and Blackjack now affect Flipper's level
2023-02-02 12:55:00 +03:00
MX
d94caf0ba6 Merge pull request #306 from amec0e/dev
Updated infrared assets + InfraredCaptures Documentation
2023-02-02 12:47:48 +03:00
MX
16f8f2c2df Merge branch 'fz-dev' into dev 2023-02-02 11:54:20 +03:00
amec0e
989442eab6 Updated fans.ir
Removed 2 temp entries as it does not adjust fan speed.
2023-01-31 17:20:23 +00:00
amec0e
ab452bd575 Updated InfraredCaptures.md
Adjusted formatting
2023-01-31 15:27:48 +00:00
amec0e
cbabd46a4d Updated InfraredCaptures.md 2023-01-31 15:25:54 +00:00
amec0e
743ee7b990 Added InfraredCaptures.md
This should help users to capture correct raw capture data for ACs, and also help them to get the best raw capture available for other infrared assets
2023-01-31 15:22:49 +00:00
amec0e
d91dc04585 Updated tv.ir
updated last checked
2023-01-31 15:09:31 +00:00
amec0e
e6f7e3a37e Updated projectors.ir 2023-01-31 15:09:01 +00:00
amec0e
2929b12134 Updated fans.ir 2023-01-31 15:08:39 +00:00
amec0e
3985cb61c8 Updated audio.ir 2023-01-31 15:08:17 +00:00
amec0e
376e45a09d Updated ac.ir
Updated last checked
2023-01-31 15:07:50 +00:00
hedger
fcd3799aee Merge branch 'dev' into patch-custom-font 2023-01-31 15:05:53 +07:00
LTVA1
dfd46f5539 fix formatting 2023-01-30 15:11:32 +03:00
Giacomo Ferretti
01a9854f8a Documentation: add BadUSB GUI-CTRL #2347 2023-01-30 16:49:51 +07:00
Michal Suchánek
d9be815889 Print card CID in storage info (#2227) 2023-01-30 16:14:30 +07:00
Konstantin Volkov
7f3ebcd110 Changed bench target, stlink serial and added error for testing the run (#2275)
* changed bench target, stlink serial and added error for testing the run
* changed flipper name for macos and changed serial aquisition for device manager
* tested broken pipeline, reverting test data
* added timeout-minutes, testing if its int or float

Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-30 15:59:45 +07:00
あく
bf2ab1f4d5 Merge branch 'dev' into patch-custom-font 2023-01-30 15:30:54 +07:00
Noam Drong
5db7fdf985 Add support for GUI-CTRL in bad_usb (#2315)
Co-authored-by: あく <alleteam@gmail.com>
2023-01-30 15:03:10 +07:00
Milk-Cool
b1496ee9bd Furi: getter for current thread stdout write callback (#2344) 2023-01-30 14:54:15 +07:00
Tibor Tálosi
cd29fb8568 solitaire and blackjack now affect flippers level 2023-01-29 20:08:42 +01:00
Angel
a8e5f22500 LF-RFID: add CRC calculation to paradox protocol (#2299)
Co-authored-by: Angel <angel@Zoomies>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-29 18:23:45 +07:00
Skorpionm
e12958d408 [FL-3082] WS: add protocol LaCrosse-TX (TFA Dostmann) (#2292)
* WS:  add protocol LaCrosse-TX  (TFA Dostmann)
* WS: fix syntax
* WS: fix MSG_TYPE
* WS: fix PVS

Co-authored-by: あく <alleteam@gmail.com>
2023-01-29 18:08:26 +07:00
DEXV
55054fc1a7 Assets: correct MicroSD card pinout in service animations (#2323)
* New Micro Sd-Card pinout: fixing the Micro Sd-Card pinout for the blocking an internal sd card animations
* Updating the sd card pinout
* Updating magnifying glass
2023-01-29 17:55:04 +07:00
Petr Portnov | PROgrm_JARvis
f5fe0ff694 Furi: make furi_is_irq_context public (#2276)
* Furi: make `furi_is_irq_context` public
* Furi: proper name and documentation for furi_kernel_is_irq_or_masked.
* Target: bump symbol table version
* Furi: proper doxygen context for warnings

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-01-29 17:12:24 +07:00
Krzysztof Zdulski
d93ed003fe Change camelCase to PascalCase in code style (#2329)
Co-authored-by: あく <alleteam@gmail.com>
2023-01-29 12:53:35 +07:00
Emily Trau
24a23e5dc7 debug apps: made runnable as .faps; sdk: resolved additional APIs in use by faps (#2333)
* sdk: resolve additional APIs in use by faps
* debug tools: fixed battery_test, bt_debug, display_test, rpc_debug

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-27 16:41:55 +07:00
Giacomo Ferretti
126a9efd09 NFC: change from int8_t to uint8_t (#2302)
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-27 15:21:52 +07:00
Giacomo Ferretti
eee5c35400 NFC: add MIFARE MINI support (#2307)
* NFC: add MIFARE MINI support
* Move new value to end of enum
* nfc: added missing unit test

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-27 12:51:47 +07:00
Emily Trau
4dc4d34d04 emv: parse track1&2 equivalent data (#2332)
* emv: parse track1&2 equivalent data
* emv: alternate expiry parser
* nfc: log EMV track1&2 data to trace output

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-27 12:10:08 +07:00
Krzysztof Zdulski
8fc834090d nfc: Fix sector reads when one block is unreadable for MIFARE Classic (#2296)
* Fix sector reads when one block is unreadable
* Auth on the correct block instead of first
* Fix in sector reader as well
* Apply patch by @gornekich

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-27 12:00:25 +07:00
Emanuele Conti
a5d92d7a08 Used array lenght to hide right arrow 2023-01-26 15:00:34 +00:00
Emanuele Conti
884a751ae7 Fixed max array size check 2023-01-26 14:55:15 +00:00
Emanuele Conti
411855ce81 Added movement interval in mouse_jiggler USB & BLE 2023-01-26 14:31:54 +00:00
Krzysztof Haładyn (krzys_h)
5134f44c09 nfc: Fix crash when using debug PCAP trace (#2338) 2023-01-26 15:28:36 +07:00
LTVA1
f4cb458391 now change the name in ALL places 2023-01-25 08:52:51 +03:00
LTVA1
34ff250eea rename to canvas_set_custom_u8g2_font 2023-01-25 08:18:32 +03:00
Sergey Gavrilov
709fa633ff ELF-loader: wait for notification to complete on app exit (#2335) 2023-01-25 12:15:01 +07:00
MX
898b29b921 Fix SubGHz GUI receiver bug
When keyboard is locked and popup appears it now shows bottom text correctly
2023-01-21 10:45:10 +03:00
MX
f3939a715a Update Protoview
https://github.com/antirez/protoview
2023-01-20 07:11:00 +03:00
MX
3174d29dfa Update protoview 2023-01-19 20:28:02 +03:00
MX
e4fd3b1b0f Update changelog and readme 2023-01-19 20:26:26 +03:00
MX
856c8a1784 Merge pull request #298 from amec0e/dev
Updated infrared assets
2023-01-19 20:13:02 +03:00
MX
f0015fcf3b Merge pull request #297 from assasinfil/somfy_keytis
Somfy keytis
2023-01-19 20:12:31 +03:00
amec0e
42fc209c63 Updated tv.ir 2023-01-19 17:07:17 +00:00
amec0e
2aafc207c0 Updated projectors.ir
Updated last checked
2023-01-19 17:06:58 +00:00
amec0e
ecb0e5c520 Updated fans.ir 2023-01-19 17:06:13 +00:00
amec0e
c875aca468 Updated audio.ir 2023-01-19 17:05:50 +00:00
amec0e
80a778e4cb Updated ac.ir
Updated last checked
2023-01-19 17:05:30 +00:00
MX
792b035cac Not bumping api version 2023-01-19 20:03:02 +03:00
MX
e07b96e04b Merge branch 'dev' into somfy_keytis 2023-01-19 20:02:18 +03:00
assasinfil
7f08b25928 Inter-frame fix 2023-01-19 19:51:15 +03:00
MX
f8cc914a15 Change default hopping frequency list
Change it to use only most common frequencies
2023-01-19 18:14:05 +03:00
assasinfil
c6e30a1ed9 Inter-frame timeout fix 2023-01-19 18:04:03 +03:00
MX
5853e0bdd9 Block usage of hopping with detect raw at same time
Enough, it will not be enabled back, do not ask for it, its efficiency is almost 0, if you didn’t know it looses signals and all that you can capture is a micro part of end of the signal

Detect raw also will be removed in a future (and replaced with more correct solution)
2023-01-19 16:27:07 +03:00
assasinfil
3dd76f5c2f Added somfy keytis encoder 2023-01-19 14:49:00 +03:00
MX
59bcad0cfc Remove protoview binaries 2023-01-19 01:19:21 +03:00
MX
034a436ae0 Update changelog 2023-01-19 00:54:02 +03:00
MX
c303b44f3f Disable debug messages in protoview 2023-01-18 23:24:35 +03:00
MX
6e1875f285 Remove New Year update slideshow 2023-01-18 22:53:22 +03:00
MX
5a9da13d84 Update UniTemp and run fbt format 2023-01-18 22:25:39 +03:00
MX
e4aad248cf Update changelog and readme 2023-01-18 22:24:16 +03:00
MX
0650178946 Fixed and improved WAV Player by LTVA1
https://github.com/LTVA1/wav_player
2023-01-18 21:17:53 +03:00
MX
6aad6840f6 Add protoview
https://github.com/antirez/protoview
2023-01-18 20:18:19 +03:00
MX
7aaecd9278 Add text viewer 2023-01-18 20:05:01 +03:00
MX
b52674607a Add UART Terminal app
by cool4uma

https://github.com/cool4uma/UART_Terminal/tree/main
2023-01-18 19:55:46 +03:00
MX
adfac7affb Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-01-18 19:52:33 +03:00
MX
7a211e0018 Update UniTemp
https://github.com/quen0n/unitemp-flipperzero/tree/dev
2023-01-18 19:51:10 +03:00
MX
62b287aac7 Update links 2023-01-18 19:33:01 +03:00
MX
fb39d6e679 Format code 2023-01-18 19:19:49 +03:00
MX
b02a60f223 Merge pull request #289 from TQMatvey/somfy_encoder_new
Somfy telis encoder
2023-01-18 19:18:20 +03:00
MX
0b92e5ae74 Fix various issues 2023-01-18 19:16:20 +03:00
MX
27826f95ca Merge branch 'dev' into somfy_encoder_new 2023-01-18 19:01:22 +03:00
MX
24c12ab852 Merge pull request #278 from Fasjeit/dev
New battery display (Bar %)
2023-01-18 18:56:33 +03:00
MX
959ea4d8c1 Merge branch 'dev' into batt-ui 2023-01-18 18:40:15 +03:00
MX
7f09f5f616 Merge pull request #273 from darmiel/feat/playlist
feat[infrared]: allow disabling automatic signal decoding
2023-01-18 18:29:30 +03:00
MX
dfe141c78f Merge pull request #282 from amec0e/dev
Updated Infrared Assets
2023-01-18 18:28:19 +03:00
MX
dce2271330 Merge pull request #288 from Smileycathy1128/master
Oh boy 12AM!
2023-01-18 18:28:04 +03:00
MX
c708a301f5 Merge branch 'fz-dev' into dev 2023-01-18 18:26:49 +03:00
MX
927fcca081 Revert "Merge pull request #252 from X-Stuff/dev-advanced-config"
This reverts commit ed5b2da9ad.
2023-01-18 18:18:17 +03:00
MX
db16b3ef1d Revert infrared hotfix 2023-01-18 18:15:30 +03:00
assasinfil
379807423f Debug prints cleanup 2023-01-18 16:21:42 +03:00
assasinfil
8c94e3e78d Remove bad folder 2023-01-18 15:15:02 +03:00
assasinfil
5123fac5d9 Full realization 2023-01-18 15:11:32 +03:00
assasinfil
cd5596027f Fixed 2023-01-18 14:57:30 +03:00
Cathy Nguyen
374452796c fix 00AM: Flipper may be Zero, but midnight isn't 2023-01-17 23:41:13 -05:00
hedger
a0814aab31 [FL-3081] fbt: removed DEBUG_TOOLS & FAP_EXAMPLES flags (#2291)
* fbt: deprecated DEBUG_TOOLS & FAP_EXAMPLES flags
* fixes for PVS warnings
* scripts: fbt: fixed leaking PYTHONHOME
2023-01-17 18:07:47 +03:00
hedger
341610b8a1 [FL-3080] fbt: PVS support (#2286)
* fbt: added firmware_pvscheck & firmware_pvs targets for *nix
* fbt: pvs support on Windows
* fbt: additional fixes & docs for PVS support
* fbt: fixes for updater env configuration
* github: reworked pvs workflow
* vscode: added PVS shortcut
* pvs: added --ignore-ccache flag
* fbt: pvs: opening web browser if there are warnings
* fbt: pvs: added browser handler for mac
* github: fixed report path for PVS
* fbt: pvs: fixed report upload path
* removed intentional PVS warning
* fixed more PVS warnings
* fixed secplus_v1 PVS warning
* fbt: added PVSNOBROWSER flag
* github: setting PVSNOBROWSER for pvs runs
* fbt: less debug output

Co-authored-by: あく <alleteam@gmail.com>
2023-01-17 15:55:49 +03:00
assasinfil
414a13131a Fix v2? 2023-01-17 13:41:41 +03:00
assasinfil
08acfa50c0 Fix? 2023-01-17 00:36:18 +03:00
assasinfil
75c47a8d64 Full package data 2023-01-17 00:06:00 +03:00
LTVA1
6aeb9478aa Revert "the MINE formatting"
This reverts commit 13acdf00da.
2023-01-16 20:19:00 +03:00
TQMatvey
f41c06ab74 somfy telis: not done yet
Co-authored-by: assasinfil <nfa57643@gmail.com>
2023-01-16 22:10:16 +07:00
assasinfil
5f82732b4f Completed encoder 2023-01-16 16:40:12 +03:00
assasinfil
ddc5540eeb Clean 2023-01-16 15:50:45 +03:00
TQMatvey
729a1b5788 somfy_telis: encoder is almost done
Co-authored-by: assasinfil <nfa57643@gmail.com>
2023-01-16 19:41:16 +07:00
Eric Betts
9e1a6a6d2e relocate R_ARM_CALL (#2305) 2023-01-16 12:36:59 +03:00
LTVA1
13acdf00da the MINE formatting 2023-01-16 12:10:32 +03:00
amec0e
d50418e839 Updated projectors.ir 2023-01-13 18:17:47 +00:00
amec0e
682d2d9b6f Updated tv.ir 2023-01-13 17:38:53 +00:00
amec0e
deaf80fddc Updated projectors.ir 2023-01-13 17:38:31 +00:00
amec0e
895dba06ba Updated fans.ir 2023-01-13 17:38:06 +00:00
amec0e
c89a594d30 Updated audio.ir 2023-01-13 17:37:44 +00:00
amec0e
70f0ab1442 Updated ac.ir 2023-01-13 17:37:13 +00:00
gid9798
073fb3861a Add the ability to turn pages in infrared (#2271)
Co-authored-by: あく <alleteam@gmail.com>
2023-01-13 17:11:12 +03:00
Georgii Surkov
75e9de12b0 [FL-3078] Per protocol signal repeat count (#2293)
* Better Infrared protocol file structure
* Rename InfraredProtocolSpec to InfraredProtocolVariant
* Slightly better names
* Add repeat count field to protocol variant description
* Repeat the signal the appropriate number of times when brute-forcing
* Repeat the signal the appropriate number of times when sending via worker
* Better signal count logic in infrared_transmit
* Better variable names
* Convert some raw signals to messages in tv.ir

Co-authored-by: あく <alleteam@gmail.com>
2023-01-13 16:50:19 +03:00
Fasjeit
78139c5936 drawing own battery (Bar %) charging display 2023-01-12 11:35:42 +03:00
Nikolay Minaylov
ad9d746a27 BadUSB backspace/delete fix (#2288)
Co-authored-by: hedger <hedger@users.noreply.github.com>
2023-01-11 16:58:51 +03:00
Giacomo Ferretti
20621da8ac Fix typos in source code (#2285)
* Fix typo in TextInput module

* Fix typo in Widget comment

* Fix typo in comment

Co-authored-by: hedger <hedger@users.noreply.github.com>
2023-01-11 16:41:57 +03:00
TQMatvey
b30aa890e6 initial Somfy Telis Encoder (doesnt work) 2023-01-11 19:47:45 +07:00
Stephen Kent
d2df35a35b fbt: add fap_deploy target to build and copy all .fap apps to flipper (#2146)
* fbt: add `faps_copy` target to build and copy all .fap apps to flipper
* fbt: restore default runfap.py invocation behavior, use -n for copy only
* fbt: proper implementation of fap_deploy target

Co-authored-by: hedger <hedger@nanode.su>
2023-01-11 13:13:07 +03:00
LTVA1
44830593c1 delete u8g2 dependency in example custom font 2023-01-11 12:15:08 +03:00
あく
8d2143add5 Fix various issues reported on github (#2280)
* Desktop: Fix use after free in slideshow view
* Gui: long press toggles first letter case too
* Desktop: remove debug logging
2023-01-10 03:15:03 +09:00
Fasjeit
4dc2a7f212 New battery display (Bar %) 2023-01-09 17:50:38 +03:00
Liam Droog
b7046b2179 Change broken BadUSB link to Hak5 duckyscript quick reference webpage (#2270)
* Change broken link to Hak5 duckyscript quick reference webpage
* Update BadUSB syntax link
2023-01-09 15:03:51 +09:00
LTVA1
3bac76f75e Merge branch 'patch-custom-font' of https://github.com/LTVA1/flipperzero-firmware-wPlugins into patch-custom-font 2023-01-08 20:13:09 +03:00
LTVA1
8488f4406e add example of custom font usage 2023-01-08 20:12:27 +03:00
Daniel
4ec5dbcee8 feat: allow disabling automatic signal decoding 2023-01-08 02:05:17 +01:00
MX
78c64737aa Fix readme 2023-01-08 03:17:00 +03:00
MX
76047e6e48 Merge pull request #272 from amec0e/dev
Updated infrared assets
2023-01-08 02:42:06 +03:00
amec0e
cd4f719783 Updated tv.ir
New additions and removed 2 mislabelled buttons CH- and VOL- which in fact was Pre_ch and Num_Input
2023-01-07 22:21:48 +00:00
amec0e
b3f32b6938 Updated projectors.ir last checked 2023-01-07 22:20:51 +00:00
amec0e
3a4b5e6445 Updated fans.ir 2023-01-07 22:20:16 +00:00
amec0e
754a29009d Updated audio.ir 2023-01-07 22:19:56 +00:00
amec0e
8c791a998a Updated ac.ir 2023-01-07 22:19:27 +00:00
LTVA1
74c46a515c Merge branch 'dev' into patch-custom-font 2023-01-07 22:11:56 +03:00
MX
797ddc0755 Update Unitemp
and remove old temp sensor app, unitemp now supports all sensors from that app
2023-01-07 20:05:37 +03:00
MX
bc99538ca8 Update UniTemp
https://github.com/quen0n/unitemp-flipperzero
2023-01-07 18:42:38 +03:00
MX
b6442f2971 Fix readme links 2023-01-07 18:40:47 +03:00
MX
c3b8d3cef4 Testing 2 repeats in infrared 2023-01-07 04:56:45 +03:00
MX
3fa11aa4a0 Update UniTemp
https://github.com/quen0n/unitemp-flipperzero/tree/dev
2023-01-07 02:08:15 +03:00
MX
ddf4f268ea Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-01-07 02:07:26 +03:00
MX
a921a828e5 Fix Dolphin animations manifests 2023-01-07 02:00:39 +03:00
MX
a94c553c5a Merge branch 'fz-dev' into dev 2023-01-07 01:59:20 +03:00
LTVA1
50ee2eb8aa update API symbols 2023-01-06 22:32:50 +03:00
Maksim Derbasov
2c450bd835 Show region information in sub-GHz app (#2249)
* Show region info in sub-GHz app
* SubGhz: reset widget on region info scene exit
* Format sources

Co-authored-by: あく <alleteam@gmail.com>
2023-01-07 04:28:28 +09:00
LTVA1
1cdccbae23 formatting 2023-01-06 21:52:17 +03:00
LTVA1
109c34398f custom font set function 2023-01-06 21:43:43 +03:00
knrn-ai
c24bea6b06 Documentation: edit texts, markdown linting (#2226)
Co-authored-by: konerini <25254561+konerini@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-01-07 03:18:43 +09:00
knrn-ai
fa223a4f4b ReadMe: edit text, move Links to the end (#2219)
* Edit text, move Links to the end
* ReadMe: can to must

Co-authored-by: あく <alleteam@gmail.com>
2023-01-07 03:05:58 +09:00
Astra
5e74622b2a [FL-3072] Add the sleigh ride animation (#2224)
* Add sleigh animation
* Fix manifest

Co-authored-by: あく <alleteam@gmail.com>
2023-01-07 01:16:58 +09:00
yan0f
9740dd8c75 Fix typos in source code (#2258) 2023-01-07 01:06:50 +09:00
あく
41c43f4805 Various improvements: Toolbox, Updater and Unit Tests. (#2250)
* Toolbox: add seek to character stream method. UpdateUtils: reverse manifest iterator. UnitTests: more unit tests.
* Target: bump API version. Updater: delete empty folders from manifest before resource deployment.
* UnitTests: use manifest from unit_tests folder instead of global one
* Make PVS happy
* sector cache: allocate always
* Better PVS config for manifest.c
* PVS: Move exception outside of condition
* PVS: remove confusing condition

Co-authored-by: SG <who.just.the.doctor@gmail.com>
2023-01-06 16:31:17 +10:00
MX
890419864c Update links in readme 2023-01-06 06:55:09 +03:00
MX
604b93645e Merge pull request #267 from amec0e/dev
Updated infrared assets
2023-01-06 02:55:51 +03:00
MX
7d4d2e19a9 Infrared: Fix not enough signal repeats in brute 2023-01-06 02:23:03 +03:00
amec0e
ecf7dfd8fd Updated audio.ir 2023-01-05 21:39:09 +00:00
amec0e
c8fb64ce22 Updated fans.ir 2023-01-05 21:38:19 +00:00
amec0e
11c6d2d0be Updated projectors.ir 2023-01-05 21:37:26 +00:00
amec0e
23155f9891 Updated ac.ir 2023-01-05 21:36:40 +00:00
amec0e
9248de50d1 Updated tv.ir 2023-01-05 21:34:55 +00:00
Jack Webb-Heller
b8dd75884c Add Dyson Purifier Hot+Cool support to IR AC Library (#2252) 2023-01-05 22:39:42 +03:00
MX
f7dfe77aaf Apply source code formatting
./fbt format
2023-01-03 19:07:58 +03:00
MX
ed5b2da9ad Merge pull request #252 from X-Stuff/dev-advanced-config
Bandwidth, Datarate and Macnhester Enable decoding configuration
2023-01-03 19:06:39 +03:00
MX
4571dd25a3 Merge branch 'dev' into dev-advanced-config 2023-01-03 18:48:33 +03:00
MX
5d4dcc925d Merge branch 'fz-dev' into dev 2023-01-03 18:42:03 +03:00
MX
28345b2fbd Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-01-03 18:41:22 +03:00
MX
82f8ad4540 Add 350Mhz to default range
Actually this frequency is used by some part of home devices like ceiling fans
2023-01-03 18:40:03 +03:00
Dimitry
df88a805a0 Removing AM* preset if launching regular read mode 2023-01-02 23:54:04 +02:00
Georgii Surkov
72dc8e95d0 Add .kateconfig and .kateproject to .gitignore (#2237) 2023-01-02 18:01:59 +09:00
MX
1534bcf7cb Why?!
appleboy broke 'latest' tag on dockerhub, its only for arm now
so, applying hotfix for now
2023-01-01 23:59:09 +03:00
MX
62fbf868fe Fix dev builds
Drone ssh defaults to arm now.. so need to specify amd64 arch
2023-01-01 23:47:47 +03:00
MX
ba429f6c88 Merge branch 'dev' into dev-advanced-config 2023-01-01 23:16:55 +03:00
MX
3d760077b6 Merge pull request #255 from peoblouk/cz_layout
Adding CZ layout for BADUSB
2023-01-01 23:15:11 +03:00
MX
189117326b Update UniTemp
https://github.com/quen0n/unitemp-flipperzero/tree/dev
2023-01-01 23:14:32 +03:00
peoblouk
84fbe6ad36 adding CZ layout support 2022-12-31 17:35:44 +01:00
MX
891d5845dd Fix dev builds 2022-12-31 15:27:47 +03:00
MX
d3c5ccbfe6 Dev builds with extra pack included 2022-12-31 15:14:32 +03:00
MX
91c159e823 Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2022-12-31 14:42:24 +03:00
MX
8457da39e0 Merge pull request #253 from teeebor/bugfix/solitaire-wrong-top-row-placement
Fix for solitaire card placement bug
2022-12-31 14:36:53 +03:00
Tibor Tálosi
27cc057573 solitaire:
fixed card placement to not allow placing ♠3 on top row when there was no card there.
2022-12-31 11:47:23 +01:00
MX
f28307128f Fix extra apps builds 2022-12-31 03:20:59 +03:00
Dimitry
27bfe861d9 cc1101 modem configurable preset introduced.
Available to configure: datarate, bandwidth and manchester decoding flag

log ability added to unit_test app (it's very helpful when writing a unit_tests)
2022-12-31 02:10:21 +02:00
MX
a51a6914f4 Barcode Generator: Save last barcode 2022-12-31 02:51:50 +03:00
MX
00b4903576 Add Delete key to usb keyboard 2022-12-31 01:30:57 +03:00
MX
a35b536120 Fix arkanoid bug 2022-12-30 23:31:21 +03:00
MX
6b30dc5114 Update unitemp 2022-12-30 20:01:12 +03:00
MX
b5aede37c7 Update changelog 2022-12-30 19:58:28 +03:00
MX
3821570d74 Merge pull request #249 from gid9798/fix_morse_code
Fixes for morse code plugin
2022-12-30 17:44:07 +03:00
MX
6eb6297ab7 Merge branch 'fz-dev' into dev 2022-12-30 16:34:20 +03:00
MX
4ef23f3a58 Fix links to readme support section 2022-12-30 16:08:57 +03:00
Georgii Surkov
95f8895b43 Add float_tools to SDK api (#2225) 2022-12-30 15:52:53 +03:00
gid9798
ebac25a057 plugin morse code:
fixed memory leak
fixed noise after exiting the app
fixed displaying characters after a long input
2022-12-30 13:53:08 +03:00
Avery
06cf1bb868 Gui: change data ownership model in submenu, own text by default (#2217)
* GUI: Refactor submenu to internally use FuriStrings
* NFC: Rework DESFIRE dynamic info submenu
* GUI: don't mutate label when drawing submenu
* Get rid of submenu_add_item_cstr
* increase api version
* Get rid of submenu_set_header_cstr
* rollback api version
* Documentation
* RFID: use new submenu api

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
2022-12-30 12:44:07 +09:00
MX
7fae0d5070 Add arrow on new year slideshow
by @Svaarich
2022-12-29 23:24:40 +03:00
MX
0f1e52a271 Merge pull request #247 from Kavitate/patch-1
Updated ReadMe.md
2022-12-29 21:05:41 +03:00
Kavitate
f955864c01 Updated ReadMe.md
- Fixed minor spelling and grammatical errors.
2022-12-29 12:03:18 -06:00
MX
e8e000d17b Merge branch 'fz-dev' into dev 2022-12-29 18:08:51 +03:00
あく
b11b9f1b38 Gui: Direct Draw API (#2215)
* Furi: allow on-fly thread priority change. Gui: Direct Draw API. DirectDraw debug app.
* Gui: drop input in direct draw
* Furi: handle priority change for starting threads
* DirectDraw: rollback to FreeRTOS primitives for priority change
2022-12-29 21:35:26 +10:00
Thomas Roth
26e5527a93 Mifare dictionary attack performance improvements. (#2173)
* NFC dictionary attack performance improvements.
* Remove unnecessary assignment
2022-12-29 14:20:01 +09:00
MX
1c2f4da4ee New Year slideshow
Preparing new release, pictures for slideshow by @Svaarich
2022-12-29 02:05:04 +03:00
MX
cc30c0d01d Builds with extra apps pack included
many of you asked, now it will be done
2022-12-29 01:50:31 +03:00
MX
4e3506ab2e Show OTP flipper region on debug and about screens
but keep region zero for ble and usb hardware info report
2022-12-29 01:43:24 +03:00
MX
a850aa8f2c Force no dirty build status for multiple builds
kostili and velosipedy
2022-12-29 01:41:23 +03:00
MX
984528d366 Remove wrong scene state set 2022-12-29 00:34:27 +03:00
MX
622abc902a Merge branch 'fz-dev' into dev 2022-12-28 23:42:46 +03:00
MX
08f48280cd Merge pull request #246 from amec0e/dev
Updated tv.ir
2022-12-28 23:36:25 +03:00
Skorpionm
ea054423b0 [FL-3074] SubGhz: CAME 12 bit encoder fix guard time (#2210)
* SubGhz: CAME encoder fix guard ime
* SubGhz: fix 2 encoder CAME

Co-authored-by: あく <alleteam@gmail.com>
2022-12-29 05:29:23 +09:00
amec0e
a96eb74f91 Updated tv.ir
Added POWER only button support for Sony Bravia KDL40RD453
2022-12-28 18:22:34 +00:00
amec0e
dc6379a1ca Updated tv.ir
Added POWER only button support for Sony Bravia KDL40RD453
2022-12-28 18:16:26 +00:00
MX
f89983e2fa SubGhz: fix encoder CAME
by @Skorpionm | OFW PR 2210
2022-12-28 21:04:01 +03:00
MX
66d31b3a0e Merge branch 'fz-dev' into dev 2022-12-28 21:01:36 +03:00
Astra
d58b9f3fe8 Fix MFC bruteforce progress bar (#2203)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-29 00:09:33 +09:00
Zoë Prosvetova
4accce93cf Update KeyCombo.md (#2213)
Grammatical corrections and changes
2022-12-28 23:39:36 +09:00
Konstantin Volkov
27ee0f73f7 Fixing various typos in readme files #2208
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
2022-12-28 23:30:20 +09:00
Konstantin Volkov
3108dc7c8c Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter

Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 23:16:06 +09:00
Tiernan
90573fbeed Picopass read bug fixes: (#2201)
* fix checking user elite keys
* include calculated Kd when saving cards

Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 22:04:58 +09:00
あく
d7735a1efb Drop brewfile, drop makefile, update readme and documentation (#2205)
* Drop brewfile, drop makefile, update readme
* Minor grammar and consistency fixes
* ReadMe: add more documentation links, cleanup layout
* ReadMe: cleanup and contribution section. Roadmap: update.
* Docs: Lots of minor fixes

Co-authored-by: Anna Prosvetova <anna@prosvetova.me>
Co-authored-by: Astra <astra@astrra.space>
2022-12-28 15:32:32 +03:00
MX
69879c3693 Merge pull request #243 from huuck/dev
Added ESCAPE key
2022-12-27 17:10:34 +03:00
MX
529a20b9d2 Add holtek HT12X in brute 2022-12-27 17:06:52 +03:00
Gabriel Cirlig
43be797926 Merge branch 'DarkFlippers:dev' into dev 2022-12-27 08:19:28 -05:00
huuck
4840196b88 addded escape key 2022-12-27 08:13:17 -05:00
MX
5db9238331 Update API 2022-12-27 16:09:23 +03:00
MX
473f9c0e44 Merge branch 'fz-dev' into dev 2022-12-27 16:06:27 +03:00
Sergey Gavrilov
727f043747 OpenOCD scripts (#2101)
* Scripts: option bytes check
* Scripts: option bytes set
* Scripts: openocd config
* Scripts: increased readability, process IPCCBR option byte
* Scripts: split dap_ob.py
* Updater: process IPCCBR option byte
* Scripts: move chip-related functions to chip definition
* Scripts: freeze CPU registers
* Scripts: flash programming routine
* ob.py
* otp.py
* otp: handle errors correctly
* downgrade to python 3.9
* correct type hinting
* Scripts: fix path to ob.data

Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 21:59:36 +09:00
Astra
ded7e727d0 [FL-3060] New MFC Bruteforce animation (#2190)
* Change the wording in the headers
* Add support for text in the progress bar
* New MFC key bruteforce screen
* Typo fix
* nfc: rename Flipper Dict to System Dict
* elements: fix types
* Display the correct key attack sector

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-12-27 18:14:03 +09:00
Nikolay Minaylov
08eb666f7b [FL-3000] File browser: Empty folder label (#2188)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 17:39:04 +09:00
Skorpionm
1390f10a6f [FL-3068] SubGhz: add Holtek_ht12x protocol (#2187)
* SubGhz: add Holtek_ht12x protocol
* SubGhz: add unit_test holtek_ht12x
* SubGhz: correct string formatting

Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 17:29:21 +09:00
Nikolay Minaylov
f43b76efc2 [FL-3021] USB/BLE HID Remote icon fix (#2179)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 17:03:56 +09:00
Daniel Carvallo
8a279758fd Fix quoted error for macOS bad-usb (#2155)
* Add stderr redirect to null device
* Remove stderr redirect and replace <`> with <'>

Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 16:55:25 +09:00
Max Andreev
4e347b207c Fix amap on forks (#2200) 2022-12-27 16:35:57 +09:00
MX
b88aa9f391 Merge pull request #242 from amec0e/dev
Updated infrared assets
2022-12-27 03:03:38 +03:00
amec0e
3ec517bb54 Updated tv.ir last checked 2022-12-26 23:05:04 +00:00
amec0e
bce32bf893 Updated projectors.ir 2022-12-26 23:04:38 +00:00
amec0e
29ba7956c1 Updated fans.ir last checked 2022-12-26 23:03:57 +00:00
amec0e
05293ce860 Updated audio.ir 2022-12-26 23:03:28 +00:00
amec0e
b21618b4cc Updated ac.ir last checked 2022-12-26 23:02:33 +00:00
MX
96f6e77fd2 Fix builds 2022-12-27 00:20:00 +03:00
MX
f5985ee27c Merge branch 'fz-dev' into dev 2022-12-26 23:32:45 +03:00
MX
4f05c1816b Update TOTP 2022-12-26 23:31:38 +03:00
Max Andreev
1c926cf8a2 Trigger amap from another repo (#2171)
* Add s3 upload, repository dispatch
* Add trigger
* Fix map file upload
* Debug
* Add event file upload to s3
* fix triggering
* Fix upload process
* fix build.yml

Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 05:22:22 +09:00
MX
1243dad8fd Fix POCSAG Pager UI bug
same as subghz and weather station bug with invisible element selected
2022-12-26 23:21:10 +03:00
MX
ac400abede Update UniTemp 2022-12-26 23:15:10 +03:00
MX
a7fc43d1ac Update wifi marauder 2022-12-26 23:12:45 +03:00
MX
5992e2d4f2 Update readme 2022-12-26 23:10:42 +03:00
MX
aecdb8fdcd Merge branch 'fz-dev' into dev 2022-12-26 23:02:31 +03:00
Sergey Gavrilov
9192520c70 Modules: locking view model (#2189)
* Popup, dialog_ex: locking model
* Desktop: do not use the model where it is not needed

Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 04:46:05 +09:00
MX
6d368c3e3a Merge branch 'fz-dev' into dev 2022-12-26 22:42:21 +03:00
Max Andreev
a34fbf6976 [FL-3056] Prevent merging of PRs if there are warnings from PVS-studio (#2176)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-27 04:33:44 +09:00
Georgii Surkov
8582670a34 [FL-2811] Fix PVS-Studio warnings (#2142)
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-12-26 21:13:30 +09:00
MX
749a2f5977 Merge pull request #233 from eugene-kirzhanov/dev
Add 2048 game
2022-12-25 01:53:02 +03:00
MX
1481036abe Merge pull request #234 from gid9798/barcode_ean13
add EAN-13 support
2022-12-25 01:33:40 +03:00
Dmitry Eroshenko
ad3bff0b67 Update ac.ir (#2184)
Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
2022-12-24 21:44:04 +03:00
Sergey Gavrilov
c2cb14834d [FL-3062] Fix unit tests (#2180)
* SubGHZ unit test: fail if async_tx is not started
* Memgr unit test: fix for multithreaded enviroment
* Unit tests: fix failed_tests count
* Unit tests: remove debug code
* Double update test: increase flipper detection time

Co-authored-by: あく <alleteam@gmail.com>
2022-12-24 23:13:21 +09:00
MX
02369c8394 Merge branch 'fz-dev' into dev 2022-12-24 02:25:58 +03:00
あく
b0970953b9 [FL-3067] WeatherStation: fix incorrect history index increment (#2186) 2022-12-23 22:46:35 +09:00
Nikolay Minaylov
dff73dfd38 [FL-3037, FL-3038, FL-3039] File format docs: RFID, iButton, BadUSB (#2177)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-23 19:25:29 +09:00
あく
2f96fad7c2 [FL-3026] Documentation: subghz file formats (#2175)
Co-authored-by: hedger <hedger@nanode.su>
2022-12-23 18:46:11 +09:00
gid9798
4d9ecbacae Barcode generator: add EAN-13 support 2022-12-23 12:25:20 +03:00
valentinegb
10580b5117 Add Edifier R1850DB signals to audio.ir (#2168)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-23 12:13:13 +03:00
Skorpionm
566e80abf6 [FL-3063] SubGhz: fix start navigation (#2183) 2022-12-23 17:31:14 +09:00
Eugene Kirzhanov
a8541d5191 Games: Add 2048 game 2022-12-22 21:36:50 +03:00
MX
3b1bc8b7e1 Update infrared assets
by @amec0e
2022-12-21 20:44:39 +03:00
MX
8deecc9241 Fix comment 2022-12-21 15:12:17 +03:00
MX
0bfaaa0fe1 SubGHz: Add manually +2 new remotes
Allow manual creation of Nice Flor S, Nice Smilo
2022-12-21 15:11:12 +03:00
MX
488211b4d7 Update Unitemp
https://github.com/quen0n/unitemp-flipperzero/tree/dev
2022-12-21 14:23:26 +03:00
MX
05147e5b7a Update universal remote assets
by @Amec0e
2022-12-21 14:19:12 +03:00
MX
0abe9ee417 Merge pull request #225 from TQMatvey/dev
LFRFID: allow removing password from T5577 to make it operational
2022-12-21 13:53:55 +03:00
MX
09f80d0086 fbt format 2022-12-21 13:00:27 +03:00
Georgii Surkov
7ff9414656 Update CODEOWNERS (#2170) 2022-12-21 12:42:51 +03:00
MX
aba70c33f1 Merge branch 'dev' into t5577 2022-12-21 12:35:43 +03:00
MX
f3553deb16 Merge branch 'fz-dev' into dev 2022-12-21 12:32:21 +03:00
valentinegb
2796623551 Add VIZIO signals to tv.ir (#2167)
* Add VIZIO signals to tv.ir

* Fix improper formatting

Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
2022-12-21 12:30:40 +03:00
あく
5856746fc9 iButton: fixed notification on successful read (#2169) 2022-12-21 12:07:14 +03:00
TQMatvey
6d8ecec051 lfrfid: clear_t5577: major code cleanup 2022-12-21 15:00:52 +07:00
TQMatvey
060a48cdfc lfrfid: clear_t5577: move icon and text lower 2022-12-21 12:21:17 +07:00
TQMatvey
91eed4209d lfrfid: clear_t5577: change notification color and cleanup 2022-12-21 12:11:58 +07:00
TQMatvey
787eafd7b8 lfrfid: clear_t5577: code cleanup, add notifications
Co-authored-by: grvpvl <Tobirg@users.noreply.github.com>
2022-12-21 11:34:54 +07:00
TQMatvey
10b55bcbd2 lfrfid: t5577_clear: remove unneeded comment 2022-12-21 07:09:39 +07:00
TQMatvey
19e230823b lfrdfid: t5577_clear: make animation smoother 2022-12-21 07:07:07 +07:00
TQMatvey
d1418bf7f6 Merge branch 'DarkFlippers:dev' into dev 2022-12-21 06:44:25 +07:00
Georgii Surkov
c34ae66b6e [FL-3041] IR format docs (#2162)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-21 00:07:19 +09:00
Nikolay Minaylov
e0d716647c [FL-3053] Archive browser delete fix (#2163) 2022-12-20 23:46:05 +09:00
Kowalski Dragon
a9c2b4d6a0 Desktop: dummy mode improvements. Fixes: correct scrolling text, correct AM/PM in Clock. (#2160)
* Show passport instead of app if SD/app is missing 
* Desktop: cleanup dummy mode code and add more apps
* Gui: fix incorrect trimming in scrollable text

Signed-off-by: Kowalski Dragon (kowalski7cc) <kowalski7cc@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-20 22:57:58 +09:00
MX
4fb03cde62 Merge branch 'fz-dev' into dev 2022-12-20 16:21:57 +03:00
MX
7e049d185f Merge branch 'fz-dev' into dev 2022-12-20 16:19:43 +03:00
TQMatvey
376fa071a1 Merge branch 'DarkFlippers:dev' into dev 2022-12-20 19:46:58 +07:00
Skorpionm
797eab8924 SubGhz: fix Hormann HSM (#2158)
* SubGhz: fix Hormann HSM
* SubGhz: add check pattern hormann protocol

Co-authored-by: あく <alleteam@gmail.com>
2022-12-20 21:42:16 +09:00
TQMatvey
c7de198d1a lfrfid: Add scene to clean T5577 Passwords
Co-authored-by: grvpvl <Tobirg@users.noreply.github.com>
2022-12-20 19:40:25 +07:00
gornekich
4cee550cc6 [FL-2809] Rework BLE key storage (#2154)
* bt: disconnect first on profile change
* bt keys: rework bt keys
* saved struct: add payload size getter to API
* bt: rework bt with new key storage API
* bt: add keys storage operation to bt API
* hid: save bt keys on sd card
* bt: add unit tests for key storage
* bt: working profile switch
* bt: cleanup
* bt hid: change keys storage path

Co-authored-by: あく <alleteam@gmail.com>
2022-12-20 21:32:24 +09:00
あく
e7107e39f7 Gui: scrollable long file names in FileBrowser and Archive Browser (#2159)
* Gui: scrollable long file names in FileBrowser
* Archive: scroll long file names
* Gui: elements code cleanup
2022-12-20 20:11:52 +09:00
Astra
0286636183 [FL-3036] Add NFC file format documentation (#2156) 2022-12-20 16:19:26 +09:00
Kowalski Dragon
2bdc34274f Clock v1 (#1750) 2022-12-20 06:43:32 +09:00
MX
842ba616ee Merge branch 'fz-dev' into dev 2022-12-19 23:34:35 +03:00
MX
9e2c3eb96d Testing marauder +5 volt 2022-12-19 23:33:11 +03:00
Astra
fa87216a1e [FL-2970] Untangle NFC_APP_FOLDER from nfc_device (#2124)
* Untangle NFC_APP_FOLDER from nfc_device
* Make the folder an internal part of the nfc device struct
* Move the NFC folder definition to the nfc allocator
* Move the NFC folder definition to the allocator in the nfc magic FAP
* Replace furi_string_printf with furi_string_set for folder allocation and handle the cases when folder has no slashes
* Build and allocation fixes

Co-authored-by: あく <alleteam@gmail.com>
2022-12-20 04:57:48 +09:00
MX
921b47ac50 Merge branch 'fz-dev' into dev 2022-12-19 22:24:52 +03:00
Skorpionm
a81a5ca57c [FL-3052] WS: add choice fahrenheit/celsius (#2149)
* WS: add choice fahrenheit/celsius
* WS: fix syntax

Co-authored-by: あく <alleteam@gmail.com>
2022-12-20 04:22:57 +09:00
MX
577334a394 Fix sound issues in multiple apps 2022-12-19 21:55:06 +03:00
Konstantin Volkov
84ba2690a5 GitHub: update unit_tests workflow steps to always re-flash device (#2150)
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-20 03:14:44 +09:00
MX
de2334f314 Update Readme and changelog 2022-12-19 20:50:16 +03:00
MX
4a4c041fd9 Merge pull request #216 from quen0n/dev
New plugin - Unitemp
2022-12-19 20:29:34 +03:00
MX
d5624cd842 Merge branch 'dev' into unitemp 2022-12-19 20:24:14 +03:00
MX
ca72a4f225 Drop AM2320 and DHT Monitor plugins 2022-12-19 20:21:40 +03:00
Victor
453666192c DHT monitor remove 2022-12-19 20:16:33 +03:00
Victor
cbc9720738 New plugin: Unitemp 2022-12-19 20:16:02 +03:00
Max Andreev
361ca8b750 Rollback new amap workflow (#2152) 2022-12-20 02:09:19 +09:00
MX
cefff35661 Move submenu_set_selected_item 2022-12-19 20:07:07 +03:00
MX
fd5b1f1943 Merge branch 'fz-dev' into dev 2022-12-19 19:51:19 +03:00
Max Andreev
ef7052fbad Fix new amap workflow (#2151)
* Fix amap workflow
* get_env.py
* Fix amap_analyse.yml
2022-12-20 01:42:06 +09:00
MX
22062faae2 Update changelog 2022-12-19 19:03:32 +03:00
MX
8a09ac2569 Update SubGhz Bruteforcer 2022-12-19 18:45:27 +03:00
Max Andreev
5d18b189ec Run map file analyser through repository dispatch (#2148)
* Add ripository dispatch
* Fix mistakes
2022-12-20 00:28:53 +09:00
MX
57f68c11e9 Deduplicate fans.ir
Thanks to @Amec0e
2022-12-19 17:57:56 +03:00
MX
94e7bb7fe3 Add mouse jiggler to USB Keyboard&Mouse App 2022-12-19 17:56:13 +03:00
MX
da32d252db Clock - use system locale settings 2022-12-19 17:54:59 +03:00
MX
1a4071a7c1 Merge pull request #215 from airs0urce/dev
Added Toshiba F-WSA20 and Senko TR828
2022-12-19 16:59:05 +03:00
MX
084cdc6ad0 Merge branch 'fz-dev' into dev 2022-12-19 16:57:00 +03:00
Konstantin Volkov
36e15a1352 Doom/Unit_tests flashing proper firmware (#2133)
* doom: should fix all issues, needs review
* fixed flash call and added port
* increased timeout, full flash wasn't completing
* turned serial back
* added unit formatting and force flag for overwriting files
* testing crash
* fixed step names, added release flashing, removed unit_tests from updater tests
* changed checkout method, added step validations
* removed duplicated tag
* fixed styling, stopped relying on shebang lines, removed debug output
* moved format to the end, flash_usb_full copies resourses already
* awaiting flipper after flashing and step status for file move

Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-19 22:07:23 +09:00
あく
94453d9100 [FL-3046] Notification: fix recursive speaker acquire #2147 2022-12-19 20:57:44 +09:00
Dmitry Eroshenko
30801d4eb8 Added Toshiba F-WSA20 and Senko TR828
Works for other models of the brands. Both fans purchased in Vietnam
2022-12-19 17:01:30 +07:00
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
MX
0238da8ac9 Update SubGHz Bruteforcer 2022-12-19 00:53:08 +03:00
MX
5e5d6cf1a0 Update changelog 2022-12-19 00:52:37 +03:00
MX
f2e6384860 add links to dev builds and releases in telegram 2022-12-17 08:53:03 +03:00
MX
0c3fc5cc30 Merge remote-tracking branch 'origin/dev' into dev 2022-12-17 08:49:54 +03:00
MX
1464c65d10 Create FUNDING.yml 2022-12-17 08:49:13 +03:00
MX
96a97f1bfb Merge branch 'fz-dev' into dev 2022-12-17 07:25:49 +03: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
MX
675d1f007f OFW Anim updates 2022-12-16 02:55:34 +03:00
MX
65b6dd5707 Merge branch 'fz-dev' into dev 2022-12-16 02:51:15 +03:00
あく
3681a5478c [FL-3044] Dolphin: add new animation 2022-12-16 08:04:15 +09:00
MX
fbcb1f0c6e Merge pull request #208 from gid9798/scene_set_faac
Removing duplicate code in subghz FAAC scenes.
2022-12-16 01:36:31 +03:00
MX
a0488624b5 Merge branch 'dev' into scene_set_faac 2022-12-16 01:31:26 +03:00
MX
d56e399ae5 Update readme 2022-12-16 00:48:15 +03:00
MX
021ba9dc1a Merge branch 'fz-dev' into dev 2022-12-16 00:16:47 +03:00
Skorpionm
b5e7bb3334 [FL-3043] SubGhz: add SMC5326, UNILARM protocol (#2138)
* SubGhz: add SMC5326 protocol
* SubGhz: add unit_test smc5326 protocol

Co-authored-by: あく <alleteam@gmail.com>
2022-12-16 05:25:43 +09:00
Adam Boeglin
1dc79fddf0 Added support for IDTECK cards (#2134) 2022-12-16 05:02:43 +09:00
gid9798
f43fd7a351 Removing duplicate code in subghz scnes. 2022-12-15 17:31:54 +03:00
MX
03153b4d02 Merge branch 'fz-dev' into dev 2022-12-14 16:54:13 +03:00
Skorpionm
327df4a813 [FL-3034] WS: fix protocol and add new (#2116)
* WS: fix Nexus-TH potocol
* WS: add Oregon_v1 protocol
* WS: add AmbientWeather-TX8300   protocol

Co-authored-by: あく <alleteam@gmail.com>
2022-12-14 17:27:55 +09:00
Der Skythe
1fa4c646e6 VSCode: add task 'Serial console' and group task with sequence calling (#2121)
* Add task 'Serial console' and group task with sequence calling
* PR fixes

Co-authored-by: あく <alleteam@gmail.com>
2022-12-14 16:42:13 +09:00
usiegl00
1c12613863 Prevent hacking related backgrounds from being displayed in dummy mode. (#2107)
* Prevent hacking related backgrounds from being displayed in dummy mode.
* Add function call to animation manager to set dummy mode.
* Reboot retains dummy mode background.

Co-authored-by: あく <alleteam@gmail.com>
2022-12-12 21:46:41 +09:00
Kassim
d541f142c8 Add Mouse Jiggler to HID Remote (#2113)
* feat: add Mouse Jiggler to HID Remote
* move processing to use furi_timer instead of draw loop
* HidApp: refine mouse jiggler, move timer work into enter/exit callbacks

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-12-12 18:47:22 +09:00
MX
966528b16a Merge branch 'fz-dev' into dev 2022-12-11 22:31:46 +03:00
MX
87fb852bcf Weather Station: Fix display of temps lower than -9 (#2120)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-12 04:29:58 +09:00
MX
d87caac5fe Merge branch 'fz-dev' into dev 2022-12-11 21:34:32 +03:00
Eric Betts
6ff437ad18 Dictionary stuff: iClass keys (#2118)
* MFC comments
* iClass keys from proxmark3 repo

Co-authored-by: あく <alleteam@gmail.com>
2022-12-12 02:32:25 +09:00
MX
76e8b00dc8 WS: Fix displaying temps lower than -9 2022-12-11 03:04:12 +03:00
MX
f73d28677b Update changelog 2022-12-11 01:08:00 +03:00
MX
bb3dd48447 Merge branch 'fz-dev' into dev 2022-12-11 00:44:27 +03:00
MX
17ea9315e0 Fix incompatibility with OFW in subghz part + improve speed
SubGHz app launch times improved, also setting_user file no longer added by firmware, this update will remove this file, be sure to backup!
Now this file is actually should be created by user and will be not removed every update!
2022-12-11 00:42:26 +03:00
MX
63b40992ef Fix naming was different from OFW 2022-12-11 00:09:38 +03:00
あく
27921e42ff Github: fix unit tests workflow (#2117) 2022-12-11 05:34:12 +09:00
MX
ebf39f189d Add link back 2022-12-10 22:39:04 +03:00
Georgii Surkov
2954ec6d97 [FL-3025] IR button overflow fix (#2115)
* Allow for more than 255 button_menu items
* Allow more than 255 items in submenu
* Fix button_menu_reset

Co-authored-by: あく <alleteam@gmail.com>
2022-12-11 03:05:52 +09:00
MX
31a9a3f5f3 SubGHz: Improve signal text visibility in history (#2111)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-11 02:31:07 +09:00
MX
2fcff37f88 Add POCSAG Receiver plugin 2022-12-10 20:08:17 +03:00
MX
35a4eef3fc Merge branch 'fz-dev' into dev 2022-12-10 19:30:20 +03:00
MX
01e24f6837 WS: Show received signal age (#2087)
* Feat: Show received signal age: by @LY2NEO with some fixes from me
* WS: Signal age display GUI fixes and improvements
* WeatherStation: refactor variable names
* WS: GUI fixes and improvements: add icons by @Karator and apply UI changes
* Weather Station: proper event flow for view redraw.

Co-authored-by: あく <alleteam@gmail.com>
2022-12-11 00:30:03 +09:00
Max Andreev
9d728a1c65 Check FL ticket in PR name after merge (#2076)
* Add base
* Add base again
* Test reporting
* Fix reporting
* Fix secrets
* Fix arguments in report
* Remove depricated actions
* Disable reporting on PR

Co-authored-by: あく <alleteam@gmail.com>
2022-12-10 22:10:51 +09:00
Astra
7fb1af07b8 [FL- 3014] Untangle NFC from Unit Tests (#2106)
* Untangle NFC from Unit Tests
* nfc tests: add log error

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-10 22:02:34 +09:00
MX
e756c680e5 RFID and iButton fuzzer fixes
Attempt to fix crash when exiting from uids from file attack
2022-12-10 04:36:44 +03:00
MX
9df393c301 Update changelog and docs 2022-12-10 03:20:38 +03:00
MX
df693e7e57 Update Readme 2022-12-09 22:13:11 +03:00
MX
74fb904fb0 Merge branch 'fz-dev' into dev 2022-12-09 22:04:43 +03:00
Nikolay Minaylov
b85f533a20 VCP session close fix (#2108)
* VCP thread check before flag set
* VCP running flag check
* Cli vcp: more clear CLI_VCP_DEBUG logs
* Cli: move tag to debug log macro

Co-authored-by: SG <who.just.the.doctor@gmail.com>
2022-12-10 03:03:19 +09:00
MX
6f9f0dbe6e Infrared: Update assets
by @Amec0e
2022-12-09 20:42:09 +03:00
MX
6701cbacf9 SubGHz: Improve signals visibility in history 2022-12-09 20:01:05 +03:00
MX
aae82b2694 Misc fixes & updates 2022-12-09 20:00:39 +03:00
MX
556b604f7b WS: GUI fixes and improvements 2022-12-09 00:04:55 +03:00
MX
8794aad5d0 Merge branch 'fz-dev' into dev 2022-12-08 21:41:45 +03:00
Georgii Surkov
df808be8d7 [FL-3003] Fix logical error in storage script (#2105)
* Fix logical error in storage script
* Fix formatting
2022-12-08 18:31:22 +09:00
MX
99ef76e638 Some small fixes - added 'base_path' 2022-12-08 10:10:38 +03:00
Shane Synan
5c3a5cd8f7 FuriHal, Power, UnitTests: battery charging voltage limit API (#2063) 2022-12-08 15:57:49 +09:00
MX
349ef2ecb8 Fix merge issues 2022-12-08 09:04:22 +03:00
MX
1fc67f76a2 Merge branch 'fz-dev' into dev 2022-12-08 08:58:39 +03:00
Skorpionm
6a470a464e [FL-3002] SubGhz: add RPC error (#2097)
* [FL-3002] SubGhz: add RPC error
* RPC_APP: rpc_system_app_error_reset, automatic error reset when a new event is executed
* SubGhz: fix text error
* SubGhz: fix text error 2
* SubGhz: add error description
* Format sources

Co-authored-by: あく <alleteam@gmail.com>
2022-12-08 14:49:54 +09:00
gornekich
c535b8f4ce [FL-3017], [FL-3018] Change NFC emulation screens (#2102)
* nfc: fix emulate uid view
* archive: hide dot files in apps
* nfc: fix other emulation scenes view
2022-12-08 01:47:55 +09:00
Nikolay Minaylov
2daf39018b [FL-3001] File browser base folder (#2091)
* File browser base folder
* Format sources
* FuriHal: bump api version

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-12-07 23:17:41 +09:00
MX
741ad34b2c WS: Oregon2 - add support for temp sensor RTHN129 (#2088)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-07 22:28:18 +09:00
0xchocolate
e42dda7cfb UART echo: fix race conditions causing null pointer dereference (#2092)
Co-authored-by: 0xchocolate <0xchocolate@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-07 20:46:50 +09:00
gornekich
9a21dae29c [FL-3008], [FL-2734], [FL-2766], [FL-2898] NFC bug fixes (#2098)
* nfc: rework mf classic update
* nfc: rename cache folder to .cache
* nfc: fix ATQA order bytes in nfc files
* file browser: add hide dot files option
* nfc: fix iso-14443-4 uid cards emulation
* nfc: fix unit tests

Co-authored-by: あく <alleteam@gmail.com>
2022-12-07 19:52:44 +09:00
あく
c43ec414bb FuriHal: add i2c unit tests (#2089)
* FuriHal: add i2c unit tests
* FuriHal: restructure unit tests

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
2022-12-07 19:43:40 +09:00
Dmitry Zinin
cbc5e3fa92 IR TV Universal: Toshiba TV (#2084)
From Toshiba TV 32W1534DG (C)

Co-authored-by: あく <alleteam@gmail.com>
2022-12-07 18:50:44 +09:00
あく
2b06b41ffd Dolphin: new animation L2_Wake_up_128x64 (#2099) 2022-12-07 19:34:36 +10:00
MX
7d59eb1848 Plugins: iButton Fuzzer change minimal delay
after @Tobirg successfully verified stability with lower delay
2022-12-04 22:26:25 +03:00
MX
1c81dc2dee Weather station: signal age display GUI fixes 2022-12-04 20:48:19 +03:00
MX
176f27e037 WS: Oregon2 - add support for RTHN129 2022-12-04 15:58:07 +03:00
MX
42cc41cda3 Merge pull request #197 from LY2NEO/dev
Improved plugin WS data dashboard, added data age counter.
2022-12-04 04:43:24 +03:00
MX
8d9786f89a Simplify and fix time display
display only OLD when we have more than 59 mins
2022-12-04 04:38:37 +03:00
MX
11576e58c8 Update subbrute 2022-12-04 04:22:14 +03:00
LY2NEO
21e5b66bf6 Improved plugin WS data dashbord, added data age counter.
When data is read it saves datastamp and calculetes diference between actual time and data read time.
Until one minute it counts age in seconds.
After one minute it starts blink and counts age per minute.
Tested with auriol_hg0601a.c protocol.
2022-12-03 23:23:08 +02:00
MX
7945afd1d2 Update subbrute 2022-12-03 01:03:59 +03:00
MX
dfbd978466 Update changelog 2022-12-03 00:16:27 +03:00
MX
e1e208922e XMas / New year animation
by @Svaarich
2022-12-02 23:46:45 +03:00
MX
196fc562d8 Merge branch 'fz-dev' into dev 2022-12-02 23:05:30 +03:00
MX
de58d69c06 Update subghz bruteforcer 2022-12-02 23:01:34 +03:00
gornekich
e40376bc63 NFC: fix NTAG203 info scene #2078 2022-12-02 21:41:34 +09:00
MX
853b182b8b Update readme / changelog 2022-12-02 03:10:08 +03:00
MX
ef4bdf3909 Merge branch 'fz-dev' into dev 2022-12-01 22:13:12 +03:00
Skorpionm
79fbaf2620 SubGhz: unit_test modification of text files to one frequency and modulation (#2066)
* SubGhz: unit_test modification of text files to one frequency and modulation
* SubGhz: unit_tests raw file

Co-authored-by: あく <alleteam@gmail.com>
2022-12-02 04:07:16 +09:00
MX
45d6826fa0 Merge branch 'fz-dev' into dev 2022-12-01 22:00:58 +03:00
Nikolay Minaylov
4070eeb1c9 USB HID: fix key name #2065
Co-authored-by: あく <alleteam@gmail.com>
2022-12-02 03:56:27 +09:00
Nikolay Minaylov
7f67445c85 U2F HID descriptor fix (#2073)
Co-authored-by: あく <alleteam@gmail.com>
2022-12-02 03:40:49 +09:00
Sergey Gavrilov
eb3a8734fb Fix crash in iButton notifications routine (#2074)
* iButton: send notifications less strictly
* iButton: set notification callback earlier
2022-12-02 03:28:46 +09:00
MX
38c62cf247 Update readme 2022-12-01 03:25:04 +03:00
MX
1ce591a6c5 Partially fix strange issue with subghz decode raw 2022-12-01 03:18:41 +03:00
MX
0ed290161d Update changelog 2022-11-30 20:34:14 +03:00
MX
0b9d632363 Misc improvements 2022-11-30 20:03:55 +03:00
MX
a66f94d22e Merge branch 'fz-dev' into dev 2022-11-30 15:27:55 +03: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
MX
79812a1fe0 Merge branch 'fz-dev' into dev 2022-11-30 02:13:05 +03:00
Danil Kalashnikov
0ab14c37c9 fbt: add missing Force flag when moving toolchain from temp path (#2044)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 22:31:32 +09:00
MX
eec21b073b Merge branch 'fz-dev' into dev 2022-11-29 16:11:13 +03:00
Никита Тимофеев
b70395eba9 Allow "Detect reader" for unsaved card (#2045)
* Allow "Detect reader" for unsaved card
* Add missed detect reader deed

Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 22:10:02 +09:00
Sergey Gavrilov
297f185ef4 Blocking USB driver API (#2009)
* invalidate memmgt thread dict
* Core: rollback memmgt thread dict invalidation
* Dialogs: move api lock to toolbox
* HAL: blocking usb API
* HAL usb: fix api return data
* HAL usb: api optimization
* api lock: test results
* Fix build errors
* DAP Link: fix imports
* Crash when malloc in ISR
* Fix dap-link copypaste error
* Moar memory management crashes.
* Crash when malloc in IRQ, not ISR
* USB-UART: Blocking VCP mode switch

Co-authored-by: nminaylov <nm29719@gmail.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-11-29 21:50:55 +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
MX
60cd7b8b32 Fix merge issues 2022-11-28 23:20:37 +03:00
MX
3d36105142 Merge branch 'fz-dev' into dev 2022-11-28 23:12:17 +03:00
Georgii Surkov
849afc8798 [FL-2998] IR TV Universal Remote refactor and docs (#2052)
* Rename signals for IR TV universal remote
* Update UniversalRemotes.md

Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 04:49:51 +09:00
Georgii Surkov
c535ce9b76 [FL-2997] Improve file name filtering #2047
Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 04:28:51 +09:00
Skorpionm
84f9af3e7e SubGhz: fix duration pricenton protocol (#2054)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 04:17:57 +09:00
MX
97e8da7a7b Weather Station: Add protocol - Auriol HG0601A (#2056)
* Add protocol Auriol hg0601a: Made by @LY2NEO
* Improve readability of code: fix protocol name

Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 04:08:28 +09:00
あく
769c53b6da [FL-2977] Gui: better navigation in file browser dialog (#2014)
* Gui: proper navigation in file browser dialog
* Trim file name from start path
* File list loading fix
* File list offset fix

Co-authored-by: nminaylov <nm29719@gmail.com>
Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
2022-11-29 03:59:24 +09:00
Yukai Li
6b47bc1af4 Nfc: NTAG password auto capture (and other password-related changes) (#1843)
* nfc: MFUL minor cleanup
* nfc: Add mechanism to pass event data
* nfc: Add NTAG authentication event to emulation
* nfc: Rename enum member to align with existing convention
* nfc: Add function to determine whether MFUL is fully captured
* nfc: Fix emulation of incompletely-read password-protected MFUL
* nfc: Add reader password capture scene
* nfc: Set default MFUL password input to 0xFFFFFFFF
* nfc: Fix MFUL auth counter loading
* nfc: Be explicit about using manual auth method when using auto unlock
* nfc: Fill in MFUL has_auth when loading file
* nfc: Fix MFUL auth success usage, remove unused variable
* nfc: Display PWD and PACK in MFUL info if available
* nfc: Remove unnecessary include
* nfc: Add unlock options to loaded MFUL menu
* nfc: Move set default MFUL password. This way it can be edited if needed instead of reentered
* nfc: Fix unlock menu not maintaining selection index
* nfc: Move captured MFUL auth data from worker to device data
* nfc: Attempt to authenticate with default PWD when possible when reading NTAG
* nfc: Don't try to auth NTAG on read if we already authed
* nfc: Add title for all pages read but failed auth for NTAG auth
* nfc: Add faster auth callback patch
* lib: Remove scons submodule from index
* nfc: Revise MFUL unlock UI flow
* nfc: Disallow MFUL unlock with reader if card not read yet. Trying to read first results in either needing to make a new scene or badly jury rigging other scenes, so let's just not do that
* f7: Bump API symbols
* Format code

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 03:16:22 +09:00
Michael Huebler
1b3156521c NFC: Accept non-parsed apps in Mifare DESFire. (#2041)
* NFC: Accept non-parsed apps in Mifare DESFire. Fixes #2040

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 02:14:13 +09:00
Stephen Kent
a82c3ccc22 NFC: Fix MIFARE DESfire info action to open app menu (#2058)
When examining a MIFARE DESfire card, selecting "More >" currently leads
to the file menu for a single application even if the scanned card
contains multiple applications.

On examining the source code, a MIFARE DESfire application selection
menu is present as `NfcSceneMfDesfireData`. This change updates the
MIFARE DESfire Info "More >" action to open the application selection
menu. That menu may then be used to open the file selection menu for any
application in the read MIFARE DESfire card data.

Tested interactively with
c4cbdcd947/nfc/Desfire.nfc

Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 02:05:24 +09:00
Maksim Derbasov
e121e6a287 Fix for spelling (#2051)
* Fix for spelling
* Review iteration

Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 01:51:51 +09:00
Smooklu
03140e4349 Bluetooth Remote to HID Remote (#2039)
* WIP BT + USB Hid
* Refactoring Submenus/Views
* Changed to bool instead of enum
* Revamp finished
* Removed usb_keyboard
* Renaming device_types that can do USB+BT
* Removed error view
* Renaming folder structure and file names
* Fixed views.h
* Fixed hid.h
* Fixed hid_mouse.c
* Fixed a accidetnal renaming
* Apps: add missing view remove call in hid app destructor
* Hid app: hal abstraction, split into bluetooth and usb remotes. Fbt: customizable icon symbol name.
* Hid app: update usb remote icon
* Hid: single status change routine
* HID App: final touches
* HID App: rename BtHidTikTok to HidTikTok, format sources
* HID App: fix comma in keyboard

Co-authored-by: あく <alleteam@gmail.com>
2022-11-29 01:27:16 +09:00
MX
43d35b42e5 Fix auriol protocol naming 2022-11-27 17:07:51 +03:00
MX
7ed56fca54 Update changelog and readme 2022-11-27 07:12:34 +03:00
MX
bc8fe6144b Merge pull request #187 from StellarStoic/dev
Adding Slovenian, Bosnian and Croatian layout
2022-11-27 07:12:04 +03:00
MX
0e4cda851c Update Temp sensor plugin
https://github.com/Mywk/FlipperTemperatureSensor
2022-11-27 02:50:15 +03:00
MX
6267dc7d5b Update HEX Viewer 2022-11-27 02:44:10 +03:00
MX
1a33e1a00b WS: Add protocol Auriol HG0601A
Made by @LY2NEO
2022-11-27 02:32:43 +03:00
StellarStoic
2985268fe3 Adding Slovenian, Bosnian and Croatian layout
Slovenian (si) / Croatian (hr) keyboard layout, which is also the default layout for Bosnian (ba) (Latin, Bosnia and Herzegovina)
2022-11-26 22:49:56 +01:00
MX
5cdf339a95 Merge remote-tracking branch 'origin/dev' into dev 2022-11-26 17:23:49 +03:00
MX
08e533ccf2 SubGHz: Fix Came Atomo and NiceFlorS counters
add check for protocols with 16bit counters, to block them for going higher than 16bit
2022-11-26 17:23:36 +03:00
MX
a63e0dbec7 Merge pull request #181 from vadrozh/dev
Possible keys for transport cards by novacard.ru
2022-11-25 00:59:17 +03:00
MX
513c352820 Update readme 2022-11-24 18:32:04 +03:00
MX
bf62f66dc8 SubGHz: Fix keeloq, SL, counter going higher than 16bits
Proper reset to 0 after we get to 0xFFFF
2022-11-24 17:03:50 +03:00
Vadim
ab65c17dd5 possible keys for transport cards by novacard.ru 2022-11-24 11:52:04 +06:00
MX
6e7b7f1d89 Move reindex after release 2022-11-24 04:02:22 +03:00
MX
4f9b4d80c7 Add extra pack link to release to notifications 2022-11-24 03:45:16 +03:00
MX
bd21970ccb Fix builds 2022-11-24 03:40:42 +03:00
MX
79193e7f37 Update changelog and readme 2022-11-24 03:27:43 +03:00
MX
f086d5b7a3 Merge pull request #180 from TQMatvey/dev
SubGhz: Allow setting RSSI trigger to beggining
2022-11-24 03:25:41 +03:00
MX
757b218397 Revert SubGhz FA changes 2022-11-24 03:16:31 +03:00
MX
0321717a86 Add 3 plugins to be included in base package
Solitaire, Blackjack, HEX Viewer
2022-11-24 03:00:15 +03:00
TQMatvey
2a5d629318 SubGhz: Allow setting RSSI trigger to beggining 2022-11-24 06:52:44 +07:00
MX
6ebdf6dffb Update wifi marauder companion
and apply same fix to wifi scanner and wifi deauther
2022-11-24 02:23:40 +03:00
MX
b6435374d7 Update TOTP
https://github.com/akopachov/flipper-zero_authenticator/releases/tag/v1.5.0
2022-11-24 01:19:19 +03:00
MX
2c51c8cb31 Update FipperZero-DHT-Monitor
https://github.com/quen0n/FipperZero-DHT-Monitor
2022-11-24 01:15:38 +03:00
MX
6d7e424fdf Update subbrute
Fix ansonic text
2022-11-24 01:11:45 +03:00
MX
8e14291363 Merge branch 'fz-dev' into dev 2022-11-23 21:30:59 +03:00
MX
c9473e6d30 Update subghz bruteforcer
Add ansonic protocol support
2022-11-23 21:30:16 +03:00
Nikolay Minaylov
ffa6249b64 [FL-2985] Fix U2F HID vulnerability #2042
Co-authored-by: あく <alleteam@gmail.com>
2022-11-24 03:12:53 +09:00
MX
daea8a963d Apply subghz FA changes from OFW, update API symbols 2022-11-23 19:46:31 +03:00
MX
7829428455 Merge branch 'fz-dev' into dev 2022-11-23 19:21:50 +03:00
MX
59022b4ff7 Merge pull request #176 from PharoahCoder/dev
Update cli_commands.c To add src command for people exploring cli
2022-11-23 19:17:38 +03:00
MX
bbf4d90ec1 Fix, add forgotten UNUSED macro 2022-11-23 19:14:17 +03:00
MX
0f3c0aaa11 Fix dev builds again 2022-11-23 19:04:58 +03:00
MX
78a4c82bf5 Merge pull request #170 from lucemans/patch-2
Introduce ENS to README.md
2022-11-23 18:47:25 +03:00
MX
af1ecd82ba Merge pull request #169 from lucemans/patch-1
Discord in README open in new tab
2022-11-23 18:46:25 +03:00
MX
963c6a95f3 Merge pull request #175 from GottZ/patch-1
[FAP] htu21d falsely reading temp as humidity
2022-11-23 18:45:53 +03:00
MX
04761b12c0 Merge pull request #178 from TQMatvey/dev
Power: Show battery percentile while charging
2022-11-23 18:45:20 +03:00
MX
078e2c2db9 Merge pull request #171 from NaejEL/i2cTools-newUI
New UI for I2C Tools
2022-11-23 18:44:13 +03:00
MX
063b13df00 Merge branch 'dev' into i2cTools-newUI 2022-11-23 18:41:09 +03:00
MX
37159c7506 Fix dev builds 2022-11-23 18:03:48 +03:00
MX
3da1c229bb CI/CD Improvements, dev builds 2022-11-23 17:56:51 +03:00
Anna Prosvetova
51d478489a Infrared: Add Olimpia Splendid AC (#2038)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 22:43:48 +09:00
Skorpionm
9bb0dbaa3e SubGhz: frequency analyzer. 2dbi desensitization, rssi averaging to reduce jitter, new rssi indicators in log_mode, GUI fix (#2020)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 22:31:39 +09:00
Kyhwana Pardus
1c8451fad4 Fix typos in subghz_cli.c (#2030)
Fix up the "receive" typos

Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 22:23:11 +09:00
MangoTornado
669822cdd2 Fix typos in various outputs (#2032)
* Fix typos in various outputs
* Update u2f_view.c

Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 22:15:08 +09:00
lauaall
4f3ef83c77 Docs: fix typos (#2016)
Fixed typos in UnitTests.md

Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 21:59:55 +09:00
Sergey Gavrilov
c511c67e71 Core: thread allocation shortcut (#2007)
* Core: thread alloc+set shortcut
* Apps: use thread allocation shortcut
* Mark some service threads as services
* Init BT as soon as possible

Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 21:49:17 +09:00
Skorpionm
b9c483fbf8 [FL-2975] WS: add protocol GT-WT02 (#2001)
* WS: add protocol GT-WT02
* WS: fix text "About" scene

Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 18:44:49 +09:00
Skorpionm
00fcd9cfcd [FL-2976] SubGhz: add protocol "Ansonic" (#2000)
* SubGhz: add protocol "Ansonic"
* SubGhz: fix encoder "Ansonic"
* SubGhz: add unit_test "Ansonic"
* SubGhz: fix flag
* SubGhz: protocol "Ansonic" fix timing

Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 18:29:30 +09:00
Skorpionm
cf5b87f82e SubGhz: add protocol Nice_Flo 20bit (#1983)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 17:28:44 +09:00
MX
8bbfadffe5 Remove not widely used frequency from hopper 2022-11-22 16:37:54 +03:00
TQMatvey
15dcf73083 Power: Show battery percentile while charging 2022-11-22 12:51:47 +07:00
PharoahCoder
5ef358df31 Update cli_commands.c 2022-11-21 17:41:40 +04:00
Jan-Stefan Janetzky
a5e3df0375 [FAP] htu21d falsely reading temp as humidity
compiled and tested by blowing onto the sensor.

fixes #174
2022-11-20 23:53:11 +01:00
Jean LE QUELLEC
fae17d2eb9 New UI 2022-11-19 13:46:26 +01:00
Luc
c957bf09e0 Update ReadMe.md 2022-11-18 17:16:48 +01:00
Luc
817aa273f4 Discord in README open in new tab
Changes the discord link in the readme to open in a new tab instead of overwrite the current tab
2022-11-18 15:12:55 +01:00
MX
0adcaf7592 Update infrared assets
by @Amec0e
2022-11-18 00:31:49 +03:00
MX
7e8bf03b25 Fix DTMF Dolphin
Add forgotten scene and menu item
@litui check this commit
2022-11-17 22:43:04 +03:00
MX
a6886b096e Update DTMF Dolphin
https://github.com/litui/dtmf_dolphin
2022-11-17 22:35:13 +03:00
MX
a0dc770b98 Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2022-11-17 22:33:31 +03:00
MX
a1b368abda Update i2c tools
https://github.com/NaejEL/flipperzero-i2ctools
2022-11-17 22:30:25 +03:00
MX
5681016dce SubGHz: Fix starline encoder
o_O
2022-11-17 02:05:14 +03:00
MX
17cb7533cb SubGHz: FA -> Save last trigger level 2022-11-17 00:37:35 +03:00
MX
1e183d5450 SubGHz: Add 440.175 Mhz 2022-11-16 14:26:48 +03:00
MX
0e9f6bef77 Speedup subghz favourites
if custom modulation was used, its saved in file itself, so no need to load it when using quick access from favourites
2022-11-15 23:00:30 +03:00
MX
0f81248579 Add new freq and modulation to user config 2022-11-15 22:46:58 +03:00
MX
337c5b5a8b Merge remote-tracking branch 'origin/dev' into dev 2022-11-15 04:43:01 +03:00
MX
be97baef06 Plugins: ibutton fuzzer improvements
and rfid fuzzer too
2022-11-15 04:42:54 +03:00
MX
d0ccf11992 Merge pull request #164 from rf-bandit/wifi-marauder-bt
Wifi marauder BT menus option
2022-11-15 04:41:47 +03:00
MX
eb3523b8e2 Replace func naming to more correct one 2022-11-15 04:22:43 +03:00
rf-bandit
073a0942e8 Add files via upload
Add sniffbt and sniffskim as menu option for ESP-32-WROOM
2022-11-13 23:38:10 -07:00
rf-bandit
52bd4a1a3c Add files via upload
Adds sniffbt and sniffskim as option (ESP-32-WROOM)
2022-11-13 23:34:41 -07:00
MX
5989651b10 Plugins: i2c tools fix name display 2022-11-13 04:21:58 +03:00
MX
bb8b9f0b57 Fix builds 2022-11-13 03:51:05 +03:00
MX
aface38b42 RFID Fuzzer fixes 2022-11-13 02:56:32 +03:00
MX
f7fb055ae3 Update readme and changelog 2022-11-13 01:14:06 +03:00
MX
1b64a95ec6 Plugins: Add lightmeter
https://github.com/oleksiikutuzov/flipperzero-lightmeter
2022-11-12 23:13:09 +03:00
MX
de5eb16ef2 New animation L3_FlipperMustache_128x64
animation by @Svaarich
2022-11-12 22:27:27 +03:00
MX
c3731e6540 CI/CD: Builds with no custom anims 2022-11-12 22:24:22 +03:00
MX
0e338f7964 Merge branch 'fz-dev' into dev 2022-11-12 22:22:38 +03:00
MX
4240b59311 SubGHz: Fix magellan display issue 2022-11-12 22:16:02 +03:00
hedger
41de5f3c52 fbt: more fixes for windows environment #2011 2022-11-13 03:28:29 +09:00
hedger
b56fed477a Path handling fixes in toolchain download #2010 2022-11-13 02:22:40 +09:00
MX
02fe403b2b SubGHz: Fix wrong error message in history 2022-11-12 16:58:35 +03:00
MX
a821b80ffc Archive: Show loading popup on delete 2022-11-12 16:47:00 +03:00
MX
950dee48a0 Merge branch 'fz-dev' into dev 2022-11-12 16:43:12 +03:00
Nikolay Minaylov
73441af9c6 BadUSB and Archive fixes (#2005)
* BsdUsb: fix empty lines handling
* Archive: folders and unknown files rename fix

Co-authored-by: あく <alleteam@gmail.com>
2022-11-12 20:55:42 +09:00
hedger
f9730bcafe fbt: lint fixes (#2008)
* lint: exclude "lib" subfolder from naming checks; fbt: moved LINT_SOURCES from literal strings to Dir() nodes
* lint: also exclude hidden directories

Co-authored-by: あく <alleteam@gmail.com>
2022-11-12 19:03:22 +09:00
MX
3c7a4eeaed iButton: Fix header "Saved!" message stays on other screens (#2003)
* iButton: Fix header "Saved!" message stays on other screens
* SubGhz,iButton: proper popup reset

Co-authored-by: あく <alleteam@gmail.com>
2022-11-12 18:45:19 +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
MX
368079f6f4 Fix DHT Monitor icon 2022-11-11 21:53:29 +03:00
MX
8b71ac9483 Fix FlipperCity animation
animation by @Svaarich
2022-11-11 21:46:21 +03:00
MX
3cba34bbc8 SubGHz: Add frequencies 434.075, 434.390 2022-11-11 18:46:35 +03:00
MX
741c784f2d Introducing ibutton fuzzer 2022-11-11 18:12:55 +03:00
MX
394507bc81 RFID Fuzzer: allow holding left right to change delay faster
hold TD button to add +10 or -10 to time delay
2022-11-11 17:05:33 +03:00
MX
8240b25fe0 iButton: header message fix 2022-11-11 17:04:32 +03:00
MX
1d196b41e9 Morse code cleanup text by pressing back 2022-11-11 04:57:27 +03:00
MX
666d30f2dd API compatibility with OFW part 2
+ Subghz protocol Princeton API symbols added
2022-11-11 03:45:41 +03:00
MX
95df532612 Frequency analyzer: Add counter, GUI fixes, allow Ok button - see desc.
When signal is present (when frequency window shows black background)
2022-11-11 03:45:09 +03:00
MX
64774f191f TOTP Update - "BadUSB" type key into pc mode 2022-11-11 01:10:45 +03:00
MX
f6eed35729 Reorder main menu 2022-11-11 00:54:09 +03:00
MX
930b369812 Merge branch 'fz-dev' into dev 2022-11-10 21:38:03 +03:00
Skorpionm
721ab717d7 [FL-2961] SubGhz: properly handle storage loss (#1990)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-11 02:14:44 +09:00
lauaall
aec36e7041 Fixed typos (#1999)
Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-11 01:48:58 +09:00
Astra
e7c4b40dbe Force card types in extra actions (#1961)
* Mifare Classic forced read
* Add all the needed card types
* nfc: remove unused scene
* nfc: remove unused worker state
* nfc: fix read card type scene state usage
* nfc: move NfcReadMode to NfcDevData struct
* nfc: fix bank card reading and scene navigation
* nfc magic: fix magic deactifate function

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-11 01:29:57 +09:00
Astra
820afd2aec NFC Unit tests part 1.1 (#1927)
* Mifare Classic 1/4K, 4/7b uid, NFC-A: NFC-A is not complete yet, as there are no 4b uid tests. Also, Mifare Classic tests don't cover the key cache yet.
* NFC unit tests require access to the NFC app
* Made nfc_device_save accept full path as an argument
* Move from cstrs to furi strings and fix logic
* nfc tests: fix memory leak
* nfc: add mf_classic_get_total_blocks() to API
* nfc tests: simplify nfc tests
* nfc: fix memory leak in shadow file saving
* nfc: fix set uid scene
* nfc: fix saving files
* nfc: fix preload nfc file path
* nfc: remove comments

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-11 01:20:35 +09:00
Rom1
a66e8d9ac9 corr: bad path for furi core (#1975)
* corr: bad path for furi core
* Documentation: exclude submodules
* Documentation: wider folder list

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-11 00:21:28 +09:00
あく
f94e8f4ac8 Rpc: increase stack size, fix stack overflow (#1997) 2022-11-10 23:56:08 +10:00
hedger
a959fa32bc fbt: 'target' field for apps; lib debugging support (#1995)
* fbt: added 'target' field to application manifest
* fbt: earlier pagination setup for gdb
* fbt: added LIB_DEBUG flag
* fbt: sdk: added SDK_MAP_FILE_SUBST
2022-11-10 20:55:11 +09:00
MX
3c094c4741 update docs 2022-11-10 12:31:50 +03:00
MX
625b1eb126 move -+ in freq analyzer, swap up & down button, more in desc
now its more intuitive and easier to select values in freq analyzer history
2022-11-10 12:30:01 +03:00
MX
22902aabcc Cleanup code in unirf, fix issue #153 2022-11-10 12:15:10 +03:00
MX
b93f2dc293 Furi Region Mocks, fix protocol dict funcs was disabled in API 2022-11-10 10:45:51 +03:00
MX
af40b6b020 Move NRF24 driver into plugins, see desc
Major API version downgraded to official one, adding support for launching OFW apps on unleashed, part 1
2022-11-10 10:30:36 +03:00
MX
ef72ad2462 update totp 2022-11-10 08:32:21 +03:00
MX
3420cda83a update i2c tools 2022-11-10 08:23:54 +03:00
MX
68219f0d7b update readme 2022-11-10 08:08:51 +03:00
MX
0a0c06222a fix links 2022-11-10 08:05:28 +03:00
MX
52650ab0e3 Merge pull request #154 from msvsergey/Barcode-Generator
Barcode generator: rfct, ux improvements, implement EAN-8.
2022-11-10 07:55:40 +03:00
MX
dd601dd940 Merge branch 'dev' into Barcode-Generator 2022-11-10 07:54:26 +03:00
MX
933471e2fb Merge pull request #157 from pbek/patch-1
Fix link to "TOTP (Authenticator) config description"
2022-11-10 07:15:56 +03:00
MX
317c9ec190 Merge pull request #161 from krolchonok/fix-hcsrnaming
fix hc-sr
2022-11-10 07:14:59 +03:00
MX
e90d335cdf Add value_index to API symbols 2022-11-10 07:13:02 +03:00
MX
1657604eb2 remove srand calls 2022-11-10 07:07:35 +03:00
MX
684fdc632f Merge branch 'fz-dev' into dev 2022-11-10 06:57:08 +03:00
krolchonok_z
c3bdbcd5cc fix naming hc-sr 2022-11-09 22:25:23 +03:00
krolchonok_z
65a593c52e Update application.fam 2022-11-09 22:21:25 +03:00
krolchonok_z
9e39f82906 fix hc-sr 2022-11-09 22:07:26 +03:00
gornekich
3985b456c3 NFC: fix crash on MFC read (#1993)
* nfc: fix nfc_worker_stop logic
* nfc: fix stop order

Co-authored-by: あく <alleteam@gmail.com>
2022-11-10 03:12:55 +09:00
あく
c89e5e11a4 Furi: show thread allocation balance for child threads (#1992) 2022-11-09 21:33:09 +04:00
Georgii Surkov
9f0aef330e [FL-2956] Initial unit test docs (#1984)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-09 02:38:28 +09:00
Samuel Stauffer
328d049b6a Add Acurite 609TXC protocol to weather station (#1987)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-09 02:07:55 +09:00
Max Andreev
ce294c3b1e Update toolchain to version 19. Update codeowners. Fix amap analyze. (#1986)
* Up toolchain to 19
* Fix amap_analyse.yml
* Github: update codeowners

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-11-09 01:56:49 +09:00
Patrizio Bekerle
e81b7be232 Fix link to "TOTP (Authenticator) config description" 2022-11-08 09:03:57 +01:00
Sergey Gavrilov
4d11213494 DAP-Link: show error if usb is locked (#1982) 2022-11-08 01:15:58 +09:00
Sergey Monchenko
e38895794b Barcode generator: rfct, ux improvements, implement EAN-8. 2022-11-07 18:31:17 +03:00
hedger
2d6c2886ae fbt: compile_db fixes (#1981)
* fbt: forked compilation_db tool
* fbt: fixes for static analysis
* pvs-studio: ignoring more generic warnings
* fbt: util: added extract_abs_dir
* vscode: added fap-set-debug-elf-root for debug configurations
2022-11-07 23:54:41 +09:00
Samuel Stauffer
aa2ecbe80f infrared: add Kaseikyo IR protocol (#1965)
* infrared: add Kaseikyo IR protocol

Add Kaseikyo IR protocol support. This protocol is also called the Panasonic protocol and is used by a number of manufacturers including Denon.

The protocol includes a vendor field and a number of fields that are vendor specific. To support the format of address+command used by flipper the vendor+genre1+genre2+id fields are encoded into the address while the data is used for the command.

There are older versions of the protocol that used a reverse bit order that are not supported.

Protocol information:
- https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_Kaseikyo.hpp
- http://www.hifi-remote.com/johnsfine/DecodeIR.html#Kaseikyo
- https://www.denon.com/-/media/files/documentmaster/denonna/avr-x3700h_avc-x3700h_ir_code_v01_04062020.doc

* Format and add unit test to Kaseikyo IR codec.

Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
2022-11-07 18:38:04 +04:00
Skorpionm
65005e71d2 WS: fix show negative temperature (#1980) 2022-11-07 02:30:02 +09:00
hedger
0a86ad43ca fbt: fix for launch_app (#1978) 2022-11-06 17:39:50 +10:00
あく
e8913f2e33 Code cleanup: srand, PVS warnings (#1974)
* Remove srand invocation

* PVS High priority fixes

* PVS High errors part 2

* Furi: heap tracing inheritance

* Furi add __builtin_unreachable to furi_thread_catch
2022-11-05 18:07:24 +03:00
hedger
04e50c9f89 fbt: fixes for ufbt pt3 (#1970)
* fbt: replaced debug dir paths with FBT_DEBUG_DIR
* scripts: updated requirements.txt
* fbt: fixed wrong import
* fbt: removed delayed import for file2image
* fbt: added UPDATE_BUNDLE_DIR internal var
* fbt: cleaner internal management of extapps
* applications: added fap_libs for core apps to link with resources when building with --extra-ext-apps
* fbt: removed deprecation stub for faps
* fbt: added quotation for icons build cmd
* fbt: reworked BUILD_DIR & fap work dir handling; fap debug: using debug elf path from fbt
* fbt: explicit LIB_DIST_DIR
2022-11-05 20:47:59 +09:00
MX
7175459bcd update assets and changelog 2022-11-04 18:09:07 +03:00
MX
c709b0b126 Update DHT monitor 2022-11-04 17:51:56 +03:00
MX
18f49c2644 update changelog 2022-11-04 15:22:06 +03:00
MX
939a77b4e7 Update nfc magic name and icon 2022-11-04 15:04:10 +03:00
MX
1bb6113eaa bump 2022-11-04 14:41:23 +03:00
MX
0ab400a27e Merge branch 'fz-dev' into dev 2022-11-04 14:34:34 +03: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
Sergey Monchenko
3bd74b7f01 SubGhz: fix incorrect response in rpc mode. Code cleanup. (#1964)
* Code cleanup
* SubGhz: correct logic in RPC
* SubGhz: do not blink on app rpc fail

Co-authored-by: あく <alleteam@gmail.com>
2022-11-04 15:08:51 +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
あく
e3ea5bca76 Dolphin: add L1_Mods_128x64 animation (#1973) 2022-11-04 14:44:28 +10:00
MX
8ea0178a0d Merge pull request #149 from an4tur0r/feature/flappy_assets
Flappy Bird: draw bird via icon animation
2022-11-03 19:11:28 +03:00
MX
24d65e8655 Fix badusb gui 2022-11-03 16:57:12 +03:00
MX
d92212f0ea Merge branch 'fz-dev' into dev 2022-11-03 16:56:15 +03:00
Alexandre Díaz
60d125e72a subghz: add analyzer frequency logs (#1914)
* subghz: add analyzer frequency logs
* SubGhz: switch to change on short press
* SubGhz: use full RSSI bar for history view

Co-authored-by: あく <alleteam@gmail.com>
2022-11-03 16:57:56 +09:00
an4tur0r
bb2bcc63a4 Flappy Bird: draw bird via icon animation 2022-11-03 10:10:54 +03:00
head47
eee90c6c40 Run Bad USB immediately after connection (#1955)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-03 14:21:44 +09:00
Nikolay Minaylov
95182b266c BadUSB scrolllock typo fix (#1968)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-03 13:42:54 +09:00
MX
7973013085 Fix DHT22 timeout bug
as suggested by @quen0n
2022-11-03 02:13:25 +03:00
MX
0b1f573a72 update naming 2022-11-03 00:53:28 +03:00
MX
677de32026 Revert TOTP changes
"Preload failed, invalid file"
2022-11-03 00:41:17 +03:00
MX
5ac2431cd1 update readme and changelog 2022-11-03 00:26:19 +03:00
MX
4b408b6988 Merge pull request #148 from msvsergey/flappy-animation-fix
Flappy: Fix animation.
2022-11-03 00:08:49 +03:00
MX
af1647c84b Update DHT montior plugin 2022-11-02 23:52:03 +03:00
MX
356389ace9 Disable halloween theme
New xmas theme is coming in december :)
2022-11-02 23:51:47 +03:00
MX
345d9704fd Plugins: Added Game15 + run fbt format 2022-11-02 23:39:54 +03:00
nminaylov
0b2867aaa4 BadUSB scrolllock typo fix 2022-11-02 23:32:01 +03:00
MX
fe199ab54a Fix part 2 2022-11-02 23:19:33 +03:00
MX
adab2b9e03 Update and fix TOTP
fix - added this in every button event switch:
default:
                    break;
2022-11-02 23:10:14 +03:00
MX
c8bc9e26e0 Fix part 1 2022-11-02 23:07:00 +03:00
MX
e1f5999095 update lib paths 2022-11-02 22:54:44 +03:00
MX
79b37556d4 Merge branch 'fz-dev' into dev 2022-11-02 22:53:12 +03:00
MX
9c4612e571 Plugins: New AM2320 Sensor plugin 2022-11-02 22:18:08 +03:00
Skorpionm
0652830c51 [FL-2940] WS: add protocol Ambient_Weather (#1960)
* WS: add protocol Ambient_Weather
* WS: fix link
* WS: removing unused code

Co-authored-by: あく <alleteam@gmail.com>
2022-11-03 01:24:07 +09:00
Georgii Surkov
c417d467f7 Handle storage full error (#1958)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-03 01:13:06 +09:00
Konstantin Volkov
a09d0a8bd4 fixed job name, renamed compile step id (#1952)
Co-authored-by: あく <alleteam@gmail.com>
2022-11-03 00:21:43 +09:00
hedger
ebc2b66372 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>
2022-11-03 00:15:40 +09:00
Vasyl "vk" Kaigorodov
abfa804ae0 Gui: refactor buttons remapping (#1949)
* Gui: refactor buttons remapping
  Instead of calling 3 separate functions with a ton of switch/case statements,
  use a 2-dimensional lookup table to remap buttons based on the orientation.
* Gui: cleanup input mapping and fix incorrect asserts
* SnakeGame: handle input special case

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-11-02 23:36:17 +09:00
Sergey Monchenko
9a0eacc91c Fix flappy animation. 2022-11-02 14:40:54 +03:00
MX
a22b107335 Plugins: Update Wifi Marauder
https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion
2022-11-02 13:28:43 +03:00
MX
0f1e03fa51 Fix: proper deinit of gpio and spi bus in NRF24 driver 2022-11-02 03:42:38 +03:00
MX
2ab9769b4b Merge remote-tracking branch 'origin/dev' into dev 2022-11-02 01:54:42 +03:00
MX
ee665e1089 Merge pull request #144 from wh00hw/dev
Morse Code FAP
2022-11-02 01:52:59 +03:00
MX
5e940ea9d0 Merge pull request #145 from huuck/usbkeyboard_function_keys
added additional row for function keys
2022-11-02 01:47:38 +03:00
MX
f3d45ab350 Merge pull request #147 from quen0n/dev
New plugin - DHT Monitor
2022-11-02 01:44:22 +03:00
MX
7d139517b8 add plugin as plain files 2022-11-02 01:38:09 +03:00
Victor
f51877b7c8 Revert "New plugin - DHT Monitor"
This reverts commit bb5c545211.
2022-11-02 01:35:08 +03:00
MX
92b8a256e4 Snake game: Fix food spawn bug 2022-11-02 01:29:01 +03:00
MX
0d27086c40 Merge branch 'fz-dev' into dev 2022-11-02 01:09:39 +03:00
MX
46bffba498 replace furi check hotfix with ofw proper fix 2022-11-02 01:08:54 +03:00
MX
165d9972e7 SubGHz Fixes: BFT fix, other small fixes 2022-11-02 01:05:05 +03:00
Victor
bb5c545211 New plugin - DHT Monitor 2022-11-01 22:15:58 +03:00
huc
ddaa8ec1fd added additional row for function keys 2022-11-01 13:51:30 -04:00
あく
104a1998a5 Furi: raise bkpt only if debug session initiated, add debug support for release builds (#1957)
* Fix hard crash on some custom firmwares in RELEASE mode
* Furi: anya wa erai, anya wa eleganto, raise bkpt only if debug session initiated, add debug support for release builds

Co-authored-by: DerSkythe <skif@skif.ws>
2022-11-01 19:27:25 +09:00
wh00hw
38297cb7af Update ReadMe.md 2022-11-01 11:09:55 +01:00
wh00hw
419a90aa28 Add MorseCode fap 2022-11-01 11:08:53 +01:00
MX
348c4c3b5f update link 2022-10-30 02:05:23 +03:00
MX
0bcfe7b7a4 update readme and changelog 2022-10-30 02:02:42 +03:00
MX
7fe0e6c073 update changelog 2022-10-29 23:17:34 +03:00
MX
28d9d5194f simpler version
as @DerSkythe suggested
2022-10-29 20:13:07 +03:00
MX
296bdfd433 actual proper fix of furi_halt 2022-10-29 19:36:40 +03:00
MX
ddc6265920 Revert "downgrade check.c/.h - see desc"
This reverts commit 2d3469e057.
2022-10-29 19:21:23 +03:00
MX
2d3469e057 downgrade check.c/.h - see desc
(Furi: smaller crash routine) causes crashes when furi_halt is called, why? I donT knoW
This is temporary solution until real bug will be found
2022-10-29 19:15:46 +03:00
MX
8e4595e4f7 fix nfc worker merge issues 2022-10-29 17:21:30 +03:00
MX
328fcdd924 update chlog 2022-10-29 16:09:28 +03:00
MX
0dc55957ae Merge pull request #141 from TQMatvey/dev
Wifi Marauder: make "add random" not overlap > symbol
2022-10-29 16:08:37 +03:00
MX
5319c69e59 update changelog 2022-10-29 15:48:26 +03:00
MX
1115a0b877 fix subghz bruteforcer 2022-10-29 15:45:51 +03:00
TQMatvey
908eca335e Wifi Marauder:make "add random" not overlap > symbol 2022-10-29 13:49:29 +07:00
MX
e242941d70 update changelog 2022-10-29 03:38:40 +03:00
MX
4e66d37ac8 fix i2c tools menu bug 2022-10-29 03:36:18 +03:00
MX
0dff574757 downgrade TOTP to 1.1.0 due to strange bug
also keep new icons layout
2022-10-29 03:33:02 +03:00
MX
6acf76e4ed fix wrong import 2022-10-29 02:58:22 +03:00
MX
d7c75b9db8 fix tg message 2022-10-29 02:53:11 +03:00
MX
4fd52b0564 update changelog 2022-10-29 02:29:25 +03:00
MX
95bfaa8b23 update changelog and readme 2022-10-29 02:19:29 +03:00
MX
639988a979 format 2022-10-29 00:45:20 +03:00
MX
0a63b2fdd8 upd icon file naming 2022-10-29 00:40:17 +03:00
MX
00b430a912 Merge pull request #140 from ahumeniy/unleashed_flappy_pilars_visibility
Increase pilars line width to improve visibility
2022-10-28 21:50:08 +03:00
MX
73b8d496fe infrared api for .fap's 2022-10-28 21:44:36 +03:00
MX
d52d9ffe79 update keeloq with new magic type 2022-10-28 21:40:59 +03:00
MX
0dcf752342 update subbrute 2022-10-28 20:05:50 +03:00
MX
9b55076eed Revert "Merge branch 'fz-dev' into dev"
This reverts commit c4479a9056.
2022-10-28 19:55:24 +03:00
MX
c4479a9056 Merge branch 'fz-dev' into dev 2022-10-28 19:55:17 +03:00
MX
e7316464cb Merge branch 'fz-dev' into dev 2022-10-28 19:51:50 +03:00
Vladimir
85d341104f Update ac.ir (#1945)
Added conditioner Saturn CS-TL09CHR ir signals (Dh, Cool_hi, Cool_lo, Heat_hi, Heat_lo, Off)

Co-authored-by: あく <alleteam@gmail.com>
2022-10-29 01:50:07 +09:00
MX
cb47edf82f rm unused file 2022-10-28 19:45:59 +03:00
Georgii Surkov
d5f791b1fa [FL-2911] IR Universal Audio Remote (#1942)
* Add Audio universal remote
* Add signal library for Audio Universal Remote
* Update UniversalRemotes.md
* Added IR profile for Samsung K450 soundbar (#1892)
* Add symbols to API file
* Rearrange Audio remote buttons
* Add new icons, remove old ones
* Remove old signals, add new ones
* Add universal audio remote to CLI, refactor code
* Improve help text
* Correct formatting
* Update UniversalRemotes.md
* Furi: restore correct api_symbols.csv version

Co-authored-by: Alexei Humeniy <yo@ahumeniy.net>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-29 01:43:54 +09:00
MX
4da3f9cf15 Merge branch 'fz-dev' into dev 2022-10-28 19:43:22 +03:00
MX
8333ebd401 new icons for subghz signals and infrared remotes
by @Svaarich
2022-10-28 19:41:56 +03:00
MX
3d25838a53 update gps
https://github.com/ezod/flipperzero-gps
2022-10-28 19:23:02 +03:00
MX
3ea6d59c2f fmt + update subbrute submodule 2022-10-28 19:18:42 +03:00
MX
5277933980 finish icon changes 2022-10-28 19:12:31 +03:00
gornekich
93a6e17ce5 [FL-2933] Mf Classic initial write, update, detect reader (#1941)
* nfc: introduce nfc write
* nfc: add write logic
* nfc worker: add write state
* nfc: add mfc update logic
* nfc: add update success logic
* nfc: add custom card for detect reader
* nfc: update write logic
* nfc: add halt command, add notifications
* nfc: add write fail scene
* nfc: fixes and clean up
* nfc: fix navigation ad notifications
* nfc: fix detect reader nfc data setter

Co-authored-by: あく <alleteam@gmail.com>
2022-10-29 01:10:16 +09:00
MX
0349380347 update i2c tools 2022-10-28 18:46:40 +03:00
Konstantin Volkov
09b622d4ae UnitTests: removed all continue-on-error lines (#1946)
* removed all continue-on-error lines
* Github: add assets deployment after format

Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-29 00:45:22 +09:00
MX
20e3a202aa more icons 2022-10-28 18:44:01 +03:00
MX
0a68d80028 update totp
https://github.com/akopachov/flipper-zero_authenticator
2022-10-28 18:34:35 +03:00
MX
457b9ae2a9 icons upgrade, keeloq fix, api bump 2022-10-28 18:32:52 +03:00
hedger
4b921803cb fbt: fixes for ufbt compat (#1940)
* 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

Co-authored-by: あく <alleteam@gmail.com>
2022-10-29 00:32:06 +09:00
Alexei Humeniy
9e8c841df0 Increase pilars line width to improve visibility 2022-10-28 12:15:59 -03:00
MX
2cfb5bdfc6 Merge branch 'fz-dev' into dev 2022-10-28 18:03:31 +03:00
MX
b287cb4b4a Merge pull request #139 from askoriy/file-show-content
Browser: Context menu to show file content
2022-10-28 17:55:47 +03:00
MX
99ddb235e0 Merge pull request #137 from RogueMaster/ul-betterdummy
Add Dummy Mode Game Shortcuts to Scene & View
2022-10-28 17:32:37 +03:00
Skorpionm
9cd0592aaf SubGhz: add keeloq potocol JCM_Tech (#1939)
* SubGhz: add keeloq potocol  JCM_Tech
* SubGhz: add new metod decoder

Co-authored-by: あく <alleteam@gmail.com>
2022-10-28 23:31:41 +09:00
MX
fa7aa00f57 also allow to use it not in dummy mode 2022-10-28 17:30:53 +03:00
MX
981740bcc6 Merge branch 'dev' into ul-betterdummy 2022-10-28 17:24:26 +03:00
MX
09fec61153 ability to switch animations only when debug -> on 2022-10-28 17:24:10 +03:00
MX
dcf076b11e more checks and limits 2022-10-28 17:16:47 +03:00
Sergey Gavrilov
3434305630 [FL-2937] Remove resources from API to prevent frequent API version increase (#1935)
* Remove all icons from API
* Music player: icons
* Signal generator: icons
* Bt hid: icons
* Weather station: icons
* Picopass: icons
* File browser test: icons
* Example images: documentation
* Remove global assets header
* Fix picopass

Co-authored-by: あく <alleteam@gmail.com>
2022-10-28 23:08:50 +09:00
Konstantin Volkov
492f147568 [FL-2887] actions unit tests runner (#1920)
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-28 22:59:09 +09:00
Oleg Moiseenko
be3ee9f2fe Oregon2 additional sensors defines (#1933)
* added a list of sensors and added several additional temperature and temperature/humidity sensor id's
* now here are only sensors that have test data

Co-authored-by: あく <alleteam@gmail.com>
2022-10-28 22:42:59 +09:00
MX
9fae52166c fixes and improvements 2022-10-28 16:05:17 +03:00
MX
8dab5fd231 Merge branch 'dev' into file-show-content 2022-10-28 14:42:35 +03:00
MX
4c0c70ff64 Merge branch 'fz-dev' into dev 2022-10-28 14:39:14 +03:00
Skorpionm
26f852839a WS: fix Acurite-606TX protocol (#1938)
* WS: fix acurite_606tx protocol
* WS: update version
* WeatherStation: remove break from invalid place

Co-authored-by: あく <alleteam@gmail.com>
2022-10-28 20:16:54 +09:00
Georgii Surkov
f11df49468 [FL-2828] Dolphin score update take 2 (#1929)
* Move DolphinDeedNfcRead
* Move DolphinDeedNfcReadSuccess
* Move DolphinDeedNfcSave
* Move DolphinDeedNfcDetectReader
* Move DolphinDeedNfcEmulate
* Count DolphinDeedNfcEmulate when launched from file browser
* Implement most of the score accounting for NFC
* Fully update Nfc icounter handling
* Move DolphinDeedSubGhzFrequencyAnalyzer
* Update the rest of icounter in SubGHz
* Adjust SubGHz icounter handling
* Adjust LFRFID icounter handling
* Adjust Infrared icounter handling
* Don't count renaming RFID tags as saving
* Don't count renaming SubGHz signals as saving
* Don't count renaming NFC tags as saving
* Adjust iButton icounter handling
* Minor code refactoring
* Correct formatting
* Account for emulating iButton keys from file manager/rpc

Co-authored-by: あく <alleteam@gmail.com>
2022-10-28 16:18:41 +09:00
Aleksandr Skoriy
2fd8c71626 fix missing furi_record_close 2022-10-28 08:24:09 +03:00
Aleksandr Skoriy
ba69ee88f3 Add limitation for file size to not crash 2022-10-28 08:05:31 +03:00
Aleksandr Skoriy
8e362b087a Browser: Context menu to show file content 2022-10-28 05:51:53 +03:00
RogueMaster
88ea7c8d12 Merge branch 'DarkFlippers:dev' into ul-betterdummy 2022-10-27 19:20:27 -04:00
MX
f9c08249a0 add forgotten import 2022-10-27 16:15:48 +03:00
RogueMaster
8995d03fad Merge branch 'DarkFlippers:dev' into ul-betterdummy 2022-10-26 20:57:26 -04:00
MX
b20c01d68b remove saving modulation due to strange bugs with custom modulations 2022-10-27 02:56:21 +03:00
RogueMaster
1d08a8aaa2 Added desktop_events entries that are needed 2022-10-26 19:45:53 -04:00
RogueMaster
2f1d20210b Add Dummy Mode Game Shortcuts to Scene & View 2022-10-26 19:19:14 -04:00
MX
85900c50ff add 330mhz 2022-10-27 01:26:04 +03:00
MX
fc3b62aa41 Merge branch 'fz-dev' into dev 2022-10-27 01:14:07 +03: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
MX
a99d29c0f3 Merge branch 'fz-dev' into dev 2022-10-26 23:09:58 +03:00
MX
72ab2b98ad move things a bit in subghz remote app 2022-10-26 22:47:32 +03:00
Skorpionm
aff99a72e8 SubGhz: fix variable types and CC1101 GPIO initialization optimization (#1931)
* SubGhz: fix variable types
* SubGhz: CC1101 GPIO initialization optimization
* SubGhz: return back gpio init
* SubGhz: cleanup grammar in math and format doxygen comments

Co-authored-by: あく <alleteam@gmail.com>
2022-10-27 04:40:13 +09:00
MX
56b9361bc0 Merge branch 'fz-dev' into dev 2022-10-26 21:57:53 +03:00
MX
7c9f2cd3e8 fix: gpio pins reset to default state, see desc.
fixed wrong text in wifi deauther
fixed hc sr04 gpio
other fixes
2022-10-26 21:54:23 +03:00
Vasyl "vk" Kaigorodov
ebaa84b0c2 Support for setting all screen orientations (#1928)
* Support for setting all screen orientations
* Gui: add flipped orientation to view
* Gui: correct assert conditions in gui_add_view_port

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-27 03:35:49 +09:00
MX
89e27d10a2 Merge branch 'fz-dev' into dev 2022-10-26 19:27:45 +03:00
hedger
a8edb41eae fbt, docs: typo fixes; vscode: fixed deprecated target names (#1926)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-27 00:18:06 +09:00
Skorpionm
5c8df66b7c [FL-2927] SubGhz: add RAW Read threshold rssi (#1911)
* SubGhz: add RAW Read threshold rssi
* SubGhz: update indicator RSSI
* SubGhz: fix record file

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-27 00:13:00 +09:00
Skorpionm
378bf05068 [FL-2934] WS: add protocol Acurite 592TXR (#1916)
* WS: add protocol Acurite 592TXR
* WS: fix decoder Acurite_592TXR
* SubGhz: proper types in math

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-26 23:56:54 +09:00
Max Lapan
406d830fb6 Oregon2 extra (#1924)
* Add support for temp-humid sensor 0x1D20
* Fix protocol type and flags, humidity decoding

Co-authored-by: あく <alleteam@gmail.com>
2022-10-26 22:37:58 +09:00
MX
85573745ec remove 2022-10-26 03:48:06 +03:00
MX
c72b305480 Merge branch 'fz-dev' into dev 2022-10-26 03:44:21 +03:00
gornekich
7d2d2b3dd9 [FL-2932] TikTok: reset cursor after enter and reconnect #1921
Co-authored-by: あく <alleteam@gmail.com>
2022-10-26 07:57:06 +09:00
Anna Prosvetova
d530238fae CI: Update web updater domain (#1919)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-26 07:48:33 +09:00
Astra
30f10dce80 Fix a typo in the factory reset screen "setting" -> "settings" #1917
Co-authored-by: あく <alleteam@gmail.com>
2022-10-26 07:44:27 +09:00
hedger
0adad32418 fbt fixes pt4 (#1899)
* fbt: fixed py scripts for gdb
* fbt: removed compiled dolphin assets from tracked files; resolved cached dependency issues by globally disabling deps cache; changed dependency tracking for dolphin assets
* fbt: fix for "resources" node lookup
* toolchain: bump to v.16 with scons + x64 win binaries
* fbt: using scons from toolchain
* vscode: fixed paths for 64-bit Windows toolchain
* fbt: added colors!
* fbt: moved import validator to ansi lib coloring
* fbt: moved COMSTR vars to tools
* fbt: custom action for fap dist
* fbt: added OPENOCD_ADAPTER_SERIAL configuration var for openocd operations
* fbt: added get_stlink target
* docs: details on libs for faps
* vscode: added DAP config for using Flipper as a debugger for a 2nd Flipper
* fbt: blind deps fix for sdk_origin
* fbt: sdk: moved deployment actions to pure python
* Github: disable disableLicenseExpirationCheck option for pvs

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-26 07:15:02 +09:00
MX
cf4a0b06e2 update temp sensor plugin 2022-10-25 03:59:40 +03:00
MX
fd127cee8c update changelog and readme 2022-10-24 22:01:18 +03:00
MX
e8920ef15a Merge pull request #130 from TQMatvey/dev
Snake: Allow food to spawn anywhere
2022-10-24 21:59:47 +03:00
MX
ee614f11fc fix fap_dist 2022-10-24 21:30:40 +03:00
MX
c2bf81dd64 forgot to add this 2022-10-24 21:28:39 +03:00
MX
c19a8fd636 halloween theme :) 2022-10-24 21:28:04 +03:00
gornekich
5ed9ca838a bt hid: reset cursor for ble tiktok controller 2022-10-24 21:24:21 +03:00
MX
29ab1088bd WS: add protocol Acurite 592TXR
OFW PR 1916 by Skorpionm
2022-10-24 21:22:11 +03:00
MX
517d4ffb73 new plugin, and use clear power in temp sensor 2022-10-24 19:53:59 +03:00
MX
b39e0dd09e cleanup 2022-10-24 18:31:47 +03:00
MX
1e7b45159e again.... 2022-10-24 17:26:03 +03:00
MX
9b75f957d9 update link 2022-10-24 17:15:38 +03:00
MX
e8f8cefd6f Merge branch 'fz-dev' into dev 2022-10-24 17:05:34 +03:00
あく
984d89c6d0 Furi: smaller crash routine (#1912)
* Furi: smaller crash routine
* Furi: small fixes
* Furi: cleanup check routines, more assembly code, force inline of __furi_halt_mcu
* SubGhz: cleanup residual line mess
* Documentation
* Dap-link: fix help
* Furi: replace __furi_halt_mcu with HALT_MCU macros
* Furi: disable IRQ earlier in crash handler
* Furi: properly handle masked mode when detecting ISR
* Ble: allow 0 length feed in rpc_session_feed
* Format sources
* Furi: better crash logic explanation.
* Furi: some grammar in check.h

Co-authored-by: SG <who.just.the.doctor@gmail.com>
2022-10-24 20:50:34 +10:00
TQMatvey
d159c56e28 Snake: Allow food to spawn anywhere
food was only spawning on old snake path from previous firmware versions, now it can spawn on each pixel on new snake path
2022-10-24 09:31:18 +07:00
MX
d0e24bb455 fix oregon2 flags 2022-10-24 00:05:50 +03:00
MX
e00f7009f3 update link 2022-10-23 15:34:24 +03:00
MX
64ecdce5ca fix wrong type in oregon2 protocol 2022-10-22 23:51:44 +03:00
MX
de49bcc80c add a link to tg releases 2022-10-22 23:20:17 +03:00
MX
8793b9f0aa update changelog 2022-10-22 23:10:33 +03:00
MX
c6945313f6 Merge branch 'fz-dev' into dev 2022-10-22 22:12:49 +03:00
MX
fd41176353 furi crash are removed, so, upgrading major version 2022-10-22 22:12:04 +03:00
Max Lapan
d8fbaba7a0 Move Oregon2 to Weather Station FAP (#1910)
* Init copy of oregon2 to weather station app
* WS decoder
* Reuse decoded data
* Delete old protocol
* Delete oregon2 unit test
* Decrement count of random test

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-23 00:50:26 +09:00
MX
de1d83038f Merge branch 'fz-dev' into dev 2022-10-22 18:34:50 +03:00
あく
f8af0c1509 [FL-2892] Gui: update statusbar attention icon and better crash handling (#1908)
* Gui: update statusbar attention icon
* Furi: snapshot registers on crash and restore in halt
* Furi: document check routines
2022-10-23 01:21:10 +10:00
MX
9605af0e85 update changelog 2022-10-22 14:14:53 +03:00
MX
ed080ea5fc fixed bug when mobile app was unable to send raw file
file name should not contain dots
2022-10-22 13:09:41 +03:00
MX
a24ef44289 update changelog 2022-10-21 22:57:57 +03:00
MX
1019025b13 update totp
https://github.com/akopachov/flipper-zero_authenticator
2022-10-21 22:56:58 +03:00
MX
a44739cde9 emulate uid from fav 2022-10-21 22:15:36 +03:00
MX
c19f3a3a6a update changelog 2022-10-21 22:10:21 +03:00
MX
6189511a87 allow uid emulation of emv 2022-10-21 22:00:54 +03:00
MX
12bbe3e68e return saving of emv 2022-10-21 21:58:59 +03:00
MX
12dda6b76b update changelog 2022-10-21 21:52:06 +03:00
MX
92a6cce70e Merge pull request #125 from TQMatvey/dev
Snake: Allow snake to turn anywhere
2022-10-21 21:48:47 +03:00
MX
8fc3140292 Merge pull request #124 from ESurge/unleashed
UniRFRemix - Cleaned up error checking + Bug fix
2022-10-21 21:48:07 +03:00
SG
235af1aacb Dap-link: fix C symbol 2022-10-21 21:45:32 +03:00
TQMatvey
a0a8e0457a Snake: Allow snake to turn anywhere 2022-10-21 13:58:26 +07:00
ESurge
f291c9546d Cleaned up error checking in unirfremix_cfg_set_check
Fixed a bug where all options are disabled and set to N/A but it doesn't show Config is invalid screen.
2022-10-20 23:29:07 -07:00
MX
a73535070c cleanup instruction 2022-10-21 05:35:35 +03:00
MX
8931cb2088 update naming 2022-10-21 00:03:57 +03:00
MX
33e4d2a17f fbt format + fix bug 2022-10-20 23:53:08 +03:00
MX
ca3ce2edce add temp sensor plugin 2022-10-20 23:51:13 +03:00
MX
1ab59bac83 Update how to install
Thanks to @Svaarich for instruction images, and our community for android app screenshots
2022-10-20 22:43:25 +03:00
MX
221bd13e09 update subbrute module 2022-10-20 22:07:45 +03:00
MX
b508fa7dfc update changelog and readme
and assets
2022-10-20 21:43:27 +03:00
MX
fc2a643d12 bump 2022-10-20 21:04:33 +03:00
MX
2a30214ca2 Merge branch 'fz-dev' into dev 2022-10-20 21:04:10 +03:00
MX
120a74ee1a add two new plugins 2022-10-20 21:02:27 +03:00
Skorpionm
c1bb10a694 [FL-2920] WS: add protocol Acurite-606TX, LaCrosse_TX141THBv2 (#1898)
* WS: add protocol Acurite-606TX
* WS: history, added display of the channel (if any) in the general list
* WS: added display of the button state if it is on the transmitter, and displaying the data that is in the signal
* WS: fix batt info
* WS: add protocol LaCrosse_TX141THBv2
* WS; fix syntax
* Furi: bump api_symbols version

Co-authored-by: あく <alleteam@gmail.com>
2022-10-21 02:26:28 +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
MX
f8f7c2b895 bump 2022-10-20 19:22:27 +03:00
MX
96dd3ad1ce WS: add protocol Acurite-606TX, LaCrosse_TX141THBv2
OFW PR 1898 by Skorpionm - Details will be in changelog
2022-10-20 19:14:04 +03:00
MX
2740368b0e Merge branch 'fz-dev'
Conflicts:
	.gitmodules
	firmware/targets/f7/api_symbols.csv
2022-10-20 19:06:56 +03:00
Sergey Gavrilov
f56c94922d CMSIS DAP/DAP Link Debugger (#1897)
* Apps: DAP Link
* API: furi_hal_console_init

Co-authored-by: あく <alleteam@gmail.com>
2022-10-20 20:42:55 +09:00
Sergey Gavrilov
42df7aa04a Fix FuriString oplist (init move) (#1894)
* FuriString, Infrared: fix oplist and drop string_t.
* Elf loader: log size
* Comment fix
* API: furi_hal_console_init
2022-10-20 19:58:11 +09:00
MX
732f744b3c Merge pull request #122 from derskythe/fix-auto-correction
fix by autocorrection
2022-10-20 01:09:55 +03:00
DerSkythe
5c821eb076 fix by autocorrection 2022-10-20 02:07:01 +04:00
MX
e8d62db634 update changelog 2022-10-19 23:47:43 +03:00
MX
e56f97245b Merge pull request #121 from derskythe/dev-master
SubGHz Frequency Analyzer sync with OFW
2022-10-19 23:38:05 +03:00
DerSkythe
26dfa9b9a5 fix for update cursor 2022-10-20 00:18:40 +04:00
Der Skythe
62284209e6 Merge branch 'DarkFlippers:dev' into dev-master 2022-10-19 23:31:07 +04:00
DerSkythe
6d86629e9a minor changes 2022-10-19 23:31:04 +04:00
DerSkythe
0139891d64 Add cursor frame to selected preferred signal 2022-10-19 23:29:46 +04:00
MX
8415dcf823 Merge branch 'fz-dev' into dev 2022-10-19 21:16:59 +03:00
Skorpionm
9a9abd59e9 [FL-2904, FL-2900, FL-2890] WS: add app WeatherStation (#1833)
* WeatherStation: start
* SubGhz: rename protocol magellen -> magellan
* WeatherStation: err Unresolved symbols: {'subghz_protocol_decoder_base_get_string'}
* WeatherStation: fix Unresolved symbols: {'subghz_protocol_decoder_base_get_string'}
* Subghz: add set protocol_items
* WeatherStation: adding your protocols
* WS: add Infactory protocol
* WS: add history
* WS: add setting
* WS: add lock
* WS: add hopper frequency
* WS: fix history
* WS fix string_t -> FuriString*
* WS: add images
* WS: history record update when receiving data from the sensor again
* WS: add receiver info, delete extra code
* WS: add protocol ThermoPRO_TX4
* [FL-2900] SubGhz: Move icons in Sub-GHz
* WS: add Notification
* [FL-2890] SubGhz: Rename *_user files in resources to _user.example
* WS: add about scene
* WS: removing redundant code
* WS: add  protocol Nexus-TH
* WS: add protocol GT_WT03
* WS: fix notification and rename "Weather Station" -> "Read Weather Station"
* SubGhz: partial unit tests fix
* SubGhz: fix unit_test
* SubGhz: remove dead code
* SubGhz: rename SubGhzPresetDefinition into SubGhzRadioPreset, cleanup subghz types.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-20 02:27:26 +09:00
MX
7417259dcd update changelog and add freq 2022-10-19 19:09:12 +03:00
MX
a3c6d8bb4a SubGhz: rename SubGhzPresetDefinition into SubGhzRadioPreset, cleanup subghz types. 2022-10-19 18:52:21 +03:00
Aleksandr Kutuzov
3807d61034 SubGhz: remove dead code 2022-10-19 18:41:04 +03:00
derskythe
ab55ddbfb1 fix position and sort array taking latest to first 2022-10-19 19:29:48 +04:00
MX
328fbffb80 Merge branch 'fz-dev' into dev 2022-10-19 18:24:56 +03:00
hedger
79c3040629 fbt: fixed dependency issues with SDK definition file (#1893)
* fbt: fixed dependency issues with SDK definition file
* fbt: more path fixes; marked up new symbols
2022-10-19 23:28:48 +09:00
derskythe
4f6d27a214 Don't add to to array if value already exists 2022-10-19 13:12:47 +04:00
DerSkythe
f0e8da98ee Fix interface and add extra history field 2022-10-19 12:20:58 +04:00
Der Skythe
c2e58f9633 Merge branch 'DarkFlippers:dev' into dev-master 2022-10-19 11:03:49 +04:00
DerSkythe
63eced449e Applied OFW version but not yet resized to correct view 2022-10-19 09:39:11 +04:00
MX
49ba5fc9f3 moved subghz bruteforcer into submodule 2022-10-19 06:32:31 +03:00
MX
dd28e5ea7b moving into submodule 2022-10-19 06:31:39 +03:00
MX
da7b9c86b9 add 434.19mhz 2022-10-19 05:55:26 +03:00
MX
3303047a4a update changelog 2022-10-19 02:52:25 +03:00
MX
488563000a subghz bruteforce - add chamberlain 7b and 8b 2022-10-19 02:47:44 +03:00
MX
6c08564d37 rm 313 from hopper 2022-10-19 01:41:59 +03:00
MX
5b8311cdea rename setting user back (since we are using it for custom stuff)
update change log too
2022-10-19 01:03:46 +03:00
MX
68429e191d Merge pull request #119 from ankris812/dev
replacing dict with expanded one
2022-10-19 00:55:52 +03:00
MX
5e7bcea29d removed duplicates 2022-10-19 00:54:27 +03:00
SkorP
a139f015b9 SubGhz: fix unit_test 2022-10-18 20:38:57 +03:00
MX
6579576490 fix protocol items requirement 2022-10-18 20:38:37 +03:00
MX
57251eb028 Merge branch 'fz-dev' into dev 2022-10-18 19:55:26 +03:00
Aleksandr Kutuzov
f33ea3ebe0 SubGhz: partial unit tests fix 2022-10-18 19:54:40 +03:00
MX
84d12da45a add app WeatherStation
OFW PR 1833 by Skorpionm
2022-10-18 19:51:44 +03:00
Kevin Kwok
72713d6f4e Allow pins 0 and 1 as RTS/DTR for USB UART Bridge (#1864)
* Allow pins 0 and 1 as RTS/DTR for USB UART Bridge
* add logic to gpio_scene_usb_uart_config, fix flow_pins
* fixing count of pins
* disable PC0,PC1 RTS/DTR when using LPUART
* add logic to ensure flow pins dont overlap with uart lines

Co-authored-by: あく <alleteam@gmail.com>
2022-10-19 00:06:18 +09:00
ankris812
468bc1dace added dict with extra keys 2022-10-18 17:02:30 +02:00
Patrick Cunningham
56f760aa07 Picopass: Read Elite (#1888)
* working elite dict
* add csn to display

Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 23:58:26 +09:00
ankris812
6db6d123d5 replacing dict with expanded one 2022-10-18 16:52:58 +02:00
Skorpionm
68009c6230 [FL-2919] SubGhz: CAME Wrong number of bits in key (add protocol Airforce) (#1890)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 23:24:53 +09:00
Georgii Surkov
02c27becb0 [FL-2912] Forced RAW receive option for Infrared CLI #1891
Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 23:10:21 +09:00
MX
576dab02a4 Merge branch 'fz-dev' into dev 2022-10-18 16:28:20 +03:00
hedger
4942bd2105 scripts: fixed c2 bundle format (#1889)
* scripts: fixed c2 bundle format
* scripts: copro.py: small refactoring

Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 21:13:28 +09:00
MX
1ee82ba865 update changelog and readme 2022-10-18 04:28:44 +03:00
MX
6e9658608e Merge remote-tracking branch 'origin/dev' into dev 2022-10-18 04:27:52 +03:00
MX
d49ca17824 Merge pull request #115 from TQMatvey/batter_percentage
Power: remove % sign from desktop and center numbers
2022-10-18 04:27:24 +03:00
MX
fc776446de heap defence, aka stack attack, ported to latest fw 2022-10-18 04:20:37 +03:00
MX
5a7fa30199 fix cli 2022-10-18 00:01:08 +03:00
MX
e4cdae4922 lfrfid cli help update 2022-10-17 23:33:54 +03:00
MX
c7a67c1308 update changelog and ir assets 2022-10-17 23:27:35 +03:00
MX
fd3e70492d add support for Normstahl, Mutancode, FAAC RC, XT 2022-10-17 22:43:33 +03:00
MX
a4ee73b470 add dtmf dolphin plugin
https://github.com/litui/dtmf_dolphin
2022-10-17 22:40:14 +03:00
MX
8f5cbdc4c2 Merge pull request #113 from TQMatvey/dev
Minesweeper: Set cursor to initial position on death
2022-10-17 21:41:57 +03:00
MX
6d999abb80 Merge pull request #114 from TQMatvey/flappy_patches
Flappy: Border hitboxes, bigger Pilars
2022-10-17 21:41:24 +03:00
MX
89d49fdba7 Merge branch 'dev' into flappy_patches 2022-10-17 21:39:09 +03:00
MX
04d67ca8ae update totp
https://github.com/akopachov/flipper-zero_authenticator
2022-10-17 21:22:34 +03:00
MX
4f7ca617cc Merge branch 'fz-dev' into dev 2022-10-17 21:20:28 +03:00
Travis Montoya
f61a8fda53 Feature/infrared add remote to cli (#1856)
* Initial testing of remote using cli
* More fixes for cli ir remote
* Fixes. Turns off power now
* Finished adding other tv remote commands
* Changed if-else formatting
* Cleaned up unused variables
* Updating cli unviersal remote to accept tv, ac and more modular. Listing signals still does not work properly
* Using mlib dictionary to get unique signals from files for ir universal list
* Fixing progress bar
* Added error checking for invalid signal to stop freezing cli
* Added error checking for arg length
* Api symbols was changed somehow.. changed back and updated the argument check to account for newline
* Fixing string compares and argument length issue
* Freeing InfraredBruteForce in cli brute force signals

Co-authored-by: sqlsquirreltm <sqlsquirreltm>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 03:07:05 +09:00
Astra
5e35e51c57 [FL-2907] Remove the back button from MFC keys list #1878
Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 02:49:00 +09:00
gornekich
dfbe21e720 NFC fixes part 3 (#1885)
* nfc: fix read next key
* nfc: verify new line ending in user dictionary file
* nfc: fix cache save
* nfc: add unit test for dict load
* nfc: fix total key count in dictionary

Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 02:10:41 +09:00
MX
18e7d2eb41 Merge branch 'fz-dev' into dev 2022-10-17 19:27:29 +03:00
Ivan Podogov
e7aaf3dbb2 Enable all view_ methods in SDK (#1884) 2022-10-18 01:17:04 +10:00
TQMatvey
76aecb597a Power: remove % sign from desktop and center numbers 2022-10-17 15:14:31 +07:00
MX
d2018dfa1d Merge branch 'fz-dev' into dev 2022-10-17 02:54:39 +03:00
hedger
8ec5527ae4 fbt: fix for cincludes in app's private library definition (#1882) 2022-10-17 03:11:27 +10:00
TQMatvey
3a50021348 Flappy: Allow using UP key to jump 2022-10-15 12:54:00 +07:00
TQMatvey
20c63664ca Flappy: Border hitboxes, bigger Pilars 2022-10-15 12:46:59 +07:00
TQMatvey
9b6abd8ef0 Minesweeper: Set cursor to initial position on death 2022-10-15 10:53:45 +07:00
MX
f96f2e2411 Merge branch 'fz-dev' into dev 2022-10-14 22:25:48 +03:00
MX
6442caa3e4 Revert "fbt - fix flash usb without resources "
This reverts commit ce173fd44c.
2022-10-14 22:25:11 +03:00
あく
f06930e4ae Desktop: fix fap in settings (#1877) 2022-10-14 21:23:06 +03:00
Kevin Kwok
865baed0bb Fix FileNotFoundError in ./fbt flash_usb (#1876)
* Fix FileNotFoundError in ./fbt flash_usb
* scripts: update.py: proper fix for file naming

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@nanode.su>
2022-10-15 03:07:23 +09:00
Nikolay Minaylov
f81999ea4a Fix number of dolphin_apps (#1874)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-15 02:35:53 +09:00
MX
89a4b77e73 Merge branch 'fz-dev' into dev 2022-10-14 20:23:11 +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
Johannes Mittendorfer
9ff29d12b2 Fix typo in fap loader logging (#1875) 2022-10-15 01:54:52 +09:00
MX
5f3637ca44 update discord link with qr code 2022-10-14 19:48:05 +03:00
MX
effcb445ce update minesweeper
https://github.com/panki27/minesweeper
2022-10-14 19:19:44 +03:00
MX
55bad280ee update changelog 2022-10-14 17:59:53 +03:00
nminaylov
b003ede76c Fix number of dolphin_apps 2022-10-14 17:59:09 +03:00
MX
57362b3eab update changelog 2022-10-14 01:53:09 +03:00
MX
cb0d9ec591 add sec+ 1.0/2.0 433mhz in add manually, and run fbt fmt 2022-10-14 01:49:32 +03:00
MX
dad4772bec update minesweeper
https://github.com/panki27/minesweeper
2022-10-14 01:43:57 +03:00
MX
a16542cda6 update readme 2022-10-14 01:36:37 +03:00
MX
a5d22154a9 update changelog 2022-10-14 01:34:12 +03:00
MX
ce173fd44c fbt - fix flash usb without resources
this is not "stolen" from official, bug are present in ofw at current moment
2022-10-14 01:31:44 +03:00
MX
d547307357 Fix DTM Neo encoder 2022-10-14 01:30:20 +03:00
MX
c198a51b1c Merge branch 'fz-dev' into dev 2022-10-14 01:11:00 +03:00
David
d5b239595f Desktop: Set external apps as favorites (#1816)
* MVP
* Display app name and icon in browser
* Pre-select favorites in submenu and browser
* Show animation while external favorite is loading
* A little birdie told me... (Missing record_close)
* DesktopSettings: reset submenu before running dialog

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-14 03:09:37 +09:00
MX
947e44ce86 Merge branch 'fz-dev' into dev 2022-10-13 20:32:05 +03:00
Astra
55f8beef9f [FL-2876] MFC Improvements Part 2/2 (#1868)
* Remove keys incorrectly added by the key cache
* Improve responsiveness while checking for re-used keys and fix skipping keys when card is removed
* Actually check if the card is completely read
* Discard incorrect keys on a lower level
* nfc: clean up

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-10-14 01:23:29 +09:00
Dzhos Oleksii
e46e6f8ee9 Update title for web updater (#1872)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-14 00:34:27 +09:00
MX
ff6c4f9957 Merge branch 'fz-dev' into dev 2022-10-13 18:07:58 +03:00
hedger
8fdee1e460 Scripts: simpler tar format (#1871)
* scriptsL simpler tar format
* scripts: shorter names for files in update bundle
* scripts: limiting max OTA package dir name length to 80
* scripts: resource bundle: checks for file name length
* scripts: made resource packing errors critical
2022-10-14 00:05:07 +09:00
MX
558f85603d update changelog 2022-10-13 18:03:24 +03:00
MX
b909321699 Merge pull request #107 from an4tur0r/feature/fast_pin_lock
Feature: lock device with pin by long pressing up button
2022-10-13 17:54:43 +03:00
MX
ff52f7d9ba Merge branch 'hedger/fbt_tarfix' into dev 2022-10-13 17:48:16 +03:00
hedger
abfe53f156 scripts: made resource packing errors critical 2022-10-13 18:27:21 +04:00
hedger
9a2228bfa4 scripts: resource bundle: checks for file name length 2022-10-13 18:09:04 +04:00
MX
da17adb5ee update tar formats 2022-10-13 17:08:00 +03:00
hedger
7b16de2d6f scripts: limiting max OTA package dir name length to 80 2022-10-13 17:03:11 +03:00
hedger
735056628c scripts: limiting max OTA package dir name length to 80 2022-10-13 18:01:49 +04:00
MX
9941df48bb run fbt format 2022-10-13 17:00:20 +03:00
MX
8e0e4b5e2c update totp plugin
https://github.com/akopachov/flipper-zero_authenticator
2022-10-13 16:57:08 +03:00
hedger
220adf2375 scripts: shorter names for files in update bundle 2022-10-13 16:55:04 +03:00
an4tur0r
39cd10f061 lock device shortcut 2022-10-13 16:54:13 +03:00
hedger
af1fb2018a scripts: shorter names for files in update bundle 2022-10-13 17:38:47 +04:00
MX
3dde6089fc update mfc improvements
OFW PR 1868 by Astrrra
2022-10-13 16:06:34 +03:00
MX
5f28eafcd2 scripts: fix tar format
OFW PR 1871 by hedger
2022-10-13 01:47:03 +03:00
MX
94d2d5c99f tgz is now built by fbt 2022-10-13 00:49:17 +03:00
MX
3a569d4be8 Merge branch 'fz-dev' into dev 2022-10-13 00:42:15 +03:00
hedger
db2f4847ba scriptsL simpler tar format 2022-10-12 23:13:17 +04:00
Luke Williams
50dc2d7389 36-bit AWID (L11601 Lenel) (#1838)
* 36-bit AWID
* Rfid: correct vendor name AWIG -> AWID

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 01:31:54 +09:00
Thibaut CHARLES
ede3bac799 Badusb: show script errors on screen (#1506)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 01:21:54 +09:00
hedger
eb4ff3c0fd [FL-2832] fbt: more fixes & improvements (#1854)
* github: bundling debug folder with scripts; docs: fixes & updates; fbt: added FAP_EXAMPLES variable to enable building example apps. Disabled by default. fbt: added TERM to list of proxied environment variables
* fbt: better help output; disabled implicit_deps_unchanged; added color to import validator reports
* fbt: moved debug configuration to separate tool
* fbt: proper dependency tracker for SDK source file; renamed linker script for external apps
* fbt: fixed debug elf path
* fbt: packaging sdk archive
* scripts: fixed sconsdist.py
* fbt: reworked sdk packing; docs: updates
* docs: info on cli target; linter fixes
* fbt: moved main code to scripts folder
* scripts: packing update into .tgz
* fbt, scripts: reworked copro_dist to build .tgz
* scripts: fixed naming for archived updater package
* Scripts: fix ぐるぐる回る

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-13 01:12:05 +09:00
gornekich
afff1adf8f [FL-2882] BLE tiktok controller (#1859)
* bt hid: introduce tiktok controller
* assets: add bt tiktok assets
* bt hid: finish tiktok draw
* bt hid: add input process to tiktok view
* bt hid: add tiktok swipe emulation
* bt hid: fix exit from tiktok controller
* ble hid: add delay to emulate double tap
* ble hid: change options order
* bt hid: build as external application
* ble hid: fix naming

Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 00:48:13 +09:00
あく
92a738bf77 Dolphin: add L1_Painting animation (#1863)
Co-authored-by: hedger <hedger@users.noreply.github.com>
2022-10-13 00:39:39 +09:00
Max Andreev
b3d9523322 Github actions on kubernetes runners (#1861)
* Change toolchain path and runner tag
* fix check_submdules.yml
* try to fix errors
* create .ssh directory
* fix toolchain path
* add empty line for test
* testing 3 k8s nodes speed
* Test speed again
* change tag, move reindex job
* bring reindex.yml back
* fix build.yml
* fix reindex.yml

Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 00:31:25 +09:00
MX
155cbeeb11 fix app id for assets 2022-10-12 05:43:22 +03:00
MX
0d273bd15c update assets and changelog 2022-10-12 05:36:40 +03:00
MX
2e047ff411 allow 36-bit AWID (L11601 Lenel)
OFW PR 1838 by ae5au
2022-10-12 05:32:58 +03:00
MX
80a406afd3 BLE tiktok controller - why? :(
OFW PR 1859 by gornekich
2022-10-12 05:31:19 +03:00
MX
6b5631e5b0 MFC Improvements Part 2/2
OFW PR 1868 by Astrrra
2022-10-12 05:29:42 +03:00
MX
80735d4f51 Merge pull request #102 from derskythe/fix-read-in-readraw-crash
flipper_format_free after all and only if we failed with all plans
2022-10-12 05:17:37 +03:00
MX
e1e46b89b1 Merge pull request #103 from derskythe/subghz-improvements
SubGHz improvements
2022-10-12 05:17:08 +03:00
MX
b7bdc4c985 sorry, i added "Mod:", and did fbt format 2022-10-12 05:15:45 +03:00
MX
f429d14ab5 Merge branch 'dev' into subghz-improvements 2022-10-12 05:04:55 +03:00
MX
744b61ca28 include license 2022-10-12 05:03:33 +03:00
MX
8520daf28b addding some great plugins to be preinstalled
and running fbt format, and fixing TOTP printf format
2022-10-12 05:01:37 +03:00
MX
aa9f958f07 Merge branch 'fz-dev' into dev 2022-10-12 04:37:59 +03:00
MX
b3f96306ed oooooops, added forgotten thing 2022-10-12 04:35:36 +03:00
MX
022315e93d Improve keeloq, add JCM support, fix Nice Smilo, MHouse, and more
now manufacturer name is saved into file, and will not change randomly, 
added support for JCM
fixed Nice Smilo, MHouse
2022-10-12 04:18:29 +03:00
DerSkythe
702786078d in PNG waves down 2 px, MHZ in Read screen 2022-10-11 22:38:36 +04:00
DerSkythe
e78d73c35f fix PNG, move waves 2px down and code to correct values 2022-10-11 21:56:00 +04:00
gornekich
2552278a3d [FL-2883] NFC: bank card rework reading (#1858)
* nfc: remove bank card save option
* nfc: remove bank card save from nfc device
* nfc: remove unused function in emv
* nfc: try several times to start emv application
* nfc: add AID display fallback for bank cards

Co-authored-by: あく <alleteam@gmail.com>
2022-10-12 02:13:12 +09:00
DerSkythe
34406f0607 flipper_format_free after all and only if we failed with all plans 2022-10-11 21:09:41 +04:00
Nikolay Minaylov
04f5ad83f8 [FL-2828] Dolphin score points update #1809 2022-10-12 01:54:35 +09:00
derskythe
06c0adfe98 Save in last settings FrequencyAnalyzer last feedback set 2022-10-11 18:45:46 +04:00
derskythe
b0d4146c76 Write full name of preset on Read/ReadRAW screen 2022-10-11 18:26:16 +04:00
MX
be293757c0 update changelog 2022-10-11 04:10:54 +03:00
MX
79e7c87b94 Merge pull request #98 from derskythe/fix-read-in-readraw-crash
Add split RAW files ability
2022-10-11 03:42:12 +03:00
MX
b6dfeac7ca rfid fuzzer fix 2022-10-11 03:39:48 +03:00
MX
349a151330 fix memory leak 2022-10-11 03:29:59 +03:00
MX
40dc80499f Merge pull request #97 from derskythe/subbrute-rev3
SubBrute Rev3
2022-10-11 00:57:08 +03:00
MX
b0c31da36a update name 2022-10-11 00:52:43 +03:00
MX
a76259add9 Merge pull request #99 from derskythe/dev-master
Fix line interval
2022-10-11 00:37:25 +03:00
DerSkythe
3f3ee1822a Update upper buttons 2022-10-10 23:24:10 +04:00
DerSkythe
0714df4a4a Fix line interval 2022-10-10 20:30:28 +04:00
DerSkythe
52361b4adf Add split RAW files ability 2022-10-10 20:20:56 +04:00
Der Skythe
61fe66c178 Merge branch 'DarkFlippers:dev' into subbrute-rev3 2022-10-10 19:26:25 +04:00
MX
016ebd3afc update changelog 2022-10-10 16:51:48 +03:00
MX
82b9d74b38 new animation :)
by @Svaarich
2022-10-10 16:47:15 +03:00
MX
6d1929af25 Merge branch 'fz-dev' into dev 2022-10-10 16:44:29 +03:00
MX
384397c282 fix .fap's debug 2022-10-10 16:43:48 +03:00
MX
0abd54ccc8 fix rfid fuzzer crash 2022-10-10 16:43:31 +03:00
MX
ea833d891f discord removes features without new boosts...
so here is new link that will always be available
2022-10-10 16:42:57 +03:00
DerSkythe
9152299562 Fix max value in BF dump brute 2022-10-10 12:53:33 +04:00
Skorpionm
906124b091 [FL-2886] SubGhz: fix text overlap in read (#1853) 2022-10-10 13:43:15 +09:00
DerSkythe
9c0391a887 minor changes 2022-10-10 04:44:23 +04:00
DerSkythe
7ded162c94 add vibro on stop to in-pocket mode 2022-10-10 03:24:44 +04:00
Der Skythe
382f620aff Merge branch 'DarkFlippers:dev' into subbrute-rev3 2022-10-10 03:03:41 +04:00
DerSkythe
323a56e987 fix saving files 2022-10-10 03:05:51 +04:00
DerSkythe
b65a2e9c94 fix send with dump file 2022-10-10 02:52:32 +04:00
DerSkythe
eed8cd1824 fix problem with sending 2022-10-10 01:44:37 +04:00
DerSkythe
500456b03d Returned to Worker model 2022-10-10 00:35:44 +04:00
MX
4b8221d813 add new icon for uart echo
icon by @Svaarich
2022-10-09 23:32:04 +03:00
MX
c7a454752a Merge pull request #95 from hardcod3dd/dev
Turkish language support
2022-10-09 22:41:46 +03:00
hardcod3d
b1f8073333 Turkish language support 2022-10-09 22:34:37 +03:00
MX
e489c57fc0 update changelog 2022-10-09 21:49:59 +03:00
Der Skythe
b4a3ac468f Merge branch 'DarkFlippers:dev' into subbrute-rev3 2022-10-09 21:39:58 +04:00
MX
877a9202fd fix decode raw bugs (blank screen, broken files) 2022-10-09 19:45:39 +03:00
MX
acbe7a10e2 enable hopping with detect raw, and trying to fix crashes
feature still very unstable, use at your own risk!!!
2022-10-09 14:43:18 +03:00
MX
b6b33a70e9 Merge pull request #93 from UberGuidoZ/patch-1
Slight update for newest dev method
2022-10-09 14:38:20 +03:00
MX
1132653d7a Merge branch 'fz-dev' into dev 2022-10-09 14:37:18 +03:00
UberGuidoZ
3fd30a9132 docs: update on FAP build process (#1852) 2022-10-09 09:20:15 +03:00
UberGuidoZ
50e9f7d3ca Slight update for newest dev method 2022-10-08 22:43:08 -07:00
MX
e7de975885 update changelog 2022-10-09 05:19:57 +03:00
MX
f5a1872db4 Desktop: Set external apps as favorites (& fix forgotten record close)
OFW PR 1816 by @djsime1
2022-10-09 05:18:24 +03:00
MX
409d2e5f05 replace usb mouse with new plugin (see readme and changelog) 2022-10-09 04:37:14 +03:00
MX
91d7a38ca6 update changelog and fix subghz issues 2022-10-09 04:24:51 +03:00
MX
00323892f2 rebranding :) 2022-10-09 02:27:38 +03:00
MX
45840a1146 rise and shine mr freeman... 2022-10-09 00:37:22 +03:00
MX
b0c9af9c06 Merge branch 'fz-dev' into dev 2022-10-08 23:11:16 +03:00
DerSkythe
7643fdad7c Seems we have cross-thread violation 2022-10-08 22:54:30 +04:00
Roland Kammerer
a1ede0a2fc BadUSB: add SYSRQ keys (#1460)
This allows sending of SysRq keys[1]. This then for example allows
sending the well known 'reisub' commands to safely reboot a otherwise
frozen Linux box. Or obviously any of the other magic keys.

The advantage compared to sending it to /proc/sysrq-trigger is that one
does not need a shell and depending on how broken the system is, one
might not even be able to get a new shell. The SysRq keys still work.

The cost is adding a new/"non-standard" keyword, IMO it is worth it.

Example:
DEFAULTDELAY 200
DELAY 1000
SYSRQ r
SYSRQ e
SYSRQ i
SYSRQ s
SYSRQ u
SYSRQ b

If one really wants to test it, I suggest h(elp) or w(ait).

[1] https://en.wikipedia.org/wiki/Magic_SysRq_key

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-09 02:56:56 +09:00
DerSkythe
b86f42e7fb Changed protocol info 2022-10-08 21:53:31 +04:00
Sergey Gavrilov
31c0346adc [FL-976] Removing lambdas (#1849)
* Removing lambdas...
* Wake the fk up, Gordon! We have a citadel to burn!
* Here comes the Nihilanth
* Lambda documentation

Co-authored-by: あく <alleteam@gmail.com>
2022-10-09 02:38:29 +09:00
Der Skythe
9ba7e625ca Merge branch 'Eng1n33r:dev' into subbrute-rev3 2022-10-08 21:00:31 +04:00
Sergey Gavrilov
981f7ff8b0 Elf loader: do not load .ARM.* sections (#1850)
* Elf loader: do not load .ARM sections
* Fix section name
2022-10-09 00:51:51 +09:00
SG
c38c42906f Elf loader: do not load .ARM sections 2022-10-08 17:50:26 +03:00
MX
7c8eacb168 Merge branch 'fz-dev' into dev 2022-10-08 15:14:15 +03:00
あく
c13929330e Gui: fix memory leak in file browser module (#1848) 2022-10-08 19:57:53 +09:00
Yukai Li
88ca267466 music_player: Return to browser instead of exiting on back button (#1846)
* music_player: Return to browser instead of exiting on back button
* music_player: Fix number and dots extraction
2022-10-08 19:13:26 +09:00
DerSkythe
1adf76d54d Revert application.fam 2022-10-08 02:25:22 +04:00
DerSkythe
7ec4cb4b7a Fix compile errors 2022-10-08 02:24:19 +04:00
MX
aedde45de8 Merge pull request #92 from an4tur0r/feature/arkanoid_speed
Feature: allow to set ball speed in Arkanoid
2022-10-08 00:20:14 +03:00
MX
184b467f62 add nfc feature back, bug seems to be fixed 2022-10-08 00:03:06 +03:00
DerSkythe
0c5146e047 Merge branch 'dev-master' into subbrute-rev3 2022-10-08 00:42:57 +04:00
an4tur0r
221ac1ed3b allow to set ball speed in Arkanoid 2022-10-07 23:09:17 +03:00
MX
464c725a48 fix debug logs 2022-10-07 23:05:00 +03:00
MX
3e538a8ade bump ver 2022-10-07 22:51:34 +03:00
MX
ae76f45339 sub brute fixes 2022-10-07 22:13:45 +03:00
MX
4cb585e4b9 fix subghz display bug 2022-10-07 21:34:01 +03:00
MX
16ea8dc568 Merge branch 'fz-dev' into dev 2022-10-07 21:11:40 +03:00
MX
4c9d62a33f adapt plugins to furi stream, fix printf formats 2022-10-07 21:05:16 +03:00
Sergey Gavrilov
d10e16ca3c Snake game: nokia 6110-like sound (#1844)
* Snake game: nokia 6110-like sound
* Snake game: blocking sound notifications
* SnakeGame: flush notification queue with backlight enforce block

Co-authored-by: あく <alleteam@gmail.com>
2022-10-08 02:27:32 +09:00
Sergey Gavrilov
37b5e58a60 More correct elf loader (#1839)
* ELF File: more robust section loader
* ELF File: faster and smaller preinit, init and fini arrays handling
* ELF File: load sections on preload stage
* ELF File: naming
* Furi: fix use after free in thread join

Co-authored-by: あく <alleteam@gmail.com>
2022-10-08 02:06:29 +09:00
MX
b4b3c182c5 fixes for new printf and furistream 2022-10-07 18:32:58 +03:00
MX
bdd052937b Merge branch 'fz-dev' into dev 2022-10-07 17:24:20 +03:00
Nikolay Minaylov
1a1f711897 Signal Generator app: UI update (#1829)
* Signal Generator: UI update
* icons renamed

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-07 22:58:36 +09:00
Sergey Gavrilov
4000f0cac5 [FL-2870] Printf function attributes (#1841)
* Furi strings: printf attribute
* Logs: printf attribute
* Plugins: adapt
* Plugins: accommodate
* Unit tests: accommodate

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 22:35:15 +09:00
Nikolay Minaylov
1f742b611a [FL-2651, FL-2863] App name in CLI loader command, RFID data edit fix #1835
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 21:46:58 +09:00
Sergey Gavrilov
38a82a1907 [FL-2839] Furi stream buffer (#1834)
* Core: stream buffer
* stream buffer: API and usage
* stream buffer: documentation
* stream buffer: more documentation
* Furi: fix spelling

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-07 21:27:11 +09:00
Max Andreev
d1843c0094 Disable PVS-Studio license check (#1840) 2022-10-07 16:56:19 +10:00
Matvey Gerasimov
3367bc6f68 Documentation: AppManifests.md typo fix (#1836) 2022-10-07 10:23:21 +04:00
MX
515e6db69c Merge branch 'fz-dev' into dev 2022-10-07 00:35:01 +03:00
MX
81faca79ee remove duplicate allocs from subghz history 2022-10-07 00:31:29 +03:00
Astra
eaa3adf98a [FL-2868] Remove string_push_uint64 (#1832)
* Remove string_pust_uint64
* Oops, furi strings now
* Remove dead code
* Remove unneeded import

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 03:51:30 +09:00
Björn Kimminich
dde18cd343 Add exit label to keyboard connection screen (#1830)
* Add exit label to keyboard connection screen (resolves #1814)
* BtHid: align baselines on connection screen

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:40:18 +09:00
Georgii Surkov
72b3d7f414 [FL-2620] Infrared error message (#1827)
* Show an error message if the remote could not be saved/renamed

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:25:54 +09:00
Astra
19cb469e4b [FL-2877] Don't turn off the backlight on MFC dict attack #1826
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:19:35 +09:00
gornekich
01f7a3e5b5 [FL-2874] Remove bank card uid emulation (#1823)
* nfc: open bank card info from archive
* nfc: remove emulate uid option from bank cards menu

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:12:45 +09:00
Astra
6dde5586af [FL-2803] Mifare Classic read improvements Part 1 (#1822)
* Reuse found keys when reading a card
* Fix keys not being read if no newline at the end of the file
* Actually read all keys from the dictionary
* Support for furi_string
* Check only for re-used key after the current sector
* Declare the key attack function as static
* nfc: change logs, check worker state

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:07:56 +09:00
gornekich
5de2c32c81 [FL-2864] NFC update detect reader (#1820)
* nfc: update detect reader view
* nfc: make detect reader more interractive
* nfc: update icons
* nfc: fix detect reader gui
* nfc: fix gui, fix worker events
* nfc: fix notifications
* nfc: add nfc_worker NULL assert

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 01:58:17 +09:00
Evgenii Tereshkov
69b9c54b2f Update ac.ir: add Daichi model DA25AVQS1-W (#1819)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 01:18:23 +09:00
MX
dbf4b65d84 update changelog 2022-10-06 19:18:09 +03:00
MX
2ffb246e69 Merge branch 'fz-dev' into dev 2022-10-06 19:17:56 +03:00
Sergey Gavrilov
e3a5df5959 CLI: log command argument (#1817)
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-07 01:13:02 +09:00
MX
90eefeb2ed Merge pull request #88 from jd-raymaker/dev
Added norwegian keyboard layout
2022-10-06 18:56:33 +03:00
MX
fda541c7fb update changelog 2022-10-06 18:45:53 +03:00
MX
42494d801f fix merge issue 2022-10-06 18:42:59 +03:00
MX
1253a78dba Merge branch 'fz-dev' into dev 2022-10-06 18:41:48 +03:00
Max Andreev
d07c2dbe54 ".fap" extention in file browser and archive tab (#1812)
* Add .fap extention, and Applications tab
* Using new icon, renaming tab to Apps
* Change tabs order
* Add first ugly implementation of in-app icons in archive browser
* Starting using FAPLoader callback
* Getting all metafata from fap
* add app filename fallback
* using fap_loader_item_callback in archive_list_item_cb
* FAP-Loader: removed minimal allocation
* Removed strange code

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 00:37:53 +09:00
nminaylov
8f1812655e CLI loader shows app name, rfid edit fix 2022-10-06 18:26:15 +03:00
MX
3802171009 Revert "Merge branch 'fz-dev' into dev"
This reverts commit 03ad1770f8.
2022-10-06 18:23:50 +03:00
MX
03ad1770f8 Merge branch 'fz-dev' into dev 2022-10-06 18:23:44 +03:00
MX
b86756b581 don't include example app in releases 2022-10-06 17:58:18 +03:00
Skorpionm
11681d8ee8 [FL-2866, FL-2865] SubGhz: add frequency analyzer history (#1810)
* SubGhz: frequency analyzer history
* SubGhz: add vibro
* SubGhz: turn on the display when receiving a signal
* SubGhz: add signal reception indicator
* SubGhz: fix indicator
* SubGhz: fix FA history

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 23:48:29 +09:00
Skorpionm
061f53cd3c [FL-2849] SubGhz: read RAW auto generation of names (#1772)
* SubGhz: read RAW auto auto generation of names depending on the date of the entry
* SubGhz: name generation modification RAW-YYYYMMDD-HHMMSS
* SubGhz: replace m-string with FuriString

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 23:43:17 +09:00
MX
4bbeeb19e2 Merge branch 'fz-dev' into dev 2022-10-06 17:31:43 +03:00
Georgii Surkov
61189c3c82 [FL-2847] FFF trailing space fix (#1811)
* Improve whitespace handlilng in FFF
* Add tests for odd fff user input
* Adjust formatting

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 23:18:20 +09:00
hedger
9bf11d9fd2 [FL-2859,2838] fbt: improvements for FAPs (#1813)
* fbt: assets builder for apps WIP
* fbt: automatically building private fap assets
* docs: details on how to use image assets
* fbt: renamed fap_assets -> fap_icons
* fbt: support for fap_extbuild field
* docs: info on fap_extbuild
* fbt: added --proxy-env parame ter
* fbt: made firmware_cdb & updater_cdb targets always available
* fbt: renamed fap_icons -> fap_icon_assets
* fbt: deprecated firmware_* target names for faps; new alias is "fap_APPID"
* fbt: changed intermediate file locations for external apps
* fbt: support for fap_private_libs; docs: updates
* restored mbedtls as global lib
* scripts: lint.py: skip "lib" subfolder
* fbt: Sanity checks for building advanced faps as part of fw
* docs: info on fap_private_libs; fbt: optimized *.fam indexing
* fbt: cleanup; samples: added sample_icons app
* fbt: moved example app to applications/examples
* linter fix
* docs: readme fixes
* added applications/examples/application.fam stub
* docs: more info on private libs

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 22:55:57 +09:00
MX
c76fcf5072 Merge branch 'fz-dev' into dev 2022-10-06 15:50:59 +03:00
MX
007a11d70d upd ofw pr 1832 2022-10-06 15:26:23 +03:00
MX
b61e41163b fix subghz double click after delete, fix rename bug, fix unirf 2022-10-06 15:10:08 +03:00
Nikolay Minaylov
a69e150e2f [FL-2812] RFID: write fix for some protocols #1828
Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 20:36:21 +09:00
Matvey Gerasimov
f16cdd1477 fix: typo badusb demo windows (#1824)
Fix a typo in the badusb demo script for Windows.

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 20:18:40 +09:00
MX
ac286dfed8 fix subghz bruteforcer, change subghz raw naming 2022-10-06 14:10:56 +03:00
MX
a93008b218 fix rfid fuzzer 2022-10-06 03:09:20 +03:00
MX
31aaa593fc fixes, rfid fuzzer still crashes 2022-10-06 02:30:40 +03:00
MX
5a2719663f fix archive, update changelog 2022-10-06 00:55:26 +03:00
JayDee Raymaker
adccb87499 Added norwegian keyboard layout 2022-10-05 23:26:24 +02:00
MX
693f78e501 update icon naming
OFW PR 1829 by nminaylov
2022-10-05 23:15:14 +03:00
MX
6eb610762e bump api version 2022-10-05 21:40:06 +03:00
MX
3e4d8a41e0 Remove string_push_uint64
OFW PR 1832 by Astrrra
2022-10-05 21:39:40 +03:00
MX
c60bfbf271 oh no 2022-10-05 21:27:13 +03:00
MX
0796263e81 Merge branch 'fz-dev' into dev 2022-10-05 19:27:46 +03: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
MX
baf5034817 Merge pull request #87 from derskythe/feat-add-subbrute-frequency
Add CAME 12bit 303MHz to SubBrute
2022-10-05 17:26:02 +03:00
derskythe
04e16970db Add CAME 12bit 303MHz to SubBrute 2022-10-05 17:45:45 +04:00
MX
a8b48771e4 rfid fuzzer, ability to change time delay 2022-10-04 23:43:15 +03:00
MX
1424878d65 update assets and changelog 2022-10-04 21:40:07 +03:00
MX
a37b0d464c Signal Generator app: UI update
OFW PR 1829 by nminaylov
2022-10-04 21:07:10 +03:00
MX
96502e21ae RFID: write fix for some protocols
OFW PR 1828 by nminaylov
2022-10-04 21:06:16 +03:00
MX
b5d6d60535 New notification sequence for Frequency Analyser
PR #86 by @BastienB3
2022-10-04 21:05:09 +03:00
MX
32e64fd29e update changelog 2022-10-04 18:40:57 +03:00
MX
8f9d81b972 Merge pull request #84 from colingrady/wrap_rfid_fuzzer_menu
Allow the RFID protocol menu to wrap
2022-10-04 18:25:29 +03:00
MX
23e0566273 Merge pull request #85 from mvanzanten/adding-on-the-fly-changes-ui-addition
Improve UI for added on-the-fly feature
2022-10-04 18:25:07 +03:00
MX
4141483147 NFC update detect reader
OFW PR 1820 by gornekich
2022-10-04 18:23:11 +03:00
Matt Van Zanten
30e005d5c4 improve UI for added on the fly feature 2022-10-04 08:07:53 -07:00
MX
e3a2711eb3 Remove bank card uid emulation & fix emv info
OFW PR 1823 by gornekich
2022-10-04 18:05:57 +03:00
MX
8569641ce6 Infrared error message
OFW PR 1827 by gsurkov
2022-10-04 18:02:21 +03:00
MX
cafd06c71b Don't turn off the backlight on MFC dict attack
OFW PR 1826 by Astrrra
2022-10-04 17:59:22 +03:00
MX
06a7bda69b block hopping and detect raw at same time
and fix freq analyzer feedback display backlight
2022-10-04 17:58:12 +03:00
Colin Grady
c43ce93936 Allow the RFID protocol menu to wrap 2022-10-04 08:53:58 -06:00
MX
2288855163 update assets and changelog 2022-10-04 03:29:02 +03:00
MX
c0765c1114 rfid fuzzer H10301 support and bug fixes 2022-10-04 03:15:28 +03:00
MX
683c6254da Merge remote-tracking branch 'origin/dev' into dev 2022-10-04 02:36:19 +03:00
MX
2ef515ef56 Merge pull request #83 from mvanzanten/adding-on-the-fly-changes-2
Adding on the fly bit changes
2022-10-04 02:35:57 +03:00
MX
667be798fc rfid fuzzer, fix bugs, improve gui, add PAC/Stanley support
add more example files
2022-10-04 02:33:39 +03:00
MX
0f9598099a fix rfid fuzzer crash, fix bug when dict attack can't be restarted 2022-10-04 01:15:15 +03:00
MX
0d6f729386 CLI: log command argument (log level)
OFW PR 1817 by DrZlo13
2022-10-04 00:48:25 +03:00
MX
b452b6fd32 FFF trailing space fix
OFW PR 1811 by gsurkov
2022-10-04 00:45:09 +03:00
Matt Van Zanten
9403128a03 moving to center nicer 2022-10-03 11:32:10 -07:00
Matt Van Zanten
71589b28a7 removing debug logs 2022-10-03 11:09:51 -07:00
Matt Van Zanten
8b0fa6d0b1 running fbt format 2022-10-03 11:07:16 -07:00
Matt Van Zanten
cf47da0ff4 Merge branch 'dev' into adding-on-the-fly-changes-2 2022-10-03 10:47:17 -07:00
Matt Van Zanten
d6b7fae7e4 working version of the on the fly bit switcher 2022-10-03 10:29:04 -07:00
MX
110dc48b96 Merge remote-tracking branch 'origin/dev' into dev 2022-10-03 18:42:52 +03:00
MX
37c666ddf5 Merge pull request #82 from TQMatvey/pr_temp
SubGhz: Enable backlight on new signal
2022-10-03 18:42:18 +03:00
MX
6ddca568b9 correct notification sequence 2022-10-03 18:41:37 +03:00
MX
8993db56b8 this was not part of previous change 2022-10-03 18:40:22 +03:00
MX
3c1efda1db return carrier test included with non debug builds 2022-10-03 18:36:06 +03:00
MX
b62b7956a6 Merge pull request #80 from derskythe/fix-read-in-readraw-crash
Fix-read-in-readraw-crash
2022-10-03 18:27:54 +03:00
MX
dce5af5c2e hmm 2022-10-03 18:22:09 +03:00
MX
fbacdc5b7b fix critical bug with subghz rpc 2022-10-03 18:21:18 +03:00
MX
8dba4f25ae unused 2022-10-03 18:20:49 +03:00
derskythe
43ef4046ed Add stubs for split 2022-10-03 19:00:35 +04:00
mvanzanten
1e63f57bf7 working version, change bits on the fly 2022-10-02 12:06:06 -07:00
Matt Van Zanten
649887fe0f progress, adding on the fly 2022-10-02 08:18:01 -07:00
derskythe
be42c390f2 Save on SD Card only RAW files 2022-10-02 16:57:32 +04:00
derskythe
cbda5d996f Fix uncommited merge 2022-10-02 16:50:03 +04:00
derskythe
de1ec97512 Merge remote-tracking branch 'refs/remotes/origin/fix-read-in-readraw-crash' into fix-read-in-readraw-crash 2022-10-02 16:20:18 +04:00
MX
8af749c965 enable saving detect raw state via define 2022-10-02 13:50:29 +03:00
MX
4d3f45e911 Don’t show temp history dir in filebrowser 2022-10-02 10:18:31 +03:00
MX
63fee41a1f enable worker back 2022-10-02 09:51:27 +03:00
TQMatvey
f441fed68d SubGhz: Follow system backlight timer 2022-10-02 13:48:06 +07:00
TQMatvey
6e0eeed773 SubGhz: turn on display for new signal 2022-10-02 13:29:16 +07:00
MX
6bf306200e make loading subghz file from favourites a bit faster 2022-10-02 08:50:41 +03:00
MX
e2faf31b45 debug in subghz only when compiled with DEBUG=1 2022-10-02 07:34:39 +03:00
MX
85eb740559 do not save detect raw on/off settings 2022-10-02 06:38:34 +03:00
MX
cea14ae9c5 fix dir creation bug, save files only for RAW
TODO: files are broken when they have more than 512 elements in one line
Split file to 512 element chunks as it done in regular Read RAW
2022-10-02 06:23:09 +03:00
MX
e9a11cfce0 Merge branch 'dev' into fix-read-in-readraw-crash 2022-10-02 04:06:01 +03:00
MX
87a14b96e1 Merge branch 'fz-dev' into dev 2022-10-02 04:05:07 +03:00
derskythe
bbd3f9cf71 Fixed all bugs with saving directly to file, also fixed misspeled if/ifdef in all app 2022-10-02 03:18:30 +04:00
derskythe
230f09dddd enable delete temp files 2022-10-01 08:47:44 +04:00
derskythe
24e744f1d1 Added saving DetectRAW settings, trying to write files on SD instead of memory 2022-10-01 08:39:51 +04:00
derskythe
127b700642 Init work on rev3, but this is not working code 2022-09-30 18:36:56 +04:00
あく
0f9ea925d3 UnitTests: fix thread join test (#1808) 2022-09-30 22:03:57 +09:00
Nikolay Minaylov
836de3df16 [FL-2825] iButton GUI fixes (#1805)
* Ibutton GUI fixes
* Fix memory leak in lfRFID write

Co-authored-by: あく <alleteam@gmail.com>
2022-09-30 21:56:12 +09:00
Sergey Gavrilov
c92217a109 Thread: Clear TLS after thread stop (#1807) 2022-09-30 19:59:11 +09:00
MX
41c93431c8 update changelog, readme, assets 2022-09-30 03:46:06 +03:00
MX
f0ea8f3a84 fix clock am/pm logic 2022-09-29 23:50:49 +03:00
MX
4d8f294e7a Merge pull request #79 from derskythe/subghz-freq-analyzer-long-press
Long press OK button in SubGHz Frequency analyzer switch to Read menu
2022-09-29 23:26:02 +03:00
derskythe
f543753873 Long press OK button in SubGHz Frequency analyzer switch to Read menu with selected frequency 2022-09-29 23:46:54 +04:00
MX
1fb1a68842 iButton GUI fixes
OFW PR 1805 by nminaylov
2022-09-29 20:56:04 +03:00
MX
54fedb9bc8 Merge pull request #78 from alexberkowitz/dev
Increase Sub-GHz remote label line length to 16
2022-09-29 18:34:22 +03:00
MX
8af9c00ddb Merge branch 'fz-dev' into dev 2022-09-29 18:20:05 +03:00
Sergey Gavrilov
5a22803bbc Revert "Revert "Furi Thread: don't use thread pointer after FuriThreadStateStopped callback (#1799)""
This reverts commit 7df70d7c62.
2022-09-29 18:15:02 +03:00
Alex Berkowitz
824f5ea027 Merge branch 'Eng1n33r:dev' into dev 2022-09-29 10:04:21 -05:00
hedger
76d38e832e fbt: reproducible manifest builds & improvements (#1801)
* fbt: reproducible manifest builds, less rebuild on small updates; scripts: assets: using timestamp from commandline af available
* fbt: added app import validation for launch_app & single app build targets
* fbt: COMSTR for app imports validation
* docs: minor fixes
* docs: markdown fix
* vscode: comments for RTOS startup

Co-authored-by: あく <alleteam@gmail.com>
2022-09-29 20:00:22 +09:00
Sergey Gavrilov
aba20b6af8 Furi Thread: fixed furi_thread_join, check if thread has not been started (#1803)
* furi thread: fixed furi_thread_join, check if thread has not been started
* Furi: correct returns in furi_thread_join

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-09-29 19:42:15 +09:00
Alex Berkowitz
3e9409a1a8 Merge branch 'dev' of https://github.com/alexberkowitz/flipperzero-firmware into dev 2022-09-26 11:43:31 -05:00
Alex Berkowitz
8093721c24 Change Sub-Ghz Remote line length max to 16 2022-09-23 20:37:02 -05:00
2517 changed files with 116067 additions and 24578 deletions

View File

@@ -36,19 +36,12 @@ Min level: 1
Max level: 1
Weight: 3
Name: L2_Furippa2_128x64
Name: L1_Happy_holidays_128x64
Min butthurt: 0
Max butthurt: 6
Min level: 2
Max level: 2
Weight: 3
Name: L3_Furippa3_128x64
Min butthurt: 0
Max butthurt: 6
Min level: 3
Max butthurt: 14
Min level: 1
Max level: 3
Weight: 3
Weight: 4
Name: L1_Read_books_128x64
Min butthurt: 0
@@ -57,13 +50,6 @@ Min level: 1
Max level: 1
Weight: 3
Name: L2_Hacking_pc_128x64
Min butthurt: 0
Max butthurt: 8
Min level: 2
Max level: 2
Weight: 3
Name: L1_Cry_128x64
Min butthurt: 8
Max butthurt: 13
@@ -85,6 +71,62 @@ Min level: 1
Max level: 3
Weight: 3
Name: L1_Mods_128x64
Min butthurt: 0
Max butthurt: 9
Min level: 1
Max level: 3
Weight: 4
Name: L1_Painting_128x64
Min butthurt: 0
Max butthurt: 7
Min level: 1
Max level: 3
Weight: 3
Name: L1_Leaving_sad_128x64
Min butthurt: 14
Max butthurt: 14
Min level: 1
Max level: 3
Weight: 3
Name: L2_Wake_up_128x64
Min butthurt: 0
Max butthurt: 12
Min level: 2
Max level: 3
Weight: 4
Name: L2_Furippa2_128x64
Min butthurt: 0
Max butthurt: 6
Min level: 2
Max level: 2
Weight: 3
Name: L2_Hacking_pc_128x64
Min butthurt: 0
Max butthurt: 8
Min level: 2
Max level: 2
Weight: 3
Name: L2_Soldering_128x64
Min butthurt: 0
Max butthurt: 10
Min level: 2
Max level: 2
Weight: 3
Name: L3_Furippa3_128x64
Min butthurt: 0
Max butthurt: 6
Min level: 3
Max level: 3
Weight: 3
Name: L3_Hijack_radio_128x64
Min butthurt: 0
Max butthurt: 8
@@ -99,23 +141,9 @@ Min level: 3
Max level: 3
Weight: 3
Name: L3_Fireplace_128x64
Name: L1_Sleigh_ride_128x64
Min butthurt: 0
Max butthurt: 13
Min level: 2
Max level: 3
Weight: 3
Name: L2_Soldering_128x64
Min butthurt: 0
Max butthurt: 10
Min level: 2
Max level: 2
Weight: 3
Name: L1_Leaving_sad_128x64
Min butthurt: 14
Max butthurt: 14
Min level: 1
Max level: 3
Weight: 3
Weight: 4

View File

@@ -1,6 +1,10 @@
kind: pipeline
type: docker
name: "Build firmware"
name: "Release firmware"
platform:
os: linux
arch: amd64
steps:
- name: "Update submodules"
@@ -11,19 +15,63 @@ steps:
- git submodule foreach git config --local gc.auto 0
- git log -1 --format='%H'
- name: "Build default fw"
- name: "Build firmware"
image: hfdj/fztools
pull: never
commands:
- export DIST_SUFFIX=${DRONE_TAG}
- export WORKFLOW_BRANCH_OR_TAG=dev-cfw
- export WORKFLOW_BRANCH_OR_TAG=release-cfw
- ./fbt COMPACT=1 DEBUG=0 updater_package
- mkdir artifacts-default
- mv dist/f7-C/* artifacts-default/
- ls -laS artifacts-default
- ls -laS artifacts-default/f7-update-${DRONE_TAG}
- sed -i 's/(version)/'${DRONE_TAG}'/g' CHANGELOG.md
- echo '# [Install via Web Updater](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-'${DRONE_TAG}'.tgz&channel=dev-cfw&version='${DRONE_TAG}')' >> CHANGELOG.md
- echo '# [Install via Web Updater](https://lab.flipper.net/?url=https://unleashedflip.com/fw/${DRONE_TAG}/flipper-z-f7-update-'${DRONE_TAG}'.tgz&channel=release-cfw&version='${DRONE_TAG}')' >> CHANGELOG.md
- echo '' >> CHANGELOG.md
- echo '### [Version without custom animations - Install via Web Updater](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-'${DRONE_TAG}'n.tgz&channel=release-cfw&version='${DRONE_TAG}'n)' >> CHANGELOG.md
- echo '' >> CHANGELOG.md
- echo '### [Version with extra apps - Install via Web Updater](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'e.tgz&channel=release-cfw&version='${DRONE_TAG}'e)' >> CHANGELOG.md
environment:
FBT_TOOLS_CUSTOM_LINK:
from_secret: fbt_link
- name: "Build with extra apps"
image: hfdj/fztools
pull: never
commands:
- git clone https://github.com/xMasterX/unleashed-extra-pack.git
- cp -R unleashed-extra-pack/apps/* assets/resources/apps/
- rm -rf unleashed-extra-pack
- export DIST_SUFFIX=${DRONE_TAG}e
- export WORKFLOW_BRANCH_OR_TAG=release-cfw
- export FORCE_NO_DIRTY=yes
- rm -f build/f7-firmware-C/toolbox/version.*
- ./fbt COMPACT=1 DEBUG=0 updater_package
- mkdir artifacts-extra-apps
- mv dist/f7-C/* artifacts-extra-apps/
- ls -laS artifacts-extra-apps
- ls -laS artifacts-extra-apps/f7-update-${DRONE_TAG}e
environment:
FBT_TOOLS_CUSTOM_LINK:
from_secret: fbt_link
- name: "Build with ofw anims"
image: hfdj/fztools
pull: never
commands:
- rm -f assets/dolphin/external/manifest.txt
- cp .ci_files/anims_ofw.txt assets/dolphin/external/manifest.txt
- rm -rf assets/resources/apps/
- export DIST_SUFFIX=${DRONE_TAG}n
- export WORKFLOW_BRANCH_OR_TAG=no-custom-anims
- export FORCE_NO_DIRTY=yes
- rm -f build/f7-firmware-C/toolbox/version.*
- ./fbt COMPACT=1 DEBUG=0 updater_package
- mkdir artifacts-ofw-anims
- mv dist/f7-C/* artifacts-ofw-anims/
- ls -laS artifacts-ofw-anims
- ls -laS artifacts-ofw-anims/f7-update-${DRONE_TAG}n
environment:
FBT_TOOLS_CUSTOM_LINK:
from_secret: fbt_link
@@ -31,14 +79,24 @@ steps:
- name: "Bundle self-update packages"
image: kramos/alpine-zip
commands:
- tar czpf artifacts-default/flipper-z-f7-update-${DRONE_TAG}.tgz -C artifacts-default f7-update-${DRONE_TAG}
- cp artifacts-extra-apps/flipper-z-f7-update-${DRONE_TAG}e.tgz .
- cp artifacts-ofw-anims/flipper-z-f7-update-${DRONE_TAG}n.tgz .
- cp artifacts-default/flipper-z-f7-update-${DRONE_TAG}.tgz .
- zip -r artifacts-extra-apps/flipper-z-f7-update-${DRONE_TAG}e.zip artifacts-extra-apps/f7-update-${DRONE_TAG}e
- zip -r artifacts-ofw-anims/flipper-z-f7-update-${DRONE_TAG}n.zip artifacts-ofw-anims/f7-update-${DRONE_TAG}n
- zip -r artifacts-default/flipper-z-f7-update-${DRONE_TAG}.zip artifacts-default/f7-update-${DRONE_TAG}
- tar czpf artifacts-default/flipper-z-any-scripts-${DRONE_TAG}.tgz scripts debug
- rm -rf artifacts-extra-apps/f7-update-${DRONE_TAG}
- rm -rf artifacts-ofw-anims/f7-update-${DRONE_TAG}
- rm -rf artifacts-default/f7-update-${DRONE_TAG}
- ls -laS artifacts-extra-apps
- ls -laS artifacts-ofw-anims
- ls -laS artifacts-default
- mv artifacts-default/ ${DRONE_TAG}
- ls -laS ${DRONE_TAG}
- name: "Upload to updates server"
image: appleboy/drone-scp
- name: "Upload default to updates srv"
image: appleboy/drone-scp:linux-amd64
settings:
host:
from_secret: dep_host
@@ -49,8 +107,44 @@ steps:
port:
from_secret: dep_port
target:
from_secret: dep_target
source: flipper-z-f7-update-${DRONE_TAG}.tgz
from_secret: dep_target_new
source:
- ${DRONE_TAG}/*.tgz
- ${DRONE_TAG}/*.zip
- ${DRONE_TAG}/*.json
- ${DRONE_TAG}/*.elf
- ${DRONE_TAG}/*.dfu
- ${DRONE_TAG}/*.bin
- name: "Upload no-anims to updates srv"
image: appleboy/drone-scp:linux-amd64
settings:
host:
from_secret: dep_host
username:
from_secret: dep_user
password:
from_secret: dep_passwd
port:
from_secret: dep_port
target:
from_secret: dep_target_noanim
source: flipper-z-f7-update-${DRONE_TAG}n.tgz
- name: "Upload extra apps version to updates srv"
image: appleboy/drone-scp:linux-amd64
settings:
host:
from_secret: dep_host
username:
from_secret: dep_user
password:
from_secret: dep_passwd
port:
from_secret: dep_port
target:
from_secret: dep_target_extra
source: flipper-z-f7-update-${DRONE_TAG}e.tgz
- name: "Do Github release"
image: ddplugins/github-release
@@ -62,8 +156,10 @@ steps:
api_key:
from_secret: github_apikey
files:
- artifacts-default/*.tgz
- artifacts-default/*.zip
- ${DRONE_TAG}/*.tgz
- ${DRONE_TAG}/*.zip
- artifacts-ofw-anims/*.tgz
- artifacts-extra-apps/*.tgz
title: ${DRONE_TAG}
note: CHANGELOG.md
checksum:
@@ -71,6 +167,17 @@ steps:
- sha1
- crc32
- name: "Trigger update server reindex"
image: hfdj/fztools
pull: never
environment:
UPD_KEY:
from_secret: git_update_serv_token
UPD_URL:
from_secret: git_update_server_url
commands:
- curl -X POST -F 'key='$UPD_KEY'' $UPD_URL
- name: "Send files to telegram"
image: appleboy/drone-telegram
settings:
@@ -85,30 +192,47 @@ steps:
Version: {{build.tag}}
[-Github-](https://github.com/Eng1n33r/flipperzero-firmware/releases/tag/${DRONE_TAG})
[-Github - Changelog-](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/${DRONE_TAG})
[-Install via Web Updater-](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=dev-cfw&version=${DRONE_TAG})"
[-How to install firmware-](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
[-Download latest extra apps pack-](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)
[-Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/${DRONE_TAG}/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=release-cfw&version=${DRONE_TAG})
[-Version without custom animations - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-${DRONE_TAG}n.tgz&channel=release-cfw&version=${DRONE_TAG}n)
[-Version with extra apps - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_TAG}e.tgz&channel=release-cfw&version=${DRONE_TAG}e)"
document:
- artifacts-default/flipper-z-f7-update-${DRONE_TAG}.tgz
- ${DRONE_TAG}/flipper-z-f7-update-${DRONE_TAG}.tgz
- name: "Send discord notification"
image: appleboy/drone-discord
image: hfdj/fztools
pull: never
environment:
DISCORD_WEBHOOK:
from_secret: dis_release_webhook
commands:
- wget "https://raw.githubusercontent.com/fieu/discord.sh/e1dc1a7595efad2cad8f072f0b3531c470f5b7c8/discord.sh"
- chmod +x ./discord.sh
- ./discord.sh --text 'New Unleashed firmware released!\n\nVersion - '${DRONE_TAG}'\n\n[[Github - Changelog]](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/'${DRONE_TAG}')\n\n[-How to install firmware-](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)\n\n[-Download latest extra apps pack-](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)\n\n[-Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/'${DRONE_TAG}'/flipper-z-f7-update-'${DRONE_TAG}'.tgz&channel=release-cfw&version='${DRONE_TAG}')\n\n[-Version without custom animations - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-'${DRONE_TAG}'n.tgz&channel=release-cfw&version='${DRONE_TAG}'n)\n\n[-Version with extra apps - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'e.tgz&channel=release-cfw&version='${DRONE_TAG}'e)'
- name: "Send extra pack build to telegram"
image: appleboy/drone-telegram
settings:
webhook_id:
from_secret: ds_wh_id
webhook_token:
from_secret: ds_wh_token
message: "New Unleashed firmware released!
Version: {{build.tag}}
[[Github]](https://github.com/Eng1n33r/flipperzero-firmware/releases/tag/${DRONE_TAG})
[-Install via Web Updater-](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=dev-cfw&version=${DRONE_TAG})"
token:
from_secret: tgtoken
to:
from_secret: tgid
format: markdown
message: "Build with extra apps pack:"
document:
- flipper-z-f7-update-${DRONE_TAG}e.tgz
trigger:
event:
@@ -116,3 +240,186 @@ trigger:
node:
typ: haupt
---
kind: pipeline
type: docker
name: "Dev build"
platform:
os: linux
arch: amd64
steps:
- name: "Update submodules"
image: alpine/git
commands:
- git submodule sync
- git -c protocol.version=2 submodule update --init --force --recursive
- git submodule foreach git config --local gc.auto 0
- git log -1 --format='%H'
- name: "Build dev FW"
image: hfdj/fztools
pull: never
commands:
- export DIST_SUFFIX=${DRONE_BUILD_NUMBER}
- export WORKFLOW_BRANCH_OR_TAG=dev-cfw
- ./fbt COMPACT=1 DEBUG=0 updater_package
- mkdir artifacts-default
- mv dist/f7-C/* artifacts-default/
- ls -laS artifacts-default
- ls -laS artifacts-default/f7-update-${DRONE_BUILD_NUMBER}
environment:
FBT_TOOLS_CUSTOM_LINK:
from_secret: fbt_link
- name: "Build dev with extra apps"
image: hfdj/fztools
pull: never
commands:
- git clone https://github.com/xMasterX/unleashed-extra-pack.git
- cp -R unleashed-extra-pack/apps/* assets/resources/apps/
- rm -rf unleashed-extra-pack
- export DIST_SUFFIX=${DRONE_BUILD_NUMBER}e
- export WORKFLOW_BRANCH_OR_TAG=dev-cfw
- export FORCE_NO_DIRTY=yes
- rm -f build/f7-firmware-C/toolbox/version.*
- ./fbt COMPACT=1 DEBUG=0 updater_package
- mkdir artifacts-extra-apps
- mv dist/f7-C/* artifacts-extra-apps/
- ls -laS artifacts-extra-apps
- ls -laS artifacts-extra-apps/f7-update-${DRONE_BUILD_NUMBER}e
environment:
FBT_TOOLS_CUSTOM_LINK:
from_secret: fbt_link
- name: "Bundle self-update packages"
image: kramos/alpine-zip
commands:
- cp artifacts-extra-apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz .
- cp artifacts-default/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz .
- rm -rf artifacts-default/f7-update-${DRONE_BUILD_NUMBER}
- ls -laS artifacts-default
- mv artifacts-default/ dev
- ls -laS dev
- name: "Clean dev folder"
image: appleboy/drone-ssh:linux-amd64
settings:
host:
from_secret: dep_host
username:
from_secret: dep_user
password:
from_secret: dep_passwd
port:
from_secret: dep_port
command_timeout: 30s
script:
- cd web/unleashedflip.com/public_html/fw/dev && rm -f ./*
- name: "Upload default to updates srv"
image: appleboy/drone-scp:linux-amd64
settings:
host:
from_secret: dep_host
username:
from_secret: dep_user
password:
from_secret: dep_passwd
port:
from_secret: dep_port
target:
from_secret: dep_target_new
source:
- dev/*.tgz
- dev/*.zip
- dev/*.json
- dev/*.elf
- dev/*.dfu
- dev/*.bin
- name: "Upload extra apps version to updates srv"
image: appleboy/drone-scp:linux-amd64
settings:
host:
from_secret: dep_host
username:
from_secret: dep_user
password:
from_secret: dep_passwd
port:
from_secret: dep_port
target:
from_secret: dep_target_extra
source: flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz
- name: "Trigger update server reindex"
image: hfdj/fztools
pull: never
environment:
UPD_KEY:
from_secret: git_update_serv_token
UPD_URL:
from_secret: git_update_server_url
commands:
- curl -X POST -F 'key='$UPD_KEY'' $UPD_URL
- name: "Send files to telegram"
image: appleboy/drone-telegram
settings:
token:
from_secret: tgtoken
to:
from_secret: tgid_dev
format: markdown
message: "Unleashed firmware dev build successful!
Build: {{build.number}}
SHA: {{commit.sha}}
Commit: {{commit.message}}
[-Version with extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}e)
[-Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER})"
document:
- dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz
- name: "Send extra pack build to telegram"
image: appleboy/drone-telegram
settings:
token:
from_secret: tgtoken
to:
from_secret: tgid_dev
format: markdown
message: "Build with extra apps pack:"
document:
- flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz
- name: "Send discord notification"
image: hfdj/fztools
pull: never
environment:
DISCORD_WEBHOOK:
from_secret: dis_dev_webhook
commands:
- wget "https://raw.githubusercontent.com/fieu/discord.sh/e1dc1a7595efad2cad8f072f0b3531c470f5b7c8/discord.sh"
- chmod +x ./discord.sh
- ./discord.sh --text 'Unleashed firmware dev build successful!\n\nBuild - '${DRONE_BUILD_NUMBER}'\n\nSHA - '${DRONE_COMMIT_SHA}'\n\n[-Version with extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'e.tgz&channel=dev-cfw&version='${DRONE_BUILD_NUMBER}'e)\n\n[-Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/dev/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'.tgz&channel=dev-cfw&version='${DRONE_BUILD_NUMBER}')'
trigger:
branch:
- dev
event:
- push
node:
typ: haupt

6
.github/CODEOWNERS vendored
View File

@@ -1 +1,5 @@
* @xMasterX
# Default
* @xMasterX
# Assets
/assets/resources/infrared/ @xMasterX @amec0e

7
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
ko_fi: masterx
custom:
[
"https://boosty.to/mmxdev",
"https://pay.cloudtips.ru/p/7b3e9d65",
"https://yoomoney.ru/fundraise/XA49mgQLPA0.221209",
]

View File

@@ -4,5 +4,5 @@ contact_links:
url: https://t.me/flipperzero_unofficial
about: Unofficial Telegram chat
- name: Discord
url: https://discord.gg/58D6E8BtTU
url: https://discord.unleashedflip.com
about: Unofficial Discord Community

7
.gitignore vendored
View File

@@ -1,4 +1,5 @@
*.swp
*.swo
*.gdb_history
@@ -30,6 +31,10 @@ Brewfile.lock.json
# Visual Studio Code
.vscode/
# Kate
.kateproject
.kateconfig
# legendary cmake's
build
CMakeLists.txt
@@ -55,3 +60,5 @@ openocd.log
# PVS Studio temporary files
.PVS-Studio/
PVS-Studio.log
.gdbinit

9
.gitmodules vendored
View File

@@ -22,12 +22,15 @@
[submodule "lib/microtar"]
path = lib/microtar
url = https://github.com/amachronic/microtar.git
[submodule "lib/scons"]
path = lib/scons
url = https://github.com/SCons/scons.git
[submodule "lib/mbedtls"]
path = lib/mbedtls
url = https://github.com/Mbed-TLS/mbedtls.git
[submodule "lib/cxxheaderparser"]
path = lib/cxxheaderparser
url = https://github.com/robotpy/cxxheaderparser.git
[submodule "applications/plugins/subbrute"]
path = applications/plugins/subbrute
url = https://github.com/derskythe/flipperzero-subbrute.git
[submodule "applications/plugins/dap_link/lib/free-dap"]
path = applications/plugins/dap_link/lib/free-dap
url = https://github.com/ataradov/free-dap.git

View File

@@ -1,10 +1,12 @@
# MLib macros we can't do much about.
//-V:M_LET:1048,1044
//-V:M_EACH:1048,1044
//-V:ARRAY_DEF:760,747,568,776,729,712,654
//-V:LIST_DEF:760,747,568,712,729,654,776
//-V:BPTREE_DEF2:779,1086,557,773,512
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685
//-V:ALGO_DEF:1048,747,1044
//-V:TUPLE_DEF2:524,590,1001,760
# Non-severe malloc/null pointer deref warnings
//-V::522:2,3
@@ -15,8 +17,30 @@
# Potentially null argument warnings
//-V:memset:575
//-V:memcpy:575
//-V:memcmp:575
//-V:strlen:575
//-V:strcpy:575
//-V:strncpy:575
//-V:strchr:575
# For loop warning on M_FOREACH
//-V:for:1044
# Bitwise OR
//-V:bit:792
# Do not complain about similar code
//-V::525
# Common embedded development pointer operations
//-V::566
//-V::1032
# Warnings about length mismatch
//-V:property_value_out:666
# Model-related warnings
//-V:with_view_model:1044,1048
# Functions that always return the same error code
//-V:picopass_device_decrypt:1048

View File

@@ -1 +1 @@
--rules-config .pvsconfig -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/micro-ecc -e lib/microtar -e lib/mlib -e lib/qrcode -e lib/ST25RFAL002 -e lib/STM32CubeWB -e lib/u8g2 -e */arm-none-eabi/*
--ignore-ccache -C gccarm --rules-config .pvsconfig -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/micro-ecc -e lib/microtar -e lib/mlib -e lib/qrcode -e lib/ST25RFAL002 -e lib/STM32CubeWB -e lib/u8g2 -e lib/nanopb -e */arm-none-eabi/* -e applications/plugins/dap_link/lib/free-dap

View File

@@ -2,7 +2,7 @@
"configurations": [
{
"name": "Win32",
"compilerPath": "${workspaceFolder}/toolchain/i686-windows/bin/arm-none-eabi-gcc.exe",
"compilerPath": "${workspaceFolder}/toolchain/x86_64-windows/bin/arm-none-eabi-gcc.exe",
"intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
"configurationProvider": "ms-vscode.cpptools",

View File

@@ -28,15 +28,17 @@
"servertype": "openocd",
"device": "stlink",
"svdFile": "./debug/STM32WB55_CM4.svd",
// If you're debugging early in the boot process, before OS scheduler is running,
// you have to comment out the following line.
"rtos": "FreeRTOS",
"configFiles": [
"interface/stlink.cfg",
"./debug/stm32wbx.cfg",
],
"postAttachCommands": [
// "attach 1",
// "compare-sections",
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
// "source debug/FreeRTOS/FreeRTOS.py",
// "svd_load debug/STM32WB55_CM4.svd"
]
@@ -58,6 +60,7 @@
"set confirm off",
"set mem inaccessible-by-default off",
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
// "compare-sections",
]
// "showDevDebugOutput": "raw",
@@ -75,9 +78,30 @@
"rtos": "FreeRTOS",
"postAttachCommands": [
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
]
// "showDevDebugOutput": "raw",
},
{
"name": "Attach FW (DAP)",
"cwd": "${workspaceFolder}",
"executable": "./build/latest/firmware.elf",
"request": "attach",
"type": "cortex-debug",
"servertype": "openocd",
"device": "cmsis-dap",
"svdFile": "./debug/STM32WB55_CM4.svd",
"rtos": "FreeRTOS",
"configFiles": [
"interface/cmsis-dap.cfg",
"./debug/stm32wbx.cfg",
],
"postAttachCommands": [
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
],
// "showDevDebugOutput": "raw",
},
{
"name": "fbt debug",
"type": "python",

View File

@@ -6,13 +6,13 @@
"cortex-debug.enableTelemetry": false,
"cortex-debug.variableUseNaturalFormat": true,
"cortex-debug.showRTOS": true,
"cortex-debug.armToolchainPath.windows": "${workspaceFolder}/toolchain/i686-windows/bin",
"cortex-debug.armToolchainPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/bin",
"cortex-debug.armToolchainPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin",
"cortex-debug.armToolchainPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin",
"cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/i686-windows/openocd/bin/openocd.exe",
"cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/openocd/bin/openocd.exe",
"cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
"cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
"cortex-debug.gdbPath.windows": "${workspaceFolder}/toolchain/i686-windows/bin/arm-none-eabi-gdb-py.bat",
"cortex-debug.gdbPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/bin/arm-none-eabi-gdb-py.bat",
"cortex-debug.gdbPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gdb-py",
"cortex-debug.gdbPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gdb-py",
"editor.formatOnSave": true,

View File

@@ -105,17 +105,23 @@
"type": "shell",
"command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
},
{
"label": "[Debug] Create PVS-Studio report",
"group": "build",
"type": "shell",
"command": "./fbt firmware_pvs"
},
{
"label": "[Debug] Build FAPs",
"group": "build",
"type": "shell",
"command": "./fbt plugin_dist"
"command": "./fbt fap_dist"
},
{
"label": "[Release] Build FAPs",
"group": "build",
"type": "shell",
"command": "./fbt COMPACT=1 DEBUG=0 plugin_dist"
"command": "./fbt COMPACT=1 DEBUG=0 fap_dist"
},
{
"label": "[Debug] Launch App on Flipper",
@@ -128,6 +134,50 @@
"group": "build",
"type": "shell",
"command": "./fbt COMPACT=1 DEBUG=0 launch_app APPSRC=${relativeFileDirname}"
},
{
"label": "[Debug] Launch App on Flipper with Serial Console",
"dependsOrder": "sequence",
"group": "build",
"dependsOn": [
"[Debug] Launch App on Flipper",
"Serial Console"
]
},
{
"label": "[Debug] Build and upload all FAPs to Flipper over USB",
"group": "build",
"type": "shell",
"command": "./fbt fap_deploy"
},
{
"label": "[Release] Build and upload all FAPs to Flipper over USB",
"group": "build",
"type": "shell",
"command": "./fbt COMPACT=1 DEBUG=0 fap_deploy"
},
{
// Press Ctrl+] to quit
"label": "Serial Console",
"type": "shell",
"command": "./fbt cli",
"group": "none",
"isBackground": true,
"options": {
"env": {
"FBT_NO_SYNC": "0"
}
},
"presentation": {
"reveal": "always",
"revealProblems": "never",
"showReuseMessage": false,
"panel": "dedicated",
"focus": true,
"echo": true,
"close": true,
"group": "Logger"
}
}
]
}

View File

@@ -11,5 +11,8 @@
"augustocdias.tasks-shell-input"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
"unwantedRecommendations": [
"twxs.cmake",
"ms-vscode.cmake-tools"
]
}

View File

@@ -1,22 +1,44 @@
### New changes
* Hide layouts folder in badusb app
* SubGHz: Added 868.8 mhz into user config for sommer systems
* Renamed apps to make it look a bit better in Apps tab in archive app
* Infrared: Update assets (by @Amec0e)
* OFW: Keyboard: show Uppercase keys when replacing content
* OFW: (Temporarily excluded due to crashes) Furi Thread: don't use thread pointer after FuriThreadStateStopped callback
* OFW: Resources cleanup in updater
* OFW: Signal Generator app
* SubGHz: **Nice ON2E (Nice One)** support (by @assasinfil | PR #335)
* SubGHz: Remove 467.75 From freq analyzer since it has too much noise (Frequency is still can be used, just excluded from FA to avoid false detections)
* Archive and FileBrowser: **Fixed more navigation issues** (by @Willy-JL | PR #334)
* Plugins -> SubGHz Bruteforcer: Fix Linear Delta 3 repeats (now its more stable and we will be sure signal is received correctly)
* Plugins: Updated TOTP (Authenticator) [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator)
* OFW: **Fix Cyfral & Metakom emulation (My temp fix removed and proper fix from OFW applied)**
* OFW: BadUSB: disable CDC mode, USB mode switch fix
* OFW: Updater visual fixes
#### [🎲 Download extra apps pack](https://download-directory.github.io/?url=https://github.com/UberGuidoZ/Flipper/tree/main/Applications/Unleashed)
#### [🎲 Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)
[-> How to install firmware](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/HowToInstall.md)
[-> How to install firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
[-> Download qFlipper 1.2.0 (allows .tgz installation) (official link)](https://update.flipperzero.one/builds/qFlipper/1.2.0/)
[-> Download qFlipper (official link)](https://flipperzero.one/update)
## Please support development of the project
* Boosty: https://boosty.to/mmxdev
* Ko-Fi: https://ko-fi.com/masterx
* cloudtips (only RU payments accepted): https://pay.cloudtips.ru/p/7b3e9d65
* YooMoney (only RU payments accepted): https://yoomoney.ru/fundraise/XA49mgQLPA0.221209
* USDT(TRC20): `TSXcitMSnWXUFqiUfEXrTVpVewXy2cYhrs`
* BCH: `qquxfyzntuqufy2dx0hrfr4sndp0tucvky4sw8qyu3`
* ETH/BSC/ERC20-Tokens: `darkflippers.eth` (or `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`)
* BTC: `bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`
* DOGE: `D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`
* LTC: `ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`
* XMR (Monero): `41xUz92suUu1u5Mu4qkrcs52gtfpu9rnZRdBpCJ244KRHf6xXSvVFevdf2cnjS7RAeYr5hn9MsEfxKoFDRSctFjG5fv1Mhn`
* TON: `EQCOqcnYkvzOZUV_9bPE_8oTbOrOF03MnF-VcJyjisTZmpGf`
### Thanks to our sponsors:
callmezimbra, Quen0n, MERRON, grvpvl (lvpvrg), art_col, ThurstonWaffles, Moneron, UterGrooll, LUCFER, Northpirate, zloepuzo, T.Rat, Alexey B., ionelife, ...
and all other great people who supported our project and me (xMasterX), thanks to you all!
**Note: To avoid issues with .dfu, prefer installing using .tgz with qFlipper, web updater or by self update package, all needed assets will be installed**
Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip` or download `.tgz` for iOS mobile app / qFlipper
**Recommended option - Web Updater**
What means `n` or `e` in - `flipper-z-f7-update-(version)(n / e).tgz` ? - `n` means this build comes without our custom animations, only official flipper animations,
`e` means build has extra apps pack preinstalled
Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip` or download `.tgz` for mobile app / qFlipper
Update using qFlipper (1.2.0) is now possible with `.tgz` update package! Also you can use Web Updater or self-update package.

View File

@@ -3,15 +3,15 @@
Nice to see you reading this document, we really appreciate it.
As all documents of this kind it's unable to cover everything.
But it will cover general rules that we enforcing on PR review.
But it will cover general rules that we are enforcing on PR review.
Also we already have automatic rules checking and formatting,
but it got it's limitations and this guide is still mandatory.
Also, we already have automatic rules checking and formatting,
but it got its limitations and this guide is still mandatory.
Some part of this project do have it's own naming and coding guides.
Some part of this project do have its own naming and coding guides.
For example: assets. Take a look into `ReadMe.md` in assets folder for more details.
Also 3rd party libraries are none of our concern.
Also, 3rd party libraries are none of our concern.
And yes, this set is not final and we are open to discussion.
If you want to add/remove/change something here please feel free to open new ticket.
@@ -30,7 +30,7 @@ Our guide is inspired by, but not claiming to be compatible with:
Code we write is intended to be public.
Avoid one-liners from hell and keep code complexity under control.
Try to make code self explanatory and add comments if needed.
Try to make code self-explanatory and add comments if needed.
Leave references to standards that you are implementing.
Use project wiki to document new/reverse engineered standards.
@@ -52,7 +52,7 @@ Almost everything in flipper firmware is built around this concept.
## Naming
### Type names are CamelCase
### Type names are PascalCase
Examples:
@@ -89,7 +89,7 @@ Enforced by linter.
Suffixes:
- `alloc` - allocate and init instance. C style constructor. Returns pointer to instance.
- `free` - deinit and release instance. C style destructor. Takes pointer to instance.
- `free` - de-init and release instance. C style destructor. Takes pointer to instance.
# C++ coding style

View File

@@ -1,21 +0,0 @@
$(info +-------------------------------------------------+)
$(info | |)
$(info | Hello, this is Flipper team speaking! |)
$(info | |)
$(info | We've migrated to new build system |)
$(info | It's nice and based on scons |)
$(info | |)
$(info | Crash course: |)
$(info | |)
$(info | `./fbt` |)
$(info | `./fbt flash` |)
$(info | `./fbt debug` |)
$(info | |)
$(info | More details in documentation/fbt.md |)
$(info | |)
$(info | Also Please leave your feedback here: |)
$(info | https://flipp.dev/4RDu |)
$(info | or |)
$(info | https://flipp.dev/2XM8 |)
$(info | |)
$(info +-------------------------------------------------+)

191
ReadMe.md
View File

@@ -1,123 +1,208 @@
<h3 align="center">
<a href="https://github.com/Eng1n33r/flipperzero-firmware">
<a href="https://github.com/DarkFlippers/unleashed-firmware">
<img src="https://user-images.githubusercontent.com/10697207/186202043-26947e28-b1cc-459a-8f20-ffcc7fc0c71c.png" align="center" alt="fzCUSTOM" border="0">
</a>
</h3>
### Welcome to Flipper Zero Unleashed Firmware repo!
Our goal is to make any features possible in this device without any limitations!
### Welcome to the Flipper Zero Unleashed Firmware repo!
Please help us implement emulation for all subghz dynamic (rolling code) protocols!
**This firmware is a fork from** [flipperdevices/flipperzero-firmware](https://github.com/flipperdevices/flipperzero-firmware)
<br>
### This software is for experimental purposes only and is not meant for any illegal activity/purposes. <br> We do not condone illegal activity and strongly encourage keeping transmissions to legal/valid uses allowed by law. <br> Also this software is made without any support from Flipper Devices and in no way related to official devs.
Our goal is to make all features possible on this device without any limitations!
Please help us implement emulation for all Sub-GHz dynamic (rolling code) protocols!
<br>
### This software is for experimental purposes only and is not meant for any illegal activity/purposes. <br> We do not condone illegal activity and strongly encourage keeping transmissions to legal/valid uses allowed by law. <br> Also, this software is made without any support from Flipper Devices and is in no way related to the official devs.
<br>
Our Discord Community:
<br>
<a href="https://discord.gg/flipperzero-unofficial"><img src="https://discordapp.com/api/guilds/937479784148115456/widget.png?style=banner4" alt="Unofficial Discord Community"></a>
<a href="https://discord.unleashedflip.com"><img src="https://discordapp.com/api/guilds/937479784148115456/widget.png?style=banner4" alt="Unofficial Discord Community" target="_blank"></a>
<br>
<br>
<br>
## Dev builds
- https://dev.unleashedflip.com/
- https://t.me/kotnehleb
## Releases in Telegram
- https://t.me/unleashed_fw
# What's changed
* SubGHz regional TX restrictions removed
* SubGHz frequecy range can be extended in settings file (Warning: It can damage flipper's hardware)
* Sub-GHz regional TX restrictions removed
* Sub-GHz frequency range can be extended in settings file (Warning: It can damage Flipper's hardware)
* Many rolling code protocols now have the ability to save & send captured signals
* FAAC SLH (Spa) & BFT Mitto (secure with seed) manual creation
* Sub-GHz static code brute-force plugin
* LFRFID Fuzzer plugin
* Custom community plugins and games added
* Extra SubGHz frequencies + extra Mifare Classic keys
* Custom community plugins and games added + all known working apps can be downloaded in extra pack in every release
* Extra Sub-GHz frequencies + extra Mifare Classic keys
* Picopass/iClass plugin included in releases
* Recompiled IR TV Universal Remote for ALL buttons
* Universal remote for Projectors, Fans, A/Cs and Audio(soundbars, etc.)
* BadUSB keyboard layouts
* Customizable Flipper name
* SubGHz -> Press OK in frequency analyzer to use detected frequency in Read modes
* Sub-GHz -> Press OK in frequency analyzer to use detected frequency in Read modes
* Sub-GHz -> Long press OK button in Sub-GHz Frequency analyzer to switch to Read menu
* Sub-GHz -> External CC1101 module support
* Other small fixes and changes throughout
* See other changes in changelog and in readme below
Also check changelog in releases for latest updates!
Also check the changelog in releases for latest updates!
### Current modified and new SubGHz protocols list:
- HCS101
- An-Motors
### Current modified and new Sub-GHz protocols list:
Thanks to Official team (to thier SubGHz Developer, Skorp) for implementing decoders for these protocols.
Encoders/sending made by Eng1n33r & @xMasterX:
- Keeloq [Not ALL systems supported for decode or emulation yet!] - [Supported manufacturers list](https://0bin.net/paste/VwR2lNJY#WH9vnPgvcp7w6zVKucFCuNREKAcOij8KsJ6vqLfMn3b)
- Keeloq: HCS101
- Keeloq: AN-Motors
- Keeloq: JCM Tech
- Keeloq: MHouse
- Keeloq: Nice Smilo
- Keeloq: DTM Neo
- Keeloq: FAAC RC,XT
- Keeloq: Mutancode
- Keeloq: Normstahl
- CAME Atomo
- FAAC SLH (Spa) [External seed calculation required]
- BFT Mitto [External seed calculation required]
- Keeloq [Not ALL systems supported yet!]
- Nice Flor S
- FAAC SLH (Spa) [External seed calculation required (For info contact me in Discord: Nano#8998)]
- BFT Mitto [External seed calculation required (For info contact me in Discord: Nano#8998)]
- Security+ v1 & v2
- Star Line (saving only)
- Star Line
## Support us so we can buy equipment and develop new features
* ETH/BSC/ERC20-Tokens: `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`
Encoders made by @assasinfil & @xMasterX:
- Somfy Telis
- Somfy Keytis
- KingGates Stylo 4k
- Alutech AT-4N
- Nice ON2E (Nice One)
## Please support development of the project
The majority of this project is developed and maintained by me, @xMasterX.
I'm unemployed because of the war, and the only income I receive is from your donations.
Our team is small and the guys are working on this project as much as they can solely based on the enthusiasm they have for this project and the community.
- @assasinfil - SubGHz
- @Svaarich - UI design and animations
- @Amec0e - Infrared assets
- Community moderators in Telegram, Discord, and Reddit
- And of course our GitHub community. Your PRs are a very important part of this firmware and open-source development.
The amount of work done on this project is huge and we need your support, no matter how large or small. Even if you just say, "Thank you Unleashed firmware developers!" somewhere. Doing so will help us continue our work and will help drive us to make the firmware better every time.
Also, regarding our releases, every build has and always will be free and open-source. There will be no paywall releases or closed-source apps within the firmware. As long as I am working on this project it will never happen.
You can support us by using links or addresses below:
* Boosty: https://boosty.to/mmxdev
* Ko-Fi: https://ko-fi.com/masterx
* cloudtips (only RU payments accepted): https://pay.cloudtips.ru/p/7b3e9d65
* YooMoney (only RU payments accepted): https://yoomoney.ru/fundraise/XA49mgQLPA0.221209
* USDT(TRC20): `TSXcitMSnWXUFqiUfEXrTVpVewXy2cYhrs`
* BCH: `qquxfyzntuqufy2dx0hrfr4sndp0tucvky4sw8qyu3`
* ETH/BSC/ERC20-Tokens: `darkflippers.eth` (or `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`)
* BTC: `bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`
* DOGE: `D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`
* LTC: `ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`
* XMR (Monero): `41xUz92suUu1u5Mu4qkrcs52gtfpu9rnZRdBpCJ244KRHf6xXSvVFevdf2cnjS7RAeYr5hn9MsEfxKoFDRSctFjG5fv1Mhn`
* TON: `EQCOqcnYkvzOZUV_9bPE_8oTbOrOF03MnF-VcJyjisTZmpGf`
### Community apps included:
- RFID Fuzzer plugin [(by Ganapati)](https://github.com/Eng1n33r/flipperzero-firmware/pull/54) with changes by @xMasterX & New protocols by @mvanzanten
- Sub-GHz bruteforce plugin [(by Ganapati & xMasterX)](https://github.com/Eng1n33r/flipperzero-firmware/pull/57) & Refactored by @derskythe
- Sub-GHz playlist plugin [(by darmiel)](https://github.com/Eng1n33r/flipperzero-firmware/pull/62)
- **RFID Fuzzer** [(by Ganapati & @xMasterX)](https://github.com/DarkFlippers/unleashed-firmware/pull/54) & New protocols by @mvanzanten
- **Sub-GHz bruteforcer** [(by @derskythe & xMasterX)](https://github.com/derskythe/flipperzero-subbrute) [(original by Ganapati & xMasterX)](https://github.com/DarkFlippers/unleashed-firmware/pull/57)
- **Sub-GHz playlist** [(by darmiel)](https://github.com/DarkFlippers/unleashed-firmware/pull/62)
- ESP8266 Deauther plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-Wifi-ESP8266-Deauther-Module)
- WiFi Scanner plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-WiFi-Scanner_Module)
- MultiConverter plugin [(by theisolinearchip)](https://github.com/theisolinearchip/flipperzero_stuff)
- WAV player plugin (fixed) [(OFW: DrZlo13)](https://github.com/flipperdevices/flipperzero-firmware/tree/zlo/wav-player)
- UPC-A Barcode generator plugin [(by McAzzaMan)](https://github.com/McAzzaMan/flipperzero-firmware/tree/UPC-A_Barcode_Generator/applications/barcode_generator)
- USB Keyboard plugin [(by huuck)](https://github.com/huuck/FlipperZeroUSBKeyboard)
- WAV Player [(OFW: DrZlo13)](https://github.com/flipperdevices/flipperzero-firmware/tree/zlo/wav-player) - Fixed and improved by [LTVA1](https://github.com/LTVA1/wav_player)
- Barcode generator plugin [(original by McAzzaMan)](https://github.com/McAzzaMan/flipperzero-firmware/tree/UPC-A_Barcode_Generator/applications/barcode_generator) - [EAN-8 and refactoring](https://github.com/DarkFlippers/unleashed-firmware/pull/154) by @msvsergey
- GPIO: Sentry Safe plugin [(by H4ckd4ddy)](https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin)
- ESP32: WiFi Marauder companion plugin [(by 0xchocolate)](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion)
- NRF24: Sniffer & MouseJacker (with changes) [(by mothball187)](https://github.com/mothball187/flipperzero-nrf24/tree/main/mousejacker)
- Simple Clock (timer by GMMan / settings by kowalski7cc) [(Original by CompaqDisc)](https://gist.github.com/CompaqDisc/4e329c501bd03c1e801849b81f48ea61)
- UniversalRF Remix / Sub-GHz Remote [(by ESurge)](https://github.com/ESurge/flipperzero-firmware-unirfremix)[(updated and all protocol support added by darmiel & xMasterX)](https://github.com/darmiel/flipper-playlist/tree/feat/unirf-protocols)
- Simple Clock (timer by GMMan) [(original by CompaqDisc)](https://gist.github.com/CompaqDisc/4e329c501bd03c1e801849b81f48ea61)
- **Sub-GHz Remote** (UniversalRF Remix) [(by @darmiel & @xMasterX)](https://github.com/darmiel/flipper-playlist/tree/feat/unirf-protocols) (original by @ESurge)
- Spectrum Analyzer (with changes) [(by jolcese)](https://github.com/jolcese/flipperzero-firmware/tree/spectrum/applications/spectrum_analyzer) - [Ultra Narrow mode & scan channels non-consecutively](https://github.com/theY4Kman/flipperzero-firmware/commits?author=theY4Kman)
- Metronome [(by panki27)](https://github.com/panki27/Metronome)
- DTMF Dolphin [(by litui)](https://github.com/litui/dtmf_dolphin)
- **TOTP (Authenticator)** [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator)
- GPS [(by ezod)](https://github.com/ezod/flipperzero-gps) works with module `NMEA 0183` via UART (13TX, 14RX, GND pins on Flipper)
- i2c Tools [(by NaejEL)](https://github.com/NaejEL/flipperzero-i2ctools) - C0 -> SCL / C1 -> SDA / GND -> GND | 3v3 logic levels only!
- HC-SR04 Distance sensor - Ported and modified by @xMasterX [(original by Sanqui)](https://github.com/Sanqui/flipperzero-firmware/tree/hc_sr04) - How to connect -> (5V -> VCC) / (GND -> GND) / (13|TX -> Trig) / (14|RX -> Echo)
- Morse Code [(by wh00hw)](https://github.com/wh00hw/MorseCodeFAP)
- **Unitemp - Temperature sensors reader** (DHT11/22, DS18B20, BMP280, HTU21x and more) [(by quen0n)](https://github.com/quen0n/unitemp-flipperzero)
- BH1750 - Lightmeter [(by oleksiikutuzov)](https://github.com/oleksiikutuzov/flipperzero-lightmeter)
- **iButton Fuzzer** [(by xMasterX)](https://github.com/xMasterX/ibutton-fuzzer)
- HEX Viewer [(by QtRoS)](https://github.com/QtRoS/flipper-zero-hex-viewer)
- POCSAG Pager [(by xMasterX & Shmuma)](https://github.com/xMasterX/flipper-pager)
- Text Viewer [(by kowalski7cc & kyhwana)](https://github.com/kowalski7cc/flipper-zero-text-viewer/tree/refactor-text-app)
- **UART Terminal** [(by cool4uma)](https://github.com/cool4uma/UART_Terminal/tree/main)
- **ProtoView** [(by antirez)](https://github.com/antirez/protoview)
Games:
- DOOM (fixed) [(By p4nic4ttack)](https://github.com/p4nic4ttack/doom-flipper-zero/)
- DOOM (fixed) [(by p4nic4ttack)](https://github.com/p4nic4ttack/doom-flipper-zero/)
- Zombiez [(Reworked By DevMilanIan)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/240) [(Original By Dooskington)](https://github.com/Dooskington/flipperzero-zombiez)
- Flappy Bird [(By DroomOne)](https://github.com/DroomOne/flipperzero-firmware/tree/dev/applications/flappy_bird)
- Flappy Bird [(by DroomOne)](https://github.com/DroomOne/flipperzero-firmware/tree/dev/applications/flappy_bird)
- Arkanoid (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
- Tic Tac Toe (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
- Tetris (with fixes) [(by jeffplang)](https://github.com/jeffplang/flipperzero-firmware/tree/tetris_game/applications/tetris_game)
- Minesweeper [(by panki27)](https://github.com/panki27/minesweeper)
- Heap Defence (aka Stack Attack) - Ported to latest firmware by @xMasterX - [(original by wquinoa & Vedmein)](https://github.com/Vedmein/flipperzero-firmware/tree/hd/svisto-perdelki)
- Game15 [(by x27)](https://github.com/x27/flipperzero-game15)
- Solitaire [(by teeebor)](https://github.com/teeebor/flipper_games)
- BlackJack [(by teeebor)](https://github.com/teeebor/flipper_games)
- 2048 game [(by eugene-kirzhanov)](https://github.com/eugene-kirzhanov/flipper-zero-2048-game)
### Other changes
- BadUSB -> Keyboard layouts [(by rien > dummy-decoy)](https://github.com/dummy-decoy/flipperzero-firmware/tree/dummy_decoy/bad_usb_keyboard_layout)
- SubGHz -> New frequency analyzer - [(by ClusterM)](https://github.com/Eng1n33r/flipperzero-firmware/pull/43)
- SubGHz -> Detect RAW feature - [(by perspecdev)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/152)
- SubGHz -> Save last used frequency and moduluation [(by derskythe)](https://github.com/Eng1n33r/flipperzero-firmware/pull/77)
- SubGHz -> Press OK in frequency analyzer to use detected frequency in Read modes [(by derskythe)](https://github.com/Eng1n33r/flipperzero-firmware/pull/77)
- Sub-GHz -> External CC1101 module support - [(by quen0n)](https://github.com/DarkFlippers/unleashed-firmware/pull/307)
- Sub-GHz -> New frequency analyzer - [(by ClusterM)](https://github.com/DarkFlippers/unleashed-firmware/pull/43)
- Sub-GHz -> Save last used frequency [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77)
- Sub-GHz -> Press OK in frequency analyzer to use detected frequency in Read modes [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77)
- Sub-GHz -> Long press OK button in Sub-GHz Frequency analyzer to switch to Read menu [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/79)
- Lock device with pin(or regular lock if pin not set) by holding UP button on main screen [(by an4tur0r)](https://github.com/DarkFlippers/unleashed-firmware/pull/107)
# Instructions
## [- How to install firmware](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/HowToInstall.md)
## [- How to install firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
## [- How to build firmware](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/HowToBuild.md)
## [- How to build firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToBuild.md)
## [- How to connect external CC1101 module](https://github.com/quen0n/flipperzero-ext-cc1101)
## [- BadUSB: how to add new keyboard layouts](https://github.com/dummy-decoy/flipperzero_badusb_kl)
## [- How to change Flipper name](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/CustomFlipperName.md)
## [- How to change Flipper name](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/CustomFlipperName.md)
### **Plugins**
## [- 🎲 Download Extra plugins for Unleashed](https://github.com/UberGuidoZ/Flipper/tree/main/Applications/Unleashed)
## [- 🎲 Download Extra plugins for Unleashed](https://github.com/xMasterX/unleashed-extra-pack)
## [- Configure Sub-GHz Remote App](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/SubGHzRemotePlugin.md)
## [- Configure Sub-GHz Remote App](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemotePlugin.md)
## [- Barcode Generator](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/BarcodeGenerator.md)
## [- TOTP (Authenticator) config description](https://github.com/akopachov/flipper-zero_authenticator/blob/master/docs/conf-file_description.md)
## [- Multi Converter](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/MultiConverter.md)
## [- Barcode Generator](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/BarcodeGenerator.md)
## [- Multi Converter](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/MultiConverter.md)
## [- WAV Player sample files & how to convert](https://github.com/UberGuidoZ/Flipper/tree/main/Wav_Player#readme)
## [- SubGHz playlist generator script](https://github.com/darmiel/flipper-scripts/blob/main/playlist/playlist_creator_by_chunk.py)
## [- Sub-GHz playlist generator script](https://github.com/darmiel/flipper-scripts/blob/main/playlist/playlist_creator_by_chunk.py)
### **Plugins that works with external hardware**
## [- How to use: [NRF24] plugins](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/NRF24.md)
## [- How to use: Unitemp - Temperature sensors reader](https://github.com/quen0n/unitemp-flipperzero#readme)
## [- How to use: [NMEA] GPS](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/applications/plugins/gps_nmea_uart/README.md)
## [- How to use: i2c Tools](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/applications/plugins/flipper_i2ctools/README.md)
## [- How to use: [NRF24] plugins](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/NRF24.md)
## [- How to use: [WiFi] Scanner](https://github.com/SequoiaSan/FlipperZero-WiFi-Scanner_Module#readme)
@@ -131,29 +216,29 @@ Games:
## [- Windows: How to Upload .bin to ESP32/ESP8266](https://github.com/SequoiaSan/Guide-How-To-Upload-bin-to-ESP8266-ESP32)
## [- How to use: [GPIO] SentrySafe plugin](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/SentrySafe.md)
## [- How to use: [GPIO] SentrySafe plugin](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SentrySafe.md)
### **SubGHz**
### **Sub-GHz**
## [- Transmission is blocked? - How to extend SubGHz frequency range](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/DangerousSettings.md)
## [- Transmission is blocked? - How to extend Sub-GHz frequency range](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/DangerousSettings.md)
## [- How to add extra SubGHz frequencies](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/SubGHzSettings.md)
## [- How to add extra Sub-GHz frequencies](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzSettings.md)
<br>
<br>
# Where I can find IR, SubGhz, ... files, DBs, and other stuff?
# Where I can find IR, Sub-GHz, ... files, DBs, and other stuff?
## [UberGuidoZ Playground - Large collection of files - Github](https://github.com/UberGuidoZ/Flipper)
## [Awesome Flipper Zero - Github](https://github.com/djsime1/awesome-flipperzero)
## [CAME-12bit, NICE-12bit, Linear-10bit, PT-2240 - SubGHz fixed code bruteforce](https://github.com/tobiabocchi/flipperzero-bruteforce)
## [SMC5326, UNILARM - SubGHz fixed code bruteforce](https://github.com/Hong5489/flipperzero-gate-bruteforce)
## [CAME-12bit, NICE-12bit, Linear-10bit, PT-2240 - Sub-GHz fixed code bruteforce](https://github.com/tobiabocchi/flipperzero-bruteforce)
## [SMC5326, UNILARM - Sub-GHz fixed code bruteforce](https://github.com/Hong5489/flipperzero-gate-bruteforce)
<br>
<br>
# Links
* Unofficial Discord: [discord.gg/flipperzero-unofficial](https://discord.gg/flipperzero-unofficial)
* Unofficial Discord: [discord.unleashedflip.com](https://discord.unleashedflip.com)
* Docs by atmanos / How to write your own app (outdated API): [https://flipper.atmanos.com/docs/overview/intro](https://flipper.atmanos.com/docs/overview/intro)
* Official Docs: [http://docs.flipperzero.one](http://docs.flipperzero.one)
@@ -163,7 +248,7 @@ Games:
- `applications` - Applications and services used in firmware
- `assets` - Assets used by applications and services
- `furi` - Furi Core: os level primitives and helpers
- `furi` - Furi Core: OS-level primitives and helpers
- `debug` - Debug tool: GDB-plugins, SVD-file and etc
- `documentation` - Documentation generation system configs and input files
- `firmware` - Firmware source code
@@ -171,4 +256,4 @@ Games:
- `site_scons` - Build helpers
- `scripts` - Supplementary scripts and python libraries home
Also pay attention to `ReadMe.md` files inside those directories.
Also, pay attention to the `ReadMe.md` files inside those directories.

View File

@@ -7,7 +7,7 @@
# construction of certain targets behind command-line options.
import os
import subprocess
from fbt.util import path_as_posix
DefaultEnvironment(tools=[])
@@ -15,62 +15,36 @@ EnsurePythonVersion(3, 8)
# Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)
# This environment is created only for loading options & validating file/dir existence
fbt_variables = SConscript("site_scons/commandline.scons")
cmd_environment = Environment(tools=[], variables=fbt_variables)
Help(fbt_variables.GenerateHelpText(cmd_environment))
cmd_environment = Environment(
toolpath=["#/scripts/fbt_tools"],
tools=[
("fbt_help", {"vars": fbt_variables}),
],
variables=fbt_variables,
)
# Building basic environment - tools, utility methods, cross-compilation
# settings, gcc flags for Cortex-M4, basic builders and more
coreenv = SConscript(
"site_scons/environ.scons",
exports={"VAR_ENV": cmd_environment},
toolpath=["#/scripts/fbt_tools"],
)
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
distenv = coreenv.Clone(
tools=["fbt_dist", "openocd", "blackmagic", "jflash"],
OPENOCD_GDB_PIPE=[
"|openocd -c 'gdb_port pipe; log_output debug/openocd.log' ${[SINGLEQUOTEFUNC(OPENOCD_OPTS)]}"
tools=[
"fbt_dist",
"fbt_debugopts",
"openocd",
"blackmagic",
"jflash",
],
GDBOPTS_BASE=[
"-ex",
"target extended-remote ${GDBREMOTE}",
"-ex",
"set confirm off",
"-ex",
"set pagination off",
],
GDBOPTS_BLACKMAGIC=[
"-ex",
"monitor swdp_scan",
"-ex",
"monitor debug_bmp enable",
"-ex",
"attach 1",
"-ex",
"set mem inaccessible-by-default off",
],
GDBPYOPTS=[
"-ex",
"source debug/FreeRTOS/FreeRTOS.py",
"-ex",
"source debug/flipperapps.py",
"-ex",
"source debug/PyCortexMDebug/PyCortexMDebug.py",
"-ex",
"svd_load ${SVD_FILE}",
"-ex",
"compare-sections",
],
JFLASHPROJECT="${ROOT_DIR.abspath}/debug/fw.jflash",
ENV=os.environ,
UPDATE_BUNDLE_DIR="dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}",
)
firmware_env = distenv.AddFwProject(
@@ -166,32 +140,49 @@ basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
distenv.Default(basic_dist)
dist_dir = distenv.GetProjetDirName()
plugin_dist = [
fap_dist = [
distenv.Install(
f"#/dist/{dist_dir}/apps/debug_elf",
firmware_env["FW_EXTAPPS"]["debug"].values(),
distenv.Dir(f"#/dist/{dist_dir}/apps/debug_elf"),
list(
app_artifact.debug
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
),
),
*(
distenv.Install(f"#/dist/{dist_dir}/apps/{dist_entry[0]}", dist_entry[1])
for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
distenv.Install(
f"#/dist/{dist_dir}/apps/{app_artifact.app.fap_category}",
app_artifact.compact[0],
)
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
),
]
Depends(plugin_dist, firmware_env["FW_EXTAPPS"]["validators"].values())
Alias("plugin_dist", plugin_dist)
# distenv.Default(plugin_dist)
plugin_resources_dist = list(
distenv.Install(f"#/assets/resources/apps/{dist_entry[0]}", dist_entry[1])
for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
Depends(
fap_dist,
list(
app_artifact.validator
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
),
)
Alias("fap_dist", fap_dist)
# distenv.Default(fap_dist)
distenv.Depends(firmware_env["FW_RESOURCES"], firmware_env["FW_EXTAPPS"].resources_dist)
# Copy all faps to device
fap_deploy = distenv.PhonyTarget(
"fap_deploy",
"${PYTHON3} ${ROOT_DIR}/scripts/storage.py send ${SOURCE} /ext/apps",
source=Dir("#/assets/resources/apps"),
)
distenv.Depends(firmware_env["FW_RESOURCES"], plugin_resources_dist)
# Target for bundling core2 package for qFlipper
copro_dist = distenv.CoproBuilder(
distenv.Dir("assets/core2_firmware"),
"#/build/core2_firmware.tgz",
[],
)
distenv.AlwaysBuild(copro_dist)
distenv.Alias("copro_dist", copro_dist)
firmware_flash = distenv.AddOpenOCDFlashTarget(firmware_env)
@@ -214,6 +205,20 @@ firmware_bm_flash = distenv.PhonyTarget(
],
)
gdb_backtrace_all_threads = distenv.PhonyTarget(
"gdb_trace_all",
"$GDB $GDBOPTS $SOURCES $GDBFLASH",
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
GDBFLASH=[
"-ex",
"thread apply all bt",
"-ex",
"quit",
],
)
# Debugging firmware
firmware_debug = distenv.PhonyTarget(
"debug",
@@ -221,6 +226,7 @@ firmware_debug = distenv.PhonyTarget(
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")),
)
distenv.Depends(firmware_debug, firmware_flash)
@@ -230,6 +236,7 @@ distenv.PhonyTarget(
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
GDBREMOTE="${BLACKMAGIC_ADDR}",
FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")),
)
# Debug alien elf
@@ -238,7 +245,7 @@ distenv.PhonyTarget(
"${GDBPYCOM}",
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
GDBPYOPTS='-ex "source debug/PyCortexMDebug/PyCortexMDebug.py" ',
GDBPYOPTS='-ex "source ${FBT_DEBUG_DIR}/PyCortexMDebug/PyCortexMDebug.py" ',
)
distenv.PhonyTarget(
@@ -258,14 +265,14 @@ distenv.PhonyTarget(
# Linter
distenv.PhonyTarget(
"lint",
"${PYTHON3} scripts/lint.py check ${LINT_SOURCES}",
LINT_SOURCES=firmware_env["LINT_SOURCES"],
"${PYTHON3} ${FBT_SCRIPT_DIR}/lint.py check ${LINT_SOURCES}",
LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
)
distenv.PhonyTarget(
"format",
"${PYTHON3} scripts/lint.py format ${LINT_SOURCES}",
LINT_SOURCES=firmware_env["LINT_SOURCES"],
"${PYTHON3} ${FBT_SCRIPT_DIR}/lint.py format ${LINT_SOURCES}",
LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
)
# PY_LINT_SOURCES contains recursively-built modules' SConscript files + application manifests
@@ -305,7 +312,7 @@ distenv.PhonyTarget(
)
# 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
@@ -314,6 +321,16 @@ distenv.PhonyTarget(
"@echo $( ${BLACKMAGIC_ADDR} $)",
)
# Find STLink probe ids
distenv.PhonyTarget(
"get_stlink",
distenv.Action(
lambda **kw: distenv.GetDevices(),
None,
),
)
# Prepare vscode environment
vscode_dist = distenv.Install("#.vscode", distenv.Glob("#.vscode/example/*"))
distenv.Precious(vscode_dist)

View File

@@ -31,9 +31,10 @@ void AccessorApp::run(void) {
onewire_host_stop(onewire_host);
}
AccessorApp::AccessorApp() {
AccessorApp::AccessorApp()
: text_store{0} {
notification = static_cast<NotificationApp*>(furi_record_open(RECORD_NOTIFICATION));
onewire_host = onewire_host_alloc();
onewire_host = onewire_host_alloc(&ibutton_gpio);
furi_hal_power_enable_otg();
}

View File

@@ -2,6 +2,7 @@ App(
appid="accessor",
name="Accessor",
apptype=FlipperAppType.DEBUG,
targets=["f7"],
entry_point="accessor_app",
cdefines=["APP_ACCESSOR"],
requires=["gui"],

View File

@@ -71,7 +71,7 @@ void WIEGAND::end() {
}
void WIEGAND::ReadD0() {
_bitCount++; // Increament bit count for Interrupt connected to D0
_bitCount++; // Increment bit count for Interrupt connected to D0
if(_bitCount > 31) // If bit count more than 31, process high bits
{
_cardTempHigh |= ((0x80000000 & _cardTemp) >> 31); // shift value to high bits
@@ -171,9 +171,6 @@ bool WIEGAND::DoWiegandConversion() {
return true;
} else {
_lastWiegand = sysTick;
_bitCount = 0;
_cardTemp = 0;
_cardTempHigh = 0;
return false;
}

View File

@@ -11,4 +11,5 @@ App(
stack_size=1 * 1024,
order=130,
fap_category="Debug",
fap_libs=["assets"],
)

View File

@@ -0,0 +1,148 @@
#include "battery_info.h"
#include <furi.h>
#include <gui/elements.h>
#include <assets_icons.h>
#define LOW_CHARGE_THRESHOLD 10
#define HIGH_DRAIN_CURRENT_THRESHOLD 100
struct BatteryInfo {
View* view;
};
static void draw_stat(Canvas* canvas, int x, int y, const Icon* icon, char* val) {
canvas_draw_frame(canvas, x - 7, y + 7, 30, 13);
canvas_draw_icon(canvas, x, y, icon);
canvas_set_color(canvas, ColorWhite);
canvas_draw_box(canvas, x - 4, y + 16, 24, 6);
canvas_set_color(canvas, ColorBlack);
canvas_draw_str_aligned(canvas, x + 8, y + 22, AlignCenter, AlignBottom, val);
};
static void draw_battery(Canvas* canvas, BatteryInfoModel* data, int x, int y) {
char emote[20] = {};
char header[20] = {};
char value[20] = {};
int32_t drain_current = data->gauge_current * (-1000);
uint32_t charge_current = data->gauge_current * 1000;
// Draw battery
canvas_draw_icon(canvas, x, y, &I_BatteryBody_52x28);
if(charge_current > 0) {
canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceCharging_29x14);
} else if(drain_current > HIGH_DRAIN_CURRENT_THRESHOLD) {
canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceConfused_29x14);
} else if(data->charge < LOW_CHARGE_THRESHOLD) {
canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceNopower_29x14);
} else {
canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceNormal_29x14);
}
// Draw bubble
elements_bubble(canvas, 53, 0, 71, 39);
// Set text
if(charge_current > 0) {
snprintf(emote, sizeof(emote), "%s", "Yummy!");
snprintf(header, sizeof(header), "%s", "Charging at");
snprintf(
value,
sizeof(value),
"%lu.%luV %lumA",
(uint32_t)(data->vbus_voltage),
(uint32_t)(data->vbus_voltage * 10) % 10,
charge_current);
} else if(drain_current > 0) {
snprintf(
emote,
sizeof(emote),
"%s",
drain_current > HIGH_DRAIN_CURRENT_THRESHOLD ? "Oh no!" : "Om-nom-nom!");
snprintf(header, sizeof(header), "%s", "Consumption is");
snprintf(
value,
sizeof(value),
"%ld %s",
drain_current,
drain_current > HIGH_DRAIN_CURRENT_THRESHOLD ? "mA!" : "mA");
} else if(drain_current != 0) {
snprintf(header, 20, "...");
} else if(data->charging_voltage < 4.2) {
// Non-default battery charging limit, mention it
snprintf(emote, sizeof(emote), "Charged!");
snprintf(header, sizeof(header), "Limited to");
snprintf(
value,
sizeof(value),
"%lu.%luV",
(uint32_t)(data->charging_voltage),
(uint32_t)(data->charging_voltage * 10) % 10);
} else {
snprintf(header, sizeof(header), "Charged!");
}
canvas_draw_str_aligned(canvas, 92, y + 3, AlignCenter, AlignCenter, emote);
canvas_draw_str_aligned(canvas, 92, y + 15, AlignCenter, AlignCenter, header);
canvas_draw_str_aligned(canvas, 92, y + 27, AlignCenter, AlignCenter, value);
};
static void battery_info_draw_callback(Canvas* canvas, void* context) {
furi_assert(context);
BatteryInfoModel* model = context;
canvas_clear(canvas);
canvas_set_color(canvas, ColorBlack);
draw_battery(canvas, model, 0, 5);
char batt_level[10];
char temperature[10];
char voltage[10];
char health[10];
snprintf(batt_level, sizeof(batt_level), "%lu%%", (uint32_t)model->charge);
snprintf(temperature, sizeof(temperature), "%lu C", (uint32_t)model->gauge_temperature);
snprintf(
voltage,
sizeof(voltage),
"%lu.%01lu V",
(uint32_t)model->gauge_voltage,
(uint32_t)(model->gauge_voltage * 10) % 10UL);
snprintf(health, sizeof(health), "%d%%", model->health);
draw_stat(canvas, 8, 42, &I_Battery_16x16, batt_level);
draw_stat(canvas, 40, 42, &I_Temperature_16x16, temperature);
draw_stat(canvas, 72, 42, &I_Voltage_16x16, voltage);
draw_stat(canvas, 104, 42, &I_Health_16x16, health);
}
BatteryInfo* battery_info_alloc() {
BatteryInfo* battery_info = malloc(sizeof(BatteryInfo));
battery_info->view = view_alloc();
view_set_context(battery_info->view, battery_info);
view_allocate_model(battery_info->view, ViewModelTypeLocking, sizeof(BatteryInfoModel));
view_set_draw_callback(battery_info->view, battery_info_draw_callback);
return battery_info;
}
void battery_info_free(BatteryInfo* battery_info) {
furi_assert(battery_info);
view_free(battery_info->view);
free(battery_info);
}
View* battery_info_get_view(BatteryInfo* battery_info) {
furi_assert(battery_info);
return battery_info->view;
}
void battery_info_set_data(BatteryInfo* battery_info, BatteryInfoModel* data) {
furi_assert(battery_info);
furi_assert(data);
with_view_model(
battery_info->view,
BatteryInfoModel * model,
{ memcpy(model, data, sizeof(BatteryInfoModel)); },
true);
}

View File

@@ -0,0 +1,23 @@
#pragma once
#include <gui/view.h>
typedef struct BatteryInfo BatteryInfo;
typedef struct {
float vbus_voltage;
float gauge_voltage;
float gauge_current;
float gauge_temperature;
float charging_voltage;
uint8_t charge;
uint8_t health;
} BatteryInfoModel;
BatteryInfo* battery_info_alloc();
void battery_info_free(BatteryInfo* battery_info);
View* battery_info_get_view(BatteryInfo* battery_info);
void battery_info_set_data(BatteryInfo* battery_info, BatteryInfoModel* data);

View File

@@ -31,9 +31,6 @@ uint32_t bt_debug_start_view(void* context) {
BtDebugApp* bt_debug_app_alloc() {
BtDebugApp* app = malloc(sizeof(BtDebugApp));
// Load settings
bt_settings_load(&app->settings);
// Gui
app->gui = furi_record_open(RECORD_GUI);
@@ -98,20 +95,22 @@ void bt_debug_app_free(BtDebugApp* app) {
int32_t bt_debug_app(void* p) {
UNUSED(p);
if(!furi_hal_bt_is_testing_supported()) {
FURI_LOG_E(TAG, "Incorrect radio stack: radio testing fetures are absent.");
FURI_LOG_E(TAG, "Incorrect radio stack: radio testing features are absent.");
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
dialog_message_show_storage_error(dialogs, "Incorrect\nRadioStack");
return 255;
}
BtDebugApp* app = bt_debug_app_alloc();
// Was bt active?
const bool was_active = furi_hal_bt_is_active();
// Stop advertising
furi_hal_bt_stop_advertising();
view_dispatcher_run(app->view_dispatcher);
// Restart advertising
if(app->settings.enabled) {
if(was_active) {
furi_hal_bt_start_advertising();
}
bt_debug_app_free(app);

View File

@@ -4,15 +4,14 @@
#include <gui/gui.h>
#include <gui/view.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/submenu.h>
#include <dialogs/dialogs.h>
#include <gui/modules/submenu.h>
#include "views/bt_carrier_test.h"
#include "views/bt_packet_test.h"
#include <bt/bt_settings.h>
typedef struct {
BtSettings settings;
Gui* gui;
ViewDispatcher* view_dispatcher;
Submenu* submenu;

View File

@@ -1,7 +1,7 @@
#include "bt_carrier_test.h"
#include "bt_test.h"
#include "bt_test_types.h"
#include "furi_hal_bt.h"
#include <furi_hal_bt.h>
struct BtCarrierTest {
BtTest* bt_test;

View File

@@ -1,7 +1,7 @@
#include "bt_packet_test.h"
#include "bt_test.h"
#include "bt_test_types.h"
#include "furi_hal_bt.h"
#include <furi_hal_bt.h>
struct BtPacketTest {
BtTest* bt_test;

View File

@@ -2,15 +2,17 @@
#include <gui/canvas.h>
#include <gui/elements.h>
#include <lib/toolbox/float_tools.h>
#include <m-array.h>
#include <m-string.h>
#include <furi.h>
#include <inttypes.h>
#include <stdint.h>
struct BtTestParam {
const char* label;
uint8_t current_value_index;
string_t current_value_text;
FuriString* current_value_text;
uint8_t values_count;
BtTestParamChangeCallback change_callback;
void* context;
@@ -85,7 +87,8 @@ static void bt_test_draw_callback(Canvas* canvas, void* _model) {
canvas_draw_str(canvas, 50, param_text_y, "<");
}
canvas_draw_str(canvas, 61, param_text_y, string_get_cstr(param->current_value_text));
canvas_draw_str(
canvas, 61, param_text_y, furi_string_get_cstr(param->current_value_text));
if(param->current_value_index < (param->values_count - 1)) {
canvas_draw_str(canvas, 113, param_text_y, ">");
@@ -98,16 +101,16 @@ static void bt_test_draw_callback(Canvas* canvas, void* _model) {
elements_scrollbar(canvas, model->position, BtTestParamArray_size(model->params));
canvas_draw_str(canvas, 6, 60, model->message);
if(model->state == BtTestStateStarted) {
if(model->rssi != 0.0f) {
if(!float_is_equal(model->rssi, 0.0f)) {
snprintf(info_str, sizeof(info_str), "RSSI:%3.1f dB", (double)model->rssi);
canvas_draw_str_aligned(canvas, 124, 60, AlignRight, AlignBottom, info_str);
}
} else if(model->state == BtTestStateStopped) {
if(model->packets_num_rx) {
snprintf(info_str, sizeof(info_str), "%ld pack rcv", model->packets_num_rx);
snprintf(info_str, sizeof(info_str), "%" PRIu32 " pack rcv", model->packets_num_rx);
canvas_draw_str_aligned(canvas, 124, 60, AlignRight, AlignBottom, info_str);
} else if(model->packets_num_tx) {
snprintf(info_str, sizeof(info_str), "%ld pack sent", model->packets_num_tx);
snprintf(info_str, sizeof(info_str), "%" PRIu32 " pack sent", model->packets_num_tx);
canvas_draw_str_aligned(canvas, 124, 60, AlignRight, AlignBottom, info_str);
}
}
@@ -153,8 +156,10 @@ static bool bt_test_input_callback(InputEvent* event, void* context) {
}
void bt_test_process_up(BtTest* bt_test) {
with_view_model(
bt_test->view, (BtTestModel * model) {
with_view_model( // -V658
bt_test->view,
BtTestModel * model,
{
uint8_t params_on_screen = 3;
if(model->position > 0) {
model->position--;
@@ -168,13 +173,15 @@ void bt_test_process_up(BtTest* bt_test) {
model->window_position = model->position - (params_on_screen - 1);
}
}
return true;
});
},
true);
}
void bt_test_process_down(BtTest* bt_test) {
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
uint8_t params_on_screen = 3;
if(model->position < (BtTestParamArray_size(model->params) - 1)) {
model->position++;
@@ -187,8 +194,8 @@ void bt_test_process_down(BtTest* bt_test) {
model->position = 0;
model->window_position = 0;
}
return true;
});
},
true);
}
BtTestParam* bt_test_get_selected_param(BtTestModel* model) {
@@ -213,7 +220,9 @@ BtTestParam* bt_test_get_selected_param(BtTestModel* model) {
void bt_test_process_left(BtTest* bt_test) {
BtTestParam* param;
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
param = bt_test_get_selected_param(model);
if(param->current_value_index > 0) {
param->current_value_index--;
@@ -225,8 +234,8 @@ void bt_test_process_left(BtTest* bt_test) {
model->packets_num_tx = 0;
}
}
return true;
});
},
true);
if(param->change_callback) {
param->change_callback(param);
}
@@ -235,7 +244,9 @@ void bt_test_process_left(BtTest* bt_test) {
void bt_test_process_right(BtTest* bt_test) {
BtTestParam* param;
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
param = bt_test_get_selected_param(model);
if(param->current_value_index < (param->values_count - 1)) {
param->current_value_index++;
@@ -247,8 +258,8 @@ void bt_test_process_right(BtTest* bt_test) {
model->packets_num_tx = 0;
}
}
return true;
});
},
true);
if(param->change_callback) {
param->change_callback(param);
}
@@ -257,7 +268,9 @@ void bt_test_process_right(BtTest* bt_test) {
void bt_test_process_ok(BtTest* bt_test) {
BtTestState state;
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
if(model->state == BtTestStateStarted) {
model->state = BtTestStateStopped;
model->message = BT_TEST_START_MESSAGE;
@@ -269,8 +282,8 @@ void bt_test_process_ok(BtTest* bt_test) {
model->message = BT_TEST_STOP_MESSAGE;
}
state = model->state;
return true;
});
},
true);
if(bt_test->change_state_callback) {
bt_test->change_state_callback(state, bt_test->context);
}
@@ -278,13 +291,15 @@ void bt_test_process_ok(BtTest* bt_test) {
void bt_test_process_back(BtTest* bt_test) {
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
model->state = BtTestStateStopped;
model->rssi = 0.0f;
model->packets_num_rx = 0;
model->packets_num_tx = 0;
return false;
});
},
false);
if(bt_test->back_callback) {
bt_test->back_callback(bt_test->context);
}
@@ -299,7 +314,9 @@ BtTest* bt_test_alloc() {
view_set_input_callback(bt_test->view, bt_test_input_callback);
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
model->state = BtTestStateStopped;
model->message = "Ok - Start";
BtTestParamArray_init(model->params);
@@ -308,8 +325,8 @@ BtTest* bt_test_alloc() {
model->rssi = 0.0f;
model->packets_num_tx = 0;
model->packets_num_rx = 0;
return true;
});
},
true);
return bt_test;
}
@@ -318,15 +335,17 @@ void bt_test_free(BtTest* bt_test) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
BtTestParamArray_it_t it;
for(BtTestParamArray_it(it, model->params); !BtTestParamArray_end_p(it);
BtTestParamArray_next(it)) {
string_clear(BtTestParamArray_ref(it)->current_value_text);
furi_string_free(BtTestParamArray_ref(it)->current_value_text);
}
BtTestParamArray_clear(model->params);
return false;
});
},
false);
view_free(bt_test->view);
free(bt_test);
}
@@ -347,16 +366,18 @@ BtTestParam* bt_test_param_add(
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
param = BtTestParamArray_push_new(model->params);
param->label = label;
param->values_count = values_count;
param->change_callback = change_callback;
param->context = context;
param->current_value_index = 0;
string_init(param->current_value_text);
return true;
});
param->current_value_text = furi_string_alloc();
},
true);
return param;
}
@@ -364,28 +385,19 @@ BtTestParam* bt_test_param_add(
void bt_test_set_rssi(BtTest* bt_test, float rssi) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
model->rssi = rssi;
return true;
});
bt_test->view, BtTestModel * model, { model->rssi = rssi; }, true);
}
void bt_test_set_packets_tx(BtTest* bt_test, uint32_t packets_num) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
model->packets_num_tx = packets_num;
return true;
});
bt_test->view, BtTestModel * model, { model->packets_num_tx = packets_num; }, true);
}
void bt_test_set_packets_rx(BtTest* bt_test, uint32_t packets_num) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
model->packets_num_rx = packets_num;
return true;
});
bt_test->view, BtTestModel * model, { model->packets_num_rx = packets_num; }, true);
}
void bt_test_set_change_state_callback(BtTest* bt_test, BtTestChangeStateCallback callback) {
@@ -410,7 +422,7 @@ void bt_test_set_current_value_index(BtTestParam* param, uint8_t current_value_i
}
void bt_test_set_current_value_text(BtTestParam* param, const char* current_value_text) {
string_set_str(param->current_value_text, current_value_text);
furi_string_set(param->current_value_text, current_value_text);
}
uint8_t bt_test_get_current_value_index(BtTestParam* param) {

View File

@@ -0,0 +1,10 @@
App(
appid="direct_draw",
name="Direct Draw",
apptype=FlipperAppType.DEBUG,
entry_point="direct_draw_app",
requires=["gui", "input"],
stack_size=2 * 1024,
order=70,
fap_category="Debug",
)

View File

@@ -0,0 +1,112 @@
#include <furi.h>
#include <gui/gui.h>
#include <gui/canvas_i.h>
#include <input/input.h>
#define BUFFER_SIZE (32U)
typedef struct {
FuriPubSub* input;
FuriPubSubSubscription* input_subscription;
Gui* gui;
Canvas* canvas;
bool stop;
uint32_t counter;
} DirectDraw;
static void gui_input_events_callback(const void* value, void* ctx) {
furi_assert(value);
furi_assert(ctx);
DirectDraw* instance = ctx;
const InputEvent* event = value;
if(event->key == InputKeyBack && event->type == InputTypeShort) {
instance->stop = true;
}
}
static DirectDraw* direct_draw_alloc() {
DirectDraw* instance = malloc(sizeof(DirectDraw));
instance->input = furi_record_open(RECORD_INPUT_EVENTS);
instance->gui = furi_record_open(RECORD_GUI);
instance->canvas = gui_direct_draw_acquire(instance->gui);
instance->input_subscription =
furi_pubsub_subscribe(instance->input, gui_input_events_callback, instance);
return instance;
}
static void direct_draw_free(DirectDraw* instance) {
furi_pubsub_unsubscribe(instance->input, instance->input_subscription);
instance->canvas = NULL;
gui_direct_draw_release(instance->gui);
furi_record_close(RECORD_GUI);
furi_record_close(RECORD_INPUT_EVENTS);
}
static void direct_draw_block(Canvas* canvas, uint32_t size, uint32_t counter) {
size += 16;
uint8_t width = canvas_width(canvas) - size;
uint8_t height = canvas_height(canvas) - size;
uint8_t x = counter % width;
if((counter / width) % 2) {
x = width - x;
}
uint8_t y = counter % height;
if((counter / height) % 2) {
y = height - y;
}
canvas_draw_box(canvas, x, y, size, size);
}
static void direct_draw_run(DirectDraw* instance) {
size_t start = DWT->CYCCNT;
size_t counter = 0;
float fps = 0;
vTaskPrioritySet(furi_thread_get_current_id(), FuriThreadPriorityIdle);
do {
size_t elapsed = DWT->CYCCNT - start;
char buffer[BUFFER_SIZE] = {0};
if(elapsed >= 64000000) {
fps = (float)counter / ((float)elapsed / 64000000.0f);
start = DWT->CYCCNT;
counter = 0;
}
snprintf(buffer, BUFFER_SIZE, "FPS: %.1f", (double)fps);
canvas_reset(instance->canvas);
canvas_set_color(instance->canvas, ColorXOR);
direct_draw_block(instance->canvas, instance->counter % 16, instance->counter);
direct_draw_block(instance->canvas, instance->counter * 2 % 16, instance->counter * 2);
direct_draw_block(instance->canvas, instance->counter * 3 % 16, instance->counter * 3);
direct_draw_block(instance->canvas, instance->counter * 4 % 16, instance->counter * 4);
direct_draw_block(instance->canvas, instance->counter * 5 % 16, instance->counter * 5);
canvas_draw_str(instance->canvas, 10, 10, buffer);
canvas_commit(instance->canvas);
counter++;
instance->counter++;
furi_thread_yield();
} while(!instance->stop);
}
int32_t direct_draw_app(void* p) {
UNUSED(p);
DirectDraw* instance = direct_draw_alloc();
direct_draw_run(instance);
direct_draw_free(instance);
return 0;
}

View File

@@ -5,6 +5,7 @@ App(
entry_point="display_test_app",
cdefines=["APP_DISPLAY_TEST"],
requires=["gui"],
fap_libs=["misc"],
stack_size=1 * 1024,
order=120,
fap_category="Debug",

View File

@@ -91,7 +91,6 @@ static void display_test_reload_config(DisplayTest* instance) {
instance->config_contrast,
instance->config_regulation_ratio,
instance->config_bias);
gui_update(instance->gui);
}
static void display_config_set_bias(VariableItem* item) {
@@ -113,11 +112,11 @@ static void display_config_set_regulation_ratio(VariableItem* item) {
static void display_config_set_contrast(VariableItem* item) {
DisplayTest* instance = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
string_t temp;
string_init(temp);
string_cat_printf(temp, "%d", index);
variable_item_set_current_value_text(item, string_get_cstr(temp));
string_clear(temp);
FuriString* temp;
temp = furi_string_alloc();
furi_string_cat_printf(temp, "%d", index);
variable_item_set_current_value_text(item, furi_string_get_cstr(temp));
furi_string_free(temp);
instance->config_contrast = index;
display_test_reload_config(instance);
}
@@ -145,7 +144,7 @@ DisplayTest* display_test_alloc() {
view_set_previous_callback(view, display_test_previous_callback);
view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewConfigure, view);
// Configurtion items
// Configuration items
VariableItem* item;
instance->config_bias = false;
instance->config_contrast = 32;

View File

@@ -110,7 +110,9 @@ static bool view_display_test_input_callback(InputEvent* event, void* context) {
bool consumed = false;
if(event->type == InputTypeShort || event->type == InputTypeRepeat) {
with_view_model(
instance->view, (ViewDisplayTestModel * model) {
instance->view,
ViewDisplayTestModel * model,
{
if(event->key == InputKeyLeft && model->test > 0) {
model->test--;
consumed = true;
@@ -129,8 +131,8 @@ static bool view_display_test_input_callback(InputEvent* event, void* context) {
model->flip_flop = !model->flip_flop;
consumed = true;
}
return consumed;
});
},
consumed);
}
return consumed;
@@ -149,10 +151,7 @@ static void view_display_test_exit(void* context) {
static void view_display_test_timer_callback(void* context) {
ViewDisplayTest* instance = context;
with_view_model(
instance->view, (ViewDisplayTestModel * model) {
model->counter++;
return true;
});
instance->view, ViewDisplayTestModel * model, { model->counter++; }, true);
}
ViewDisplayTest* view_display_test_alloc() {

View File

@@ -0,0 +1,9 @@
App(
appid="example_custom_font",
name="Example: custom font",
apptype=FlipperAppType.DEBUG,
entry_point="example_custom_font_main",
requires=["gui"],
stack_size=1 * 1024,
fap_category="Debug",
)

View File

@@ -0,0 +1,98 @@
#include <furi.h>
#include <furi_hal.h>
#include <gui/gui.h>
#include <input/input.h>
//This arrays contains the font itself. You can use any u8g2 font you want
/*
Fontname: -Raccoon-Fixed4x6-Medium-R-Normal--6-60-75-75-P-40-ISO10646-1
Copyright:
Glyphs: 95/203
BBX Build Mode: 0
*/
const uint8_t u8g2_font_tom_thumb_4x6_tr[725] =
"_\0\2\2\2\3\3\4\4\3\6\0\377\5\377\5\0\0\352\1\330\2\270 \5\340\315\0!\6\265\310"
"\254\0\42\6\213\313$\25#\10\227\310\244\241\206\12$\10\227\310\215\70b\2%\10\227\310d\324F\1"
"&\10\227\310(\65R\22'\5\251\313\10(\6\266\310\251\62)\10\226\310\304\224\24\0*\6\217\312\244"
"\16+\7\217\311\245\225\0,\6\212\310)\0-\5\207\312\14.\5\245\310\4/\7\227\310Ve\4\60"
"\7\227\310-k\1\61\6\226\310\255\6\62\10\227\310h\220\312\1\63\11\227\310h\220\62X\0\64\10\227"
"\310$\65b\1\65\10\227\310\214\250\301\2\66\10\227\310\315\221F\0\67\10\227\310\314TF\0\70\10\227"
"\310\214\64\324\10\71\10\227\310\214\64\342\2:\6\255\311\244\0;\7\222\310e\240\0<\10\227\310\246\32"
"d\20=\6\217\311l\60>\11\227\310d\220A*\1\77\10\227\310\314\224a\2@\10\227\310UC\3"
"\1A\10\227\310UC\251\0B\10\227\310\250\264\322\2C\7\227\310\315\32\10D\10\227\310\250d-\0"
"E\10\227\310\214\70\342\0F\10\227\310\214\70b\4G\10\227\310\315\221\222\0H\10\227\310$\65\224\12"
"I\7\227\310\254X\15J\7\227\310\226\252\2K\10\227\310$\265\222\12L\7\227\310\304\346\0M\10\227"
"\310\244\61\224\12N\10\227\310\244q\250\0O\7\227\310UV\5P\10\227\310\250\264b\4Q\10\227\310"
"Uj$\1R\10\227\310\250\64V\1S\10\227\310m\220\301\2T\7\227\310\254\330\2U\7\227\310$"
"W\22V\10\227\310$\253L\0W\10\227\310$\65\206\12X\10\227\310$\325R\1Y\10\227\310$U"
"V\0Z\7\227\310\314T\16[\7\227\310\214X\16\134\10\217\311d\220A\0]\7\227\310\314r\4^"
"\5\213\313\65_\5\207\310\14`\6\212\313\304\0a\7\223\310\310\65\2b\10\227\310D\225\324\2c\7"
"\223\310\315\14\4d\10\227\310\246\245\222\0e\6\223\310\235\2f\10\227\310\246\264b\2g\10\227\307\35"
"\61%\0h\10\227\310D\225\254\0i\6\265\310\244\1j\10\233\307f\30U\5k\10\227\310\304\264T"
"\1l\7\227\310\310\326\0m\7\223\310<R\0n\7\223\310\250d\5o\7\223\310U\252\2p\10\227"
"\307\250\244V\4q\10\227\307-\225d\0r\6\223\310\315\22s\10\223\310\215\70\22\0t\10\227\310\245"
"\25\243\0u\7\223\310$+\11v\10\223\310$\65R\2w\7\223\310\244q\4x\7\223\310\244\62\25"
"y\11\227\307$\225dJ\0z\7\223\310\254\221\6{\10\227\310\251\32D\1|\6\265\310(\1}\11"
"\227\310\310\14RR\0~\6\213\313\215\4\0\0\0\4\377\377\0";
// Screen is 128x64 px
static void app_draw_callback(Canvas* canvas, void* ctx) {
UNUSED(ctx);
canvas_clear(canvas);
canvas_set_custom_u8g2_font(canvas, u8g2_font_tom_thumb_4x6_tr);
canvas_draw_str(canvas, 0, 6, "This is a tiny custom font");
canvas_draw_str(canvas, 0, 12, "012345.?! ,:;\"\'@#$%");
}
static void app_input_callback(InputEvent* input_event, void* ctx) {
furi_assert(ctx);
FuriMessageQueue* event_queue = ctx;
furi_message_queue_put(event_queue, input_event, FuriWaitForever);
}
int32_t example_custom_font_main(void* p) {
UNUSED(p);
FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
// Configure view port
ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, app_draw_callback, view_port);
view_port_input_callback_set(view_port, app_input_callback, event_queue);
// Register view port in GUI
Gui* gui = furi_record_open(RECORD_GUI);
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
InputEvent event;
bool running = true;
while(running) {
if(furi_message_queue_get(event_queue, &event, 100) == FuriStatusOk) {
if((event.type == InputTypePress) || (event.type == InputTypeRepeat)) {
switch(event.key) {
case InputKeyBack:
running = false;
break;
default:
break;
}
}
}
}
view_port_enabled_set(view_port, false);
gui_remove_view_port(gui, view_port);
view_port_free(view_port);
furi_message_queue_free(event_queue);
furi_record_close(RECORD_GUI);
return 0;
}

View File

@@ -8,4 +8,5 @@ App(
stack_size=2 * 1024,
order=150,
fap_category="Debug",
fap_icon_assets="icons",
)

View File

@@ -1,11 +1,11 @@
#include "assets_icons.h"
#include "file_browser_app_i.h"
#include "gui/modules/file_browser.h"
#include "m-string.h"
#include <furi.h>
#include <furi_hal.h>
#include <file_browser_test_icons.h>
#include <gui/modules/file_browser.h>
#include <storage/storage.h>
#include <lib/toolbox/path.h>
#include <furi.h>
#include <furi_hal.h>
static bool file_browser_app_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
@@ -47,9 +47,9 @@ FileBrowserApp* file_browser_app_alloc(char* arg) {
app->widget = widget_alloc();
string_init(app->file_path);
app->file_path = furi_string_alloc();
app->file_browser = file_browser_alloc(app->file_path);
file_browser_configure(app->file_browser, "*", true, &I_badusb_10px, true);
file_browser_configure(app->file_browser, "*", NULL, true, false, &I_badusb_10px, true);
view_dispatcher_add_view(
app->view_dispatcher, FileBrowserAppViewStart, widget_get_view(app->widget));
@@ -84,7 +84,7 @@ void file_browser_app_free(FileBrowserApp* app) {
furi_record_close(RECORD_NOTIFICATION);
furi_record_close(RECORD_DIALOGS);
string_clear(app->file_path);
furi_string_free(app->file_path);
free(app);
}

View File

@@ -22,7 +22,7 @@ struct FileBrowserApp {
Widget* widget;
FileBrowser* file_browser;
string_t file_path;
FuriString* file_path;
};
typedef enum {

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

View File

@@ -1,8 +1,5 @@
#include "../file_browser_app_i.h"
#include <core/check.h>
#include <core/log.h>
#include "furi_hal.h"
#include "m-string.h"
#include <furi.h>
#define DEFAULT_PATH "/"
#define EXTENSION "*"

View File

@@ -1,6 +1,5 @@
#include "../file_browser_app_i.h"
#include "furi_hal.h"
#include "m-string.h"
#include <furi.h>
void file_browser_scene_result_ok_callback(InputType type, void* context) {
furi_assert(context);
@@ -24,7 +23,13 @@ void file_browser_scene_result_on_enter(void* context) {
FileBrowserApp* app = context;
widget_add_string_multiline_element(
app->widget, 64, 10, AlignCenter, AlignTop, FontSecondary, string_get_cstr(app->file_path));
app->widget,
64,
10,
AlignCenter,
AlignTop,
FontSecondary,
furi_string_get_cstr(app->file_path));
view_dispatcher_switch_to_view(app->view_dispatcher, FileBrowserAppViewResult);
}

View File

@@ -19,7 +19,7 @@ bool file_browser_scene_start_on_event(void* context, SceneManagerEvent event) {
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
string_set_str(app->file_path, ANY_PATH("badusb/demo_windows.txt"));
furi_string_set(app->file_path, ANY_PATH("badusb/demo_windows.txt"));
scene_manager_next_scene(app->scene_manager, FileBrowserSceneBrowser);
consumed = true;
} else if(event.type == SceneManagerEventTypeTick) {

View File

@@ -2,6 +2,7 @@ App(
appid="lfrfid_debug",
name="LF-RFID Debug",
apptype=FlipperAppType.DEBUG,
targets=["f7"],
entry_point="lfrfid_debug_app",
requires=[
"gui",

View File

@@ -52,23 +52,29 @@ static void lfrfid_debug_view_tune_draw_callback(Canvas* canvas, void* _model) {
static void lfrfid_debug_view_tune_button_up(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos > 0) model->pos--;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_down(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos < 1) model->pos++;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_left(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos == 0) {
if(model->fine) {
model->ARR -= 1;
@@ -84,13 +90,15 @@ static void lfrfid_debug_view_tune_button_left(LfRfidTuneView* tune_view) {
}
model->dirty = true;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_right(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos == 0) {
if(model->fine) {
model->ARR += 1;
@@ -106,16 +114,13 @@ static void lfrfid_debug_view_tune_button_right(LfRfidTuneView* tune_view) {
}
model->dirty = true;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_ok(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
model->fine = !model->fine;
return true;
});
tune_view->view, LfRfidTuneViewModel * model, { model->fine = !model->fine; }, true);
}
static bool lfrfid_debug_view_tune_input_callback(InputEvent* event, void* context) {
@@ -158,14 +163,16 @@ LfRfidTuneView* lfrfid_debug_view_tune_alloc() {
view_allocate_model(tune_view->view, ViewModelTypeLocking, sizeof(LfRfidTuneViewModel));
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
model->dirty = true;
model->fine = false;
model->ARR = 511;
model->CCR = 255;
model->pos = 0;
return true;
});
},
true);
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);
@@ -184,24 +191,28 @@ View* lfrfid_debug_view_tune_get_view(LfRfidTuneView* tune_view) {
void lfrfid_debug_view_tune_clean(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
model->dirty = true;
model->fine = false;
model->ARR = 511;
model->CCR = 255;
model->pos = 0;
return true;
});
},
true);
}
bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view) {
bool result = false;
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
result = model->dirty;
model->dirty = false;
return false;
});
},
false);
return result;
}
@@ -209,10 +220,7 @@ bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view) {
uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view) {
uint32_t result = false;
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
result = model->ARR;
return false;
});
tune_view->view, LfRfidTuneViewModel * model, { result = model->ARR; }, false);
return result;
}
@@ -220,10 +228,7 @@ uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view) {
uint32_t lfrfid_debug_view_tune_get_ccr(LfRfidTuneView* tune_view) {
uint32_t result = false;
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
result = model->CCR;
return false;
});
tune_view->view, LfRfidTuneViewModel * model, { result = model->CCR; }, false);
return result;
}

View File

@@ -0,0 +1,11 @@
App(
appid="locale_test",
name="Locale Test",
apptype=FlipperAppType.DEBUG,
entry_point="locale_test_app",
cdefines=["APP_LOCALE"],
requires=["gui", "locale"],
stack_size=2 * 1024,
order=70,
fap_category="Debug",
)

View File

@@ -0,0 +1,102 @@
#include <furi.h>
#include <gui/gui.h>
#include <gui/elements.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/dialog_ex.h>
#include <locale/locale.h>
typedef struct {
Gui* gui;
ViewDispatcher* view_dispatcher;
View* view;
} LocaleTestApp;
static void locale_test_view_draw_callback(Canvas* canvas, void* _model) {
UNUSED(_model);
// Prepare canvas
canvas_set_color(canvas, ColorBlack);
canvas_set_font(canvas, FontSecondary);
FuriString* tmp_string = furi_string_alloc();
float temp = 25.3f;
LocaleMeasurementUnits units = locale_get_measurement_unit();
if(units == LocaleMeasurementUnitsMetric) {
furi_string_printf(tmp_string, "Temp: %5.1fC", (double)temp);
} else {
temp = locale_celsius_to_fahrenheit(temp);
furi_string_printf(tmp_string, "Temp: %5.1fF", (double)temp);
}
canvas_draw_str(canvas, 0, 10, furi_string_get_cstr(tmp_string));
FuriHalRtcDateTime datetime;
furi_hal_rtc_get_datetime(&datetime);
locale_format_time(tmp_string, &datetime, locale_get_time_format(), false);
canvas_draw_str(canvas, 0, 25, furi_string_get_cstr(tmp_string));
locale_format_date(tmp_string, &datetime, locale_get_date_format(), "/");
canvas_draw_str(canvas, 0, 40, furi_string_get_cstr(tmp_string));
furi_string_free(tmp_string);
}
static bool locale_test_view_input_callback(InputEvent* event, void* context) {
UNUSED(event);
UNUSED(context);
return false;
}
static uint32_t locale_test_exit(void* context) {
UNUSED(context);
return VIEW_NONE;
}
static LocaleTestApp* locale_test_alloc() {
LocaleTestApp* app = malloc(sizeof(LocaleTestApp));
// Gui
app->gui = furi_record_open(RECORD_GUI);
// View dispatcher
app->view_dispatcher = view_dispatcher_alloc();
view_dispatcher_enable_queue(app->view_dispatcher);
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
// Views
app->view = view_alloc();
view_set_draw_callback(app->view, locale_test_view_draw_callback);
view_set_input_callback(app->view, locale_test_view_input_callback);
view_set_previous_callback(app->view, locale_test_exit);
view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
view_dispatcher_switch_to_view(app->view_dispatcher, 0);
return app;
}
static void locale_test_free(LocaleTestApp* app) {
furi_assert(app);
// Free views
view_dispatcher_remove_view(app->view_dispatcher, 0);
view_free(app->view);
view_dispatcher_free(app->view_dispatcher);
// Close gui record
furi_record_close(RECORD_GUI);
app->gui = NULL;
// Free rest
free(app);
}
int32_t locale_test_app(void* p) {
UNUSED(p);
LocaleTestApp* app = locale_test_alloc();
view_dispatcher_run(app->view_dispatcher);
locale_test_free(app);
return 0;
}

View File

@@ -0,0 +1,10 @@
App(
appid="rpc_debug",
name="RPC Debug",
apptype=FlipperAppType.DEBUG,
entry_point="rpc_debug_app",
requires=["gui", "rpc_start", "notification"],
stack_size=2 * 1024,
order=10,
fap_category="Debug",
)

View File

@@ -0,0 +1,138 @@
#include "rpc_debug_app.h"
#include <core/log.h>
#include <string.h>
static bool rpc_debug_app_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
RpcDebugApp* app = context;
return scene_manager_handle_custom_event(app->scene_manager, event);
}
static bool rpc_debug_app_back_event_callback(void* context) {
furi_assert(context);
RpcDebugApp* app = context;
return scene_manager_handle_back_event(app->scene_manager);
}
static void rpc_debug_app_tick_event_callback(void* context) {
furi_assert(context);
RpcDebugApp* app = context;
scene_manager_handle_tick_event(app->scene_manager);
}
static void rpc_debug_app_rpc_command_callback(RpcAppSystemEvent event, void* context) {
furi_assert(context);
RpcDebugApp* app = context;
furi_assert(app->rpc);
if(event == RpcAppEventSessionClose) {
scene_manager_stop(app->scene_manager);
view_dispatcher_stop(app->view_dispatcher);
rpc_system_app_set_callback(app->rpc, NULL, NULL);
app->rpc = NULL;
} else if(event == RpcAppEventAppExit) {
scene_manager_stop(app->scene_manager);
view_dispatcher_stop(app->view_dispatcher);
rpc_system_app_confirm(app->rpc, RpcAppEventAppExit, true);
} else {
rpc_system_app_confirm(app->rpc, event, false);
}
}
static bool rpc_debug_app_rpc_init_rpc(RpcDebugApp* app, const char* args) {
bool ret = false;
if(args && strlen(args)) {
uint32_t rpc = 0;
if(sscanf(args, "RPC %lX", &rpc) == 1) {
app->rpc = (RpcAppSystem*)rpc;
rpc_system_app_set_callback(app->rpc, rpc_debug_app_rpc_command_callback, app);
rpc_system_app_send_started(app->rpc);
ret = true;
}
}
return ret;
}
static RpcDebugApp* rpc_debug_app_alloc() {
RpcDebugApp* app = malloc(sizeof(RpcDebugApp));
app->gui = furi_record_open(RECORD_GUI);
app->notifications = furi_record_open(RECORD_NOTIFICATION);
app->scene_manager = scene_manager_alloc(&rpc_debug_app_scene_handlers, app);
app->view_dispatcher = view_dispatcher_alloc();
view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
view_dispatcher_set_custom_event_callback(
app->view_dispatcher, rpc_debug_app_custom_event_callback);
view_dispatcher_set_navigation_event_callback(
app->view_dispatcher, rpc_debug_app_back_event_callback);
view_dispatcher_set_tick_event_callback(
app->view_dispatcher, rpc_debug_app_tick_event_callback, 100);
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
view_dispatcher_enable_queue(app->view_dispatcher);
app->widget = widget_alloc();
view_dispatcher_add_view(
app->view_dispatcher, RpcDebugAppViewWidget, widget_get_view(app->widget));
app->submenu = submenu_alloc();
view_dispatcher_add_view(
app->view_dispatcher, RpcDebugAppViewSubmenu, submenu_get_view(app->submenu));
app->text_box = text_box_alloc();
view_dispatcher_add_view(
app->view_dispatcher, RpcDebugAppViewTextBox, text_box_get_view(app->text_box));
app->text_input = text_input_alloc();
view_dispatcher_add_view(
app->view_dispatcher, RpcDebugAppViewTextInput, text_input_get_view(app->text_input));
app->byte_input = byte_input_alloc();
view_dispatcher_add_view(
app->view_dispatcher, RpcDebugAppViewByteInput, byte_input_get_view(app->byte_input));
return app;
}
static void rpc_debug_app_free(RpcDebugApp* app) {
view_dispatcher_remove_view(app->view_dispatcher, RpcDebugAppViewByteInput);
view_dispatcher_remove_view(app->view_dispatcher, RpcDebugAppViewTextInput);
view_dispatcher_remove_view(app->view_dispatcher, RpcDebugAppViewTextBox);
view_dispatcher_remove_view(app->view_dispatcher, RpcDebugAppViewSubmenu);
view_dispatcher_remove_view(app->view_dispatcher, RpcDebugAppViewWidget);
free(app->byte_input);
free(app->text_input);
free(app->text_box);
free(app->submenu);
free(app->widget);
free(app->scene_manager);
free(app->view_dispatcher);
furi_record_close(RECORD_NOTIFICATION);
app->notifications = NULL;
furi_record_close(RECORD_GUI);
app->gui = NULL;
if(app->rpc) {
rpc_system_app_set_callback(app->rpc, NULL, NULL);
rpc_system_app_send_exited(app->rpc);
app->rpc = NULL;
}
free(app);
}
int32_t rpc_debug_app(void* args) {
RpcDebugApp* app = rpc_debug_app_alloc();
if(rpc_debug_app_rpc_init_rpc(app, args)) {
notification_message(app->notifications, &sequence_display_backlight_on);
scene_manager_next_scene(app->scene_manager, RpcDebugAppSceneStart);
} else {
scene_manager_next_scene(app->scene_manager, RpcDebugAppSceneStartDummy);
}
view_dispatcher_run(app->view_dispatcher);
rpc_debug_app_free(app);
return 0;
}

View File

@@ -0,0 +1,54 @@
#pragma once
#include <furi.h>
#include <gui/gui.h>
#include <gui/view.h>
#include <gui/scene_manager.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/widget.h>
#include <gui/modules/submenu.h>
#include <gui/modules/text_box.h>
#include <gui/modules/text_input.h>
#include <gui/modules/byte_input.h>
#include <rpc/rpc_app.h>
#include <notification/notification_messages.h>
#include "scenes/rpc_debug_app_scene.h"
#define DATA_STORE_SIZE 64U
#define TEXT_STORE_SIZE 64U
typedef struct {
Gui* gui;
RpcAppSystem* rpc;
SceneManager* scene_manager;
ViewDispatcher* view_dispatcher;
NotificationApp* notifications;
Widget* widget;
Submenu* submenu;
TextBox* text_box;
TextInput* text_input;
ByteInput* byte_input;
char text_store[TEXT_STORE_SIZE];
uint8_t data_store[DATA_STORE_SIZE];
} RpcDebugApp;
typedef enum {
RpcDebugAppViewWidget,
RpcDebugAppViewSubmenu,
RpcDebugAppViewTextBox,
RpcDebugAppViewTextInput,
RpcDebugAppViewByteInput,
} RpcDebugAppView;
typedef enum {
// Reserve first 100 events for button types and indexes, starting from 0
RpcDebugAppCustomEventInputErrorCode = 100,
RpcDebugAppCustomEventInputErrorText,
RpcDebugAppCustomEventInputDataExchange,
RpcDebugAppCustomEventRpcDataExchange,
} RpcDebugAppCustomEvent;

View File

@@ -0,0 +1,30 @@
#include "rpc_debug_app_scene.h"
// Generate scene on_enter handlers array
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
void (*const rpc_debug_app_on_enter_handlers[])(void*) = {
#include "rpc_debug_app_scene_config.h"
};
#undef ADD_SCENE
// Generate scene on_event handlers array
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
bool (*const rpc_debug_app_on_event_handlers[])(void* context, SceneManagerEvent event) = {
#include "rpc_debug_app_scene_config.h"
};
#undef ADD_SCENE
// Generate scene on_exit handlers array
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
void (*const rpc_debug_app_on_exit_handlers[])(void* context) = {
#include "rpc_debug_app_scene_config.h"
};
#undef ADD_SCENE
// Initialize scene handlers configuration structure
const SceneManagerHandlers rpc_debug_app_scene_handlers = {
.on_enter_handlers = rpc_debug_app_on_enter_handlers,
.on_event_handlers = rpc_debug_app_on_event_handlers,
.on_exit_handlers = rpc_debug_app_on_exit_handlers,
.scene_num = RpcDebugAppSceneNum,
};

View File

@@ -0,0 +1,29 @@
#pragma once
#include <gui/scene_manager.h>
// Generate scene id and total number
#define ADD_SCENE(prefix, name, id) RpcDebugAppScene##id,
typedef enum {
#include "rpc_debug_app_scene_config.h"
RpcDebugAppSceneNum,
} RpcDebugAppScene;
#undef ADD_SCENE
extern const SceneManagerHandlers rpc_debug_app_scene_handlers;
// Generate scene on_enter handlers declaration
#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
#include "rpc_debug_app_scene_config.h"
#undef ADD_SCENE
// Generate scene on_event handlers declaration
#define ADD_SCENE(prefix, name, id) \
bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event);
#include "rpc_debug_app_scene_config.h"
#undef ADD_SCENE
// Generate scene on_exit handlers declaration
#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context);
#include "rpc_debug_app_scene_config.h"
#undef ADD_SCENE

View File

@@ -0,0 +1,8 @@
ADD_SCENE(rpc_debug_app, start, Start)
ADD_SCENE(rpc_debug_app, start_dummy, StartDummy)
ADD_SCENE(rpc_debug_app, test_app_error, TestAppError)
ADD_SCENE(rpc_debug_app, test_data_exchange, TestDataExchange)
ADD_SCENE(rpc_debug_app, input_error_code, InputErrorCode)
ADD_SCENE(rpc_debug_app, input_error_text, InputErrorText)
ADD_SCENE(rpc_debug_app, input_data_exchange, InputDataExchange)
ADD_SCENE(rpc_debug_app, receive_data_exchange, ReceiveDataExchange)

View File

@@ -0,0 +1,40 @@
#include "../rpc_debug_app.h"
static void rpc_debug_app_scene_input_data_exchange_result_callback(void* context) {
RpcDebugApp* app = context;
view_dispatcher_send_custom_event(
app->view_dispatcher, RpcDebugAppCustomEventInputDataExchange);
}
void rpc_debug_app_scene_input_data_exchange_on_enter(void* context) {
RpcDebugApp* app = context;
byte_input_set_header_text(app->byte_input, "Enter data to exchange");
byte_input_set_result_callback(
app->byte_input,
rpc_debug_app_scene_input_data_exchange_result_callback,
NULL,
app,
app->data_store,
DATA_STORE_SIZE);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewByteInput);
}
bool rpc_debug_app_scene_input_data_exchange_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == RpcDebugAppCustomEventInputDataExchange) {
rpc_system_app_exchange_data(app->rpc, app->data_store, DATA_STORE_SIZE);
scene_manager_previous_scene(app->scene_manager);
consumed = true;
}
}
return consumed;
}
void rpc_debug_app_scene_input_data_exchange_on_exit(void* context) {
RpcDebugApp* app = context;
UNUSED(app);
}

View File

@@ -0,0 +1,64 @@
#include "../rpc_debug_app.h"
static bool rpc_debug_app_scene_input_error_code_validator_callback(
const char* text,
FuriString* error,
void* context) {
UNUSED(context);
for(; *text; ++text) {
const char c = *text;
if(c < '0' || c > '9') {
furi_string_printf(error, "%s", "Please enter\na number!");
return false;
}
}
return true;
}
static void rpc_debug_app_scene_input_error_code_result_callback(void* context) {
RpcDebugApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, RpcDebugAppCustomEventInputErrorCode);
}
void rpc_debug_app_scene_input_error_code_on_enter(void* context) {
RpcDebugApp* app = context;
strncpy(app->text_store, "666", TEXT_STORE_SIZE);
text_input_set_header_text(app->text_input, "Enter error code");
text_input_set_validator(
app->text_input, rpc_debug_app_scene_input_error_code_validator_callback, NULL);
text_input_set_result_callback(
app->text_input,
rpc_debug_app_scene_input_error_code_result_callback,
app,
app->text_store,
TEXT_STORE_SIZE,
true);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewTextInput);
}
bool rpc_debug_app_scene_input_error_code_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == RpcDebugAppCustomEventInputErrorCode) {
char* end;
int error_code = strtol(app->text_store, &end, 10);
if(!*end) {
rpc_system_app_set_error_code(app->rpc, error_code);
}
scene_manager_previous_scene(app->scene_manager);
consumed = true;
}
}
return consumed;
}
void rpc_debug_app_scene_input_error_code_on_exit(void* context) {
RpcDebugApp* app = context;
text_input_reset(app->text_input);
text_input_set_validator(app->text_input, NULL, NULL);
}

View File

@@ -0,0 +1,40 @@
#include "../rpc_debug_app.h"
static void rpc_debug_app_scene_input_error_text_result_callback(void* context) {
RpcDebugApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, RpcDebugAppCustomEventInputErrorText);
}
void rpc_debug_app_scene_input_error_text_on_enter(void* context) {
RpcDebugApp* app = context;
strncpy(app->text_store, "I'm a scary error message!", TEXT_STORE_SIZE);
text_input_set_header_text(app->text_input, "Enter error text");
text_input_set_result_callback(
app->text_input,
rpc_debug_app_scene_input_error_text_result_callback,
app,
app->text_store,
TEXT_STORE_SIZE,
true);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewTextInput);
}
bool rpc_debug_app_scene_input_error_text_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == RpcDebugAppCustomEventInputErrorText) {
rpc_system_app_set_error_text(app->rpc, app->text_store);
scene_manager_previous_scene(app->scene_manager);
consumed = true;
}
}
return consumed;
}
void rpc_debug_app_scene_input_error_text_on_exit(void* context) {
RpcDebugApp* app = context;
text_input_reset(app->text_input);
}

View File

@@ -0,0 +1,70 @@
#include "../rpc_debug_app.h"
static void rpc_debug_app_scene_start_format_hex(
const uint8_t* data,
size_t data_size,
char* buf,
size_t buf_size) {
furi_assert(data);
furi_assert(buf);
const size_t byte_width = 3;
const size_t line_width = 7;
data_size = MIN(data_size, buf_size / (byte_width + 1));
for(size_t i = 0; i < data_size; ++i) {
char* p = buf + (i * byte_width);
char sep = !((i + 1) % line_width) ? '\n' : ' ';
snprintf(p, byte_width + 1, "%02X%c", data[i], sep);
}
buf[buf_size - 1] = '\0';
}
static void rpc_debug_app_scene_receive_data_exchange_callback(
const uint8_t* data,
size_t data_size,
void* context) {
RpcDebugApp* app = context;
if(data) {
rpc_debug_app_scene_start_format_hex(data, data_size, app->text_store, TEXT_STORE_SIZE);
} else {
strncpy(app->text_store, "<Data empty>", TEXT_STORE_SIZE);
}
view_dispatcher_send_custom_event(app->view_dispatcher, RpcDebugAppCustomEventRpcDataExchange);
}
void rpc_debug_app_scene_receive_data_exchange_on_enter(void* context) {
RpcDebugApp* app = context;
strncpy(app->text_store, "Received data will appear here...", TEXT_STORE_SIZE);
text_box_set_text(app->text_box, app->text_store);
text_box_set_font(app->text_box, TextBoxFontHex);
rpc_system_app_set_data_exchange_callback(
app->rpc, rpc_debug_app_scene_receive_data_exchange_callback, app);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewTextBox);
}
bool rpc_debug_app_scene_receive_data_exchange_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == RpcDebugAppCustomEventRpcDataExchange) {
notification_message(app->notifications, &sequence_blink_cyan_100);
notification_message(app->notifications, &sequence_display_backlight_on);
text_box_set_text(app->text_box, app->text_store);
consumed = true;
}
}
return consumed;
}
void rpc_debug_app_scene_receive_data_exchange_on_exit(void* context) {
RpcDebugApp* app = context;
text_box_reset(app->text_box);
rpc_system_app_set_data_exchange_callback(app->rpc, NULL, NULL);
}

View File

@@ -0,0 +1,57 @@
#include "../rpc_debug_app.h"
enum SubmenuIndex {
SubmenuIndexTestAppError,
SubmenuIndexTestDataExchange,
};
static void rpc_debug_app_scene_start_submenu_callback(void* context, uint32_t index) {
RpcDebugApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, index);
}
void rpc_debug_app_scene_start_on_enter(void* context) {
RpcDebugApp* app = context;
Submenu* submenu = app->submenu;
submenu_add_item(
submenu,
"Test App Error",
SubmenuIndexTestAppError,
rpc_debug_app_scene_start_submenu_callback,
app);
submenu_add_item(
submenu,
"Test Data Exchange",
SubmenuIndexTestDataExchange,
rpc_debug_app_scene_start_submenu_callback,
app);
submenu_set_selected_item(submenu, SubmenuIndexTestAppError);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewSubmenu);
}
bool rpc_debug_app_scene_start_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
SceneManager* scene_manager = app->scene_manager;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
const uint32_t submenu_index = event.event;
if(submenu_index == SubmenuIndexTestAppError) {
scene_manager_next_scene(scene_manager, RpcDebugAppSceneTestAppError);
consumed = true;
} else if(submenu_index == SubmenuIndexTestDataExchange) {
scene_manager_next_scene(scene_manager, RpcDebugAppSceneTestDataExchange);
consumed = true;
}
}
return consumed;
}
void rpc_debug_app_scene_start_on_exit(void* context) {
RpcDebugApp* app = context;
submenu_reset(app->submenu);
}

View File

@@ -0,0 +1,30 @@
#include "../rpc_debug_app.h"
void rpc_debug_app_scene_start_dummy_on_enter(void* context) {
RpcDebugApp* app = context;
widget_add_text_box_element(
app->widget,
0,
0,
128,
64,
AlignCenter,
AlignCenter,
"This application\nis meant to be run\nin \e#RPC\e# mode.",
false);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewWidget);
}
bool rpc_debug_app_scene_start_dummy_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
UNUSED(app);
UNUSED(event);
bool consumed = false;
return consumed;
}
void rpc_debug_app_scene_start_dummy_on_exit(void* context) {
RpcDebugApp* app = context;
widget_reset(app->widget);
}

View File

@@ -0,0 +1,57 @@
#include "../rpc_debug_app.h"
typedef enum {
SubmenuIndexSetErrorCode,
SubmenuIndexSetErrorText,
} SubmenuIndex;
static void rpc_debug_app_scene_test_app_error_submenu_callback(void* context, uint32_t index) {
RpcDebugApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, index);
}
void rpc_debug_app_scene_test_app_error_on_enter(void* context) {
RpcDebugApp* app = context;
Submenu* submenu = app->submenu;
submenu_add_item(
submenu,
"Set Error Code",
SubmenuIndexSetErrorCode,
rpc_debug_app_scene_test_app_error_submenu_callback,
app);
submenu_add_item(
submenu,
"Set Error Text",
SubmenuIndexSetErrorText,
rpc_debug_app_scene_test_app_error_submenu_callback,
app);
submenu_set_selected_item(submenu, SubmenuIndexSetErrorCode);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewSubmenu);
}
bool rpc_debug_app_scene_test_app_error_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
SceneManager* scene_manager = app->scene_manager;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
const uint32_t submenu_index = event.event;
if(submenu_index == SubmenuIndexSetErrorCode) {
scene_manager_next_scene(scene_manager, RpcDebugAppSceneInputErrorCode);
consumed = true;
} else if(submenu_index == SubmenuIndexSetErrorText) {
scene_manager_next_scene(scene_manager, RpcDebugAppSceneInputErrorText);
consumed = true;
}
}
return consumed;
}
void rpc_debug_app_scene_test_app_error_on_exit(void* context) {
RpcDebugApp* app = context;
submenu_reset(app->submenu);
}

View File

@@ -0,0 +1,58 @@
#include "../rpc_debug_app.h"
typedef enum {
SubmenuIndexSendData,
SubmenuIndexReceiveData,
} SubmenuIndex;
static void
rpc_debug_app_scene_test_data_exchange_submenu_callback(void* context, uint32_t index) {
RpcDebugApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, index);
}
void rpc_debug_app_scene_test_data_exchange_on_enter(void* context) {
RpcDebugApp* app = context;
Submenu* submenu = app->submenu;
submenu_add_item(
submenu,
"Send Data",
SubmenuIndexSendData,
rpc_debug_app_scene_test_data_exchange_submenu_callback,
app);
submenu_add_item(
submenu,
"Receive Data",
SubmenuIndexReceiveData,
rpc_debug_app_scene_test_data_exchange_submenu_callback,
app);
submenu_set_selected_item(submenu, SubmenuIndexSendData);
view_dispatcher_switch_to_view(app->view_dispatcher, RpcDebugAppViewSubmenu);
}
bool rpc_debug_app_scene_test_data_exchange_on_event(void* context, SceneManagerEvent event) {
RpcDebugApp* app = context;
SceneManager* scene_manager = app->scene_manager;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
const uint32_t submenu_index = event.event;
if(submenu_index == SubmenuIndexSendData) {
scene_manager_next_scene(scene_manager, RpcDebugAppSceneInputDataExchange);
consumed = true;
} else if(submenu_index == SubmenuIndexReceiveData) {
scene_manager_next_scene(scene_manager, RpcDebugAppSceneReceiveDataExchange);
consumed = true;
}
}
return consumed;
}
void rpc_debug_app_scene_test_data_exchange_on_exit(void* context) {
RpcDebugApp* app = context;
submenu_reset(app->submenu);
}

View File

@@ -7,6 +7,6 @@ App(
requires=["gui"],
stack_size=2 * 1024,
order=70,
fap_icon="../../../assets/icons/Archive/keyboard_10px.png",
fap_category="Misc",
fap_icon="uart_10px.png",
fap_category="GPIO",
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,10 +1,8 @@
#include <furi.h>
#include <m-string.h>
#include <gui/gui.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <gui/elements.h>
#include <stream_buffer.h>
#include <furi_hal_uart.h>
#include <furi_hal_console.h>
#include <gui/view_dispatcher.h>
@@ -21,11 +19,11 @@ typedef struct {
ViewDispatcher* view_dispatcher;
View* view;
FuriThread* worker_thread;
StreamBufferHandle_t rx_stream;
FuriStreamBuffer* rx_stream;
} UartEchoApp;
typedef struct {
string_t text;
FuriString* text;
} ListElement;
struct UartDumpModel {
@@ -64,10 +62,11 @@ static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) {
canvas,
0,
(i + 1) * (canvas_current_font_height(canvas) - 1),
string_get_cstr(model->list[i]->text));
furi_string_get_cstr(model->list[i]->text));
if(i == model->line) {
uint8_t width = canvas_string_width(canvas, string_get_cstr(model->list[i]->text));
uint8_t width =
canvas_string_width(canvas, furi_string_get_cstr(model->list[i]->text));
canvas_draw_box(
canvas,
@@ -92,13 +91,11 @@ static uint32_t uart_echo_exit(void* context) {
static void uart_echo_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
furi_assert(context);
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
UartEchoApp* app = context;
if(ev == UartIrqEventRXNE) {
xStreamBufferSendFromISR(app->rx_stream, &data, 1, &xHigherPriorityTaskWoken);
furi_stream_buffer_send(app->rx_stream, &data, 1, 0);
furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventRx);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
@@ -113,7 +110,7 @@ static void uart_echo_push_to_list(UartDumpModel* model, const char data) {
model->escape = true;
} else if((data >= ' ' && data <= '~') || (data == '\n' || data == '\r')) {
bool new_string_needed = false;
if(string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
if(furi_string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
new_string_needed = true;
} else if((data == '\n' || data == '\r')) {
// pack line breaks
@@ -132,13 +129,13 @@ static void uart_echo_push_to_list(UartDumpModel* model, const char data) {
model->list[i - 1] = model->list[i];
}
string_reset(first->text);
furi_string_reset(first->text);
model->list[model->line] = first;
}
}
if(data != '\n' && data != '\r') {
string_push_back(model->list[model->line]->text, data);
furi_string_push_back(model->list[model->line]->text, data);
}
}
model->last_char = data;
@@ -158,25 +155,24 @@ static int32_t uart_echo_worker(void* context) {
size_t length = 0;
do {
uint8_t data[64];
length = xStreamBufferReceive(app->rx_stream, data, 64, 0);
length = furi_stream_buffer_receive(app->rx_stream, data, 64, 0);
if(length > 0) {
furi_hal_uart_tx(FuriHalUartIdUSART1, data, length);
with_view_model(
app->view, (UartDumpModel * model) {
app->view,
UartDumpModel * model,
{
for(size_t i = 0; i < length; i++) {
uart_echo_push_to_list(model, data[i]);
}
return false;
});
},
false);
}
} while(length > 0);
notification_message(app->notification, &sequence_notification);
with_view_model(
app->view, (UartDumpModel * model) {
UNUSED(model);
return true;
});
app->view, UartDumpModel * model, { UNUSED(model); }, true);
}
}
@@ -186,7 +182,7 @@ static int32_t uart_echo_worker(void* context) {
static UartEchoApp* uart_echo_app_alloc() {
UartEchoApp* app = malloc(sizeof(UartEchoApp));
app->rx_stream = xStreamBufferCreate(2048, 1);
app->rx_stream = furi_stream_buffer_alloc(2048, 1);
// Gui
app->gui = furi_record_open(RECORD_GUI);
@@ -203,55 +199,55 @@ static UartEchoApp* uart_echo_app_alloc() {
view_set_input_callback(app->view, uart_echo_view_input_callback);
view_allocate_model(app->view, ViewModelTypeLocking, sizeof(UartDumpModel));
with_view_model(
app->view, (UartDumpModel * model) {
app->view,
UartDumpModel * model,
{
for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
model->line = 0;
model->escape = false;
model->list[i] = malloc(sizeof(ListElement));
string_init(model->list[i]->text);
model->list[i]->text = furi_string_alloc();
}
return true;
});
},
true);
view_set_previous_callback(app->view, uart_echo_exit);
view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
view_dispatcher_switch_to_view(app->view_dispatcher, 0);
app->worker_thread = furi_thread_alloc_ex("UsbUartWorker", 1024, uart_echo_worker, app);
furi_thread_start(app->worker_thread);
// Enable uart listener
furi_hal_console_disable();
furi_hal_uart_set_br(FuriHalUartIdUSART1, 115200);
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_echo_on_irq_cb, app);
app->worker_thread = furi_thread_alloc();
furi_thread_set_name(app->worker_thread, "UsbUartWorker");
furi_thread_set_stack_size(app->worker_thread, 1024);
furi_thread_set_context(app->worker_thread, app);
furi_thread_set_callback(app->worker_thread, uart_echo_worker);
furi_thread_start(app->worker_thread);
return app;
}
static void uart_echo_app_free(UartEchoApp* app) {
furi_assert(app);
furi_hal_console_enable(); // this will also clear IRQ callback so thread is no longer referenced
furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventStop);
furi_thread_join(app->worker_thread);
furi_thread_free(app->worker_thread);
furi_hal_console_enable();
// Free views
view_dispatcher_remove_view(app->view_dispatcher, 0);
with_view_model(
app->view, (UartDumpModel * model) {
app->view,
UartDumpModel * model,
{
for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
string_clear(model->list[i]->text);
furi_string_free(model->list[i]->text);
free(model->list[i]);
}
return true;
});
},
true);
view_free(app->view);
view_dispatcher_free(app->view_dispatcher);
@@ -260,7 +256,7 @@ static void uart_echo_app_free(UartEchoApp* app) {
furi_record_close(RECORD_NOTIFICATION);
app->gui = NULL;
vStreamBufferDelete(app->rx_stream);
furi_stream_buffer_free(app->rx_stream);
// Free rest
free(app);

View File

@@ -0,0 +1,110 @@
#include <furi.h>
#include <furi_hal.h>
#include "../minunit.h"
#include <bt/bt_service/bt_keys_storage.h>
#include <storage/storage.h>
#define BT_TEST_KEY_STORAGE_FILE_PATH EXT_PATH("unit_tests/bt_test.keys")
#define BT_TEST_NVM_RAM_BUFF_SIZE (507 * 4) // The same as in ble NVM storage
typedef struct {
Storage* storage;
BtKeysStorage* bt_keys_storage;
uint8_t* nvm_ram_buff_dut;
uint8_t* nvm_ram_buff_ref;
} BtTest;
BtTest* bt_test = NULL;
void bt_test_alloc() {
bt_test = malloc(sizeof(BtTest));
bt_test->storage = furi_record_open(RECORD_STORAGE);
bt_test->nvm_ram_buff_dut = malloc(BT_TEST_NVM_RAM_BUFF_SIZE);
bt_test->nvm_ram_buff_ref = malloc(BT_TEST_NVM_RAM_BUFF_SIZE);
bt_test->bt_keys_storage = bt_keys_storage_alloc(BT_TEST_KEY_STORAGE_FILE_PATH);
bt_keys_storage_set_ram_params(
bt_test->bt_keys_storage, bt_test->nvm_ram_buff_dut, BT_TEST_NVM_RAM_BUFF_SIZE);
}
void bt_test_free() {
furi_assert(bt_test);
free(bt_test->nvm_ram_buff_ref);
free(bt_test->nvm_ram_buff_dut);
bt_keys_storage_free(bt_test->bt_keys_storage);
furi_record_close(RECORD_STORAGE);
free(bt_test);
bt_test = NULL;
}
static void bt_test_keys_storage_profile() {
// Emulate nvm change on initial connection
const int nvm_change_size_on_connection = 88;
for(size_t i = 0; i < nvm_change_size_on_connection; i++) {
bt_test->nvm_ram_buff_dut[i] = rand();
bt_test->nvm_ram_buff_ref[i] = bt_test->nvm_ram_buff_dut[i];
}
// Emulate update storage on initial connect
mu_assert(
bt_keys_storage_update(
bt_test->bt_keys_storage, bt_test->nvm_ram_buff_dut, nvm_change_size_on_connection),
"Failed to update key storage on initial connect");
memset(bt_test->nvm_ram_buff_dut, 0, BT_TEST_NVM_RAM_BUFF_SIZE);
mu_assert(bt_keys_storage_load(bt_test->bt_keys_storage), "Failed to load NVM");
mu_assert(
memcmp(
bt_test->nvm_ram_buff_ref, bt_test->nvm_ram_buff_dut, nvm_change_size_on_connection) ==
0,
"Wrong buffer loaded");
const int nvm_disconnect_update_offset = 84;
const int nvm_disconnect_update_size = 324;
const int nvm_total_size = nvm_change_size_on_connection -
(nvm_change_size_on_connection - nvm_disconnect_update_offset) +
nvm_disconnect_update_size;
// Emulate update storage on initial disconnect
for(size_t i = nvm_disconnect_update_offset;
i < nvm_disconnect_update_offset + nvm_disconnect_update_size;
i++) {
bt_test->nvm_ram_buff_dut[i] = rand();
bt_test->nvm_ram_buff_ref[i] = bt_test->nvm_ram_buff_dut[i];
}
mu_assert(
bt_keys_storage_update(
bt_test->bt_keys_storage,
&bt_test->nvm_ram_buff_dut[nvm_disconnect_update_offset],
nvm_disconnect_update_size),
"Failed to update key storage on initial disconnect");
memset(bt_test->nvm_ram_buff_dut, 0, BT_TEST_NVM_RAM_BUFF_SIZE);
mu_assert(bt_keys_storage_load(bt_test->bt_keys_storage), "Failed to load NVM");
mu_assert(
memcmp(bt_test->nvm_ram_buff_ref, bt_test->nvm_ram_buff_dut, nvm_total_size) == 0,
"Wrong buffer loaded");
}
static void bt_test_keys_remove_test_file() {
mu_assert(
storage_simply_remove(bt_test->storage, BT_TEST_KEY_STORAGE_FILE_PATH),
"Can't remove test file");
}
MU_TEST(bt_test_keys_storage_serial_profile) {
furi_assert(bt_test);
bt_test_keys_remove_test_file();
bt_test_keys_storage_profile();
bt_test_keys_remove_test_file();
}
MU_TEST_SUITE(test_bt) {
bt_test_alloc();
MU_RUN_TEST(bt_test_keys_storage_serial_profile);
bt_test_free();
}
int run_minunit_test_bt() {
MU_RUN_SUITE(test_bt);
return MU_EXIT_CODE;
}

View File

@@ -58,7 +58,7 @@ static const char* test_data_win = "Filetype: Flipper Format test\r\n"
#define ARRAY_W_BSIZE(x) (x), (sizeof(x))
MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
string_t tmpstr;
FuriString* tmpstr;
uint32_t version;
uint32_t uint32_data[COUNT_OF(test_uint_data)];
int32_t int32_data[COUNT_OF(test_int_data)];
@@ -101,14 +101,14 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_assert_int_eq(position_before, stream_tell(flipper_format_get_raw_stream(flipper_format)));
// read test
string_init(tmpstr);
tmpstr = furi_string_alloc();
mu_check(flipper_format_read_header(flipper_format, tmpstr, &version));
mu_assert_string_eq(test_filetype, string_get_cstr(tmpstr));
mu_assert_string_eq(test_filetype, furi_string_get_cstr(tmpstr));
mu_assert_int_eq(test_version, version);
mu_check(flipper_format_read_string(flipper_format, test_string_key, tmpstr));
mu_assert_string_eq(test_string_data, string_get_cstr(tmpstr));
mu_assert_string_eq(test_string_data, furi_string_get_cstr(tmpstr));
mu_check(flipper_format_get_value_count(flipper_format, test_int_key, &count));
mu_assert_int_eq(COUNT_OF(test_int_data), count);
@@ -133,7 +133,7 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_check(!flipper_format_read_string(flipper_format, "Key that doesn't exist", tmpstr));
string_clear(tmpstr);
furi_string_free(tmpstr);
// update data
mu_check(flipper_format_rewind(flipper_format));
@@ -155,14 +155,14 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
uint8_t hex_updated_data[COUNT_OF(test_hex_updated_data)];
mu_check(flipper_format_rewind(flipper_format));
string_init(tmpstr);
tmpstr = furi_string_alloc();
mu_check(flipper_format_read_header(flipper_format, tmpstr, &version));
mu_assert_string_eq(test_filetype, string_get_cstr(tmpstr));
mu_assert_string_eq(test_filetype, furi_string_get_cstr(tmpstr));
mu_assert_int_eq(test_version, version);
mu_check(flipper_format_read_string(flipper_format, test_string_key, tmpstr));
mu_assert_string_eq(test_string_updated_data, string_get_cstr(tmpstr));
mu_assert_string_eq(test_string_updated_data, furi_string_get_cstr(tmpstr));
mu_check(flipper_format_get_value_count(flipper_format, test_int_key, &count));
mu_assert_int_eq(COUNT_OF(test_int_updated_data), count);
@@ -190,7 +190,7 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_check(!flipper_format_read_string(flipper_format, "Key that doesn't exist", tmpstr));
string_clear(tmpstr);
furi_string_free(tmpstr);
// update data
mu_check(flipper_format_rewind(flipper_format));
@@ -214,14 +214,14 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
uint8_t hex_new_data[COUNT_OF(test_hex_new_data)];
mu_check(flipper_format_rewind(flipper_format));
string_init(tmpstr);
tmpstr = furi_string_alloc();
mu_check(flipper_format_read_header(flipper_format, tmpstr, &version));
mu_assert_string_eq(test_filetype, string_get_cstr(tmpstr));
mu_assert_string_eq(test_filetype, furi_string_get_cstr(tmpstr));
mu_assert_int_eq(test_version, version);
mu_check(flipper_format_read_string(flipper_format, test_string_key, tmpstr));
mu_assert_string_eq(test_string_updated_2_data, string_get_cstr(tmpstr));
mu_assert_string_eq(test_string_updated_2_data, furi_string_get_cstr(tmpstr));
mu_check(flipper_format_get_value_count(flipper_format, test_int_key, &count));
mu_assert_int_eq(COUNT_OF(test_int_updated_2_data), count);
@@ -255,7 +255,7 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_check(!flipper_format_read_string(flipper_format, "Key that doesn't exist", tmpstr));
string_clear(tmpstr);
furi_string_free(tmpstr);
// delete key test
mu_check(flipper_format_rewind(flipper_format));

View File

@@ -57,6 +57,23 @@ static const char* test_data_win = "Filetype: Flipper File test\r\n"
"Hex data: DE AD BE";
#define READ_TEST_FLP "ff_flp.test"
#define READ_TEST_ODD "ff_oddities.test"
static const char* test_data_odd = "Filetype: Flipper File test\n"
// Tabs before newline
"Version: 666\t\t\n"
"# This is comment\n"
// Windows newline in a UNIX file
"String data: String\r\n"
// Trailing whitespace
"Int32 data: 1234 -6345 7813 0 \n"
// Extra whitespace
"Uint32 data: 1234 0 5678 9098 7654321 \n"
// Mixed whitespace
"Float data: 1.5\t \t1000.0\n"
// Leading tabs after key
"Bool data:\t\ttrue false\n"
// Mixed trailing whitespace
"Hex data: DE AD BE\t ";
// data created by user on linux machine
static const char* test_file_linux = TEST_DIR READ_TEST_NIX;
@@ -64,6 +81,8 @@ static const char* test_file_linux = TEST_DIR READ_TEST_NIX;
static const char* test_file_windows = TEST_DIR READ_TEST_WIN;
// data created by flipper itself
static const char* test_file_flipper = TEST_DIR READ_TEST_FLP;
// data containing odd user input
static const char* test_file_oddities = TEST_DIR READ_TEST_ODD;
static bool storage_write_string(const char* path, const char* data) {
Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -102,8 +121,8 @@ static bool test_read(const char* file_name) {
bool result = false;
FlipperFormat* file = flipper_format_file_alloc(storage);
string_t string_value;
string_init(string_value);
FuriString* string_value;
string_value = furi_string_alloc();
uint32_t uint32_value;
void* scratchpad = malloc(512);
@@ -111,11 +130,11 @@ static bool test_read(const char* file_name) {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, string_value, &uint32_value)) break;
if(string_cmp_str(string_value, test_filetype) != 0) break;
if(furi_string_cmp_str(string_value, test_filetype) != 0) break;
if(uint32_value != test_version) break;
if(!flipper_format_read_string(file, test_string_key, string_value)) break;
if(string_cmp_str(string_value, test_string_data) != 0) break;
if(furi_string_cmp_str(string_value, test_string_data) != 0) break;
if(!flipper_format_get_value_count(file, test_int_key, &uint32_value)) break;
if(uint32_value != COUNT_OF(test_int_data)) break;
@@ -150,7 +169,7 @@ static bool test_read(const char* file_name) {
} while(false);
free(scratchpad);
string_clear(string_value);
furi_string_free(string_value);
flipper_format_free(file);
@@ -164,8 +183,8 @@ static bool test_read_updated(const char* file_name) {
bool result = false;
FlipperFormat* file = flipper_format_file_alloc(storage);
string_t string_value;
string_init(string_value);
FuriString* string_value;
string_value = furi_string_alloc();
uint32_t uint32_value;
void* scratchpad = malloc(512);
@@ -173,11 +192,11 @@ static bool test_read_updated(const char* file_name) {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, string_value, &uint32_value)) break;
if(string_cmp_str(string_value, test_filetype) != 0) break;
if(furi_string_cmp_str(string_value, test_filetype) != 0) break;
if(uint32_value != test_version) break;
if(!flipper_format_read_string(file, test_string_key, string_value)) break;
if(string_cmp_str(string_value, test_string_updated_data) != 0) break;
if(furi_string_cmp_str(string_value, test_string_updated_data) != 0) break;
if(!flipper_format_get_value_count(file, test_int_key, &uint32_value)) break;
if(uint32_value != COUNT_OF(test_int_updated_data)) break;
@@ -228,7 +247,7 @@ static bool test_read_updated(const char* file_name) {
} while(false);
free(scratchpad);
string_clear(string_value);
furi_string_free(string_value);
flipper_format_free(file);
@@ -401,14 +420,14 @@ static bool test_read_multikey(const char* file_name) {
bool result = false;
FlipperFormat* file = flipper_format_file_alloc(storage);
string_t string_value;
string_init(string_value);
FuriString* string_value;
string_value = furi_string_alloc();
uint32_t uint32_value;
do {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, string_value, &uint32_value)) break;
if(string_cmp_str(string_value, test_filetype) != 0) break;
if(furi_string_cmp_str(string_value, test_filetype) != 0) break;
if(uint32_value != test_version) break;
bool error = false;
@@ -429,7 +448,7 @@ static bool test_read_multikey(const char* file_name) {
result = true;
} while(false);
string_clear(string_value);
furi_string_free(string_value);
flipper_format_free(file);
furi_record_close(RECORD_STORAGE);
@@ -503,6 +522,12 @@ MU_TEST(flipper_format_multikey_test) {
mu_assert(test_read_multikey(TEST_DIR "ff_multiline.test"), "Multikey read test error");
}
MU_TEST(flipper_format_oddities_test) {
mu_assert(
storage_write_string(test_file_oddities, test_data_odd), "Write test error [Oddities]");
mu_assert(test_read(test_file_linux), "Read test error [Oddities]");
}
MU_TEST_SUITE(flipper_format) {
tests_setup();
MU_RUN_TEST(flipper_format_write_test);
@@ -516,6 +541,7 @@ MU_TEST_SUITE(flipper_format) {
MU_RUN_TEST(flipper_format_update_2_test);
MU_RUN_TEST(flipper_format_update_2_result_test);
MU_RUN_TEST(flipper_format_multikey_test);
MU_RUN_TEST(flipper_format_oddities_test);
tests_teardown();
}

View File

@@ -0,0 +1,60 @@
#include <float.h>
#include <float_tools.h>
#include "../minunit.h"
MU_TEST(float_tools_equal_test) {
mu_check(float_is_equal(FLT_MAX, FLT_MAX));
mu_check(float_is_equal(FLT_MIN, FLT_MIN));
mu_check(float_is_equal(-FLT_MAX, -FLT_MAX));
mu_check(float_is_equal(-FLT_MIN, -FLT_MIN));
mu_check(!float_is_equal(FLT_MIN, FLT_MAX));
mu_check(!float_is_equal(-FLT_MIN, FLT_MAX));
mu_check(!float_is_equal(FLT_MIN, -FLT_MAX));
mu_check(!float_is_equal(-FLT_MIN, -FLT_MAX));
const float pi = 3.14159f;
mu_check(float_is_equal(pi, pi));
mu_check(float_is_equal(-pi, -pi));
mu_check(!float_is_equal(pi, -pi));
mu_check(!float_is_equal(-pi, pi));
const float one_third = 1.f / 3.f;
const float one_third_dec = 0.3333333f;
mu_check(one_third != one_third_dec);
mu_check(float_is_equal(one_third, one_third_dec));
const float big_num = 1.e12f;
const float med_num = 95.389f;
const float smol_num = 1.e-12f;
mu_check(float_is_equal(big_num, big_num));
mu_check(float_is_equal(med_num, med_num));
mu_check(float_is_equal(smol_num, smol_num));
mu_check(!float_is_equal(smol_num, big_num));
mu_check(!float_is_equal(med_num, smol_num));
mu_check(!float_is_equal(big_num, med_num));
const float more_than_one = 1.f + FLT_EPSILON;
const float less_than_one = 1.f - FLT_EPSILON;
mu_check(!float_is_equal(more_than_one, less_than_one));
mu_check(!float_is_equal(more_than_one, -less_than_one));
mu_check(!float_is_equal(-more_than_one, less_than_one));
mu_check(!float_is_equal(-more_than_one, -less_than_one));
const float slightly_more_than_one = 1.f + FLT_EPSILON / 2.f;
const float slightly_less_than_one = 1.f - FLT_EPSILON / 2.f;
mu_check(float_is_equal(slightly_more_than_one, slightly_less_than_one));
mu_check(float_is_equal(-slightly_more_than_one, -slightly_less_than_one));
mu_check(!float_is_equal(slightly_more_than_one, -slightly_less_than_one));
mu_check(!float_is_equal(-slightly_more_than_one, slightly_less_than_one));
}
MU_TEST_SUITE(float_tools_suite) {
MU_RUN_TEST(float_tools_equal_test);
}
int run_minunit_test_float_tools() {
MU_RUN_SUITE(float_tools_suite);
return MU_EXIT_CODE;
}

View File

@@ -3,98 +3,37 @@
#include <string.h>
#include <stdbool.h>
// this test is not accurate, but gives a basic understanding
// that memory management is working fine
// do not include memmgr.h here
// we also test that we are linking against stdlib
extern size_t memmgr_get_free_heap(void);
extern size_t memmgr_get_minimum_free_heap(void);
// current heap managment realization consume:
// X bytes after allocate and 0 bytes after allocate and free,
// where X = sizeof(void*) + sizeof(size_t), look to BlockLink_t
const size_t heap_overhead_max_size = sizeof(void*) + sizeof(size_t);
bool heap_equal(size_t heap_size, size_t heap_size_old) {
// heap borders with overhead
const size_t heap_low = heap_size_old - heap_overhead_max_size;
const size_t heap_high = heap_size_old + heap_overhead_max_size;
// not extact, so we must test it against bigger numbers than "overhead size"
const bool result = ((heap_size >= heap_low) && (heap_size <= heap_high));
// debug allocation info
if(!result) {
printf("\n(hl: %zu) <= (p: %zu) <= (hh: %zu)\n", heap_low, heap_size, heap_high);
}
return result;
}
void test_furi_memmgr() {
size_t heap_size = 0;
size_t heap_size_old = 0;
const int alloc_size = 128;
void* ptr = NULL;
void* original_ptr = NULL;
// do not include furi memmgr.h case
#ifdef FURI_MEMMGR_GUARD
mu_fail("do not link against furi memmgr.h");
#endif
void* ptr;
// allocate memory case
heap_size_old = memmgr_get_free_heap();
ptr = malloc(alloc_size);
heap_size = memmgr_get_free_heap();
mu_assert_pointers_not_eq(ptr, NULL);
mu_assert(heap_equal(heap_size, heap_size_old - alloc_size), "allocate failed");
// free memory case
heap_size_old = memmgr_get_free_heap();
ptr = malloc(100);
mu_check(ptr != NULL);
// test that memory is zero-initialized after allocation
for(int i = 0; i < 100; i++) {
mu_assert_int_eq(0, ((uint8_t*)ptr)[i]);
}
free(ptr);
ptr = NULL;
heap_size = memmgr_get_free_heap();
mu_assert(heap_equal(heap_size, heap_size_old + alloc_size), "free failed");
// reallocate memory case
ptr = malloc(100);
memset(ptr, 66, 100);
ptr = realloc(ptr, 200);
mu_check(ptr != NULL);
// get filled array with some data
original_ptr = malloc(alloc_size);
mu_assert_pointers_not_eq(original_ptr, NULL);
for(int i = 0; i < alloc_size; i++) {
*(unsigned char*)(original_ptr + i) = i;
// test that memory is really reallocated
for(int i = 0; i < 100; i++) {
mu_assert_int_eq(66, ((uint8_t*)ptr)[i]);
}
// malloc array and copy data
ptr = malloc(alloc_size);
mu_assert_pointers_not_eq(ptr, NULL);
memcpy(ptr, original_ptr, alloc_size);
// reallocate array
heap_size_old = memmgr_get_free_heap();
ptr = realloc(ptr, alloc_size * 2);
heap_size = memmgr_get_free_heap();
mu_assert(heap_equal(heap_size, heap_size_old - alloc_size), "reallocate failed");
mu_assert_int_eq(memcmp(original_ptr, ptr, alloc_size), 0);
free(original_ptr);
// TODO: fix realloc to copy only old size, and write testcase that leftover of reallocated memory is zero-initialized
free(ptr);
// allocate and zero-initialize array (calloc)
original_ptr = malloc(alloc_size);
mu_assert_pointers_not_eq(original_ptr, NULL);
for(int i = 0; i < alloc_size; i++) {
*(unsigned char*)(original_ptr + i) = 0;
ptr = calloc(100, 2);
mu_check(ptr != NULL);
for(int i = 0; i < 100 * 2; i++) {
mu_assert_int_eq(0, ((uint8_t*)ptr)[i]);
}
heap_size_old = memmgr_get_free_heap();
ptr = calloc(1, alloc_size);
heap_size = memmgr_get_free_heap();
mu_assert(heap_equal(heap_size, heap_size_old - alloc_size), "callocate failed");
mu_assert_int_eq(memcmp(original_ptr, ptr, alloc_size), 0);
free(original_ptr);
free(ptr);
}

View File

@@ -0,0 +1,469 @@
#include <furi.h>
#include "../minunit.h"
static void test_setup(void) {
}
static void test_teardown(void) {
}
static FuriString* furi_string_alloc_vprintf_test(const char format[], ...) {
va_list args;
va_start(args, format);
FuriString* string = furi_string_alloc_vprintf(format, args);
va_end(args);
return string;
}
MU_TEST(mu_test_furi_string_alloc_free) {
FuriString* tmp;
FuriString* string;
// test alloc and free
string = furi_string_alloc();
mu_check(string != NULL);
mu_check(furi_string_empty(string));
furi_string_free(string);
// test furi_string_alloc_set_str and free
string = furi_string_alloc_set_str("test");
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "test") == 0);
furi_string_free(string);
// test furi_string_alloc_set and free
tmp = furi_string_alloc_set("more");
string = furi_string_alloc_set(tmp);
furi_string_free(tmp);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "more") == 0);
furi_string_free(string);
// test alloc_printf and free
string = furi_string_alloc_printf("test %d %s %c 0x%02x", 1, "two", '3', 0x04);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "test 1 two 3 0x04") == 0);
furi_string_free(string);
// test alloc_vprintf and free
string = furi_string_alloc_vprintf_test("test %d %s %c 0x%02x", 4, "five", '6', 0x07);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "test 4 five 6 0x07") == 0);
furi_string_free(string);
// test alloc_move and free
tmp = furi_string_alloc_set("move");
string = furi_string_alloc_move(tmp);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "move") == 0);
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_mem) {
FuriString* string = furi_string_alloc_set("test");
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
// TODO: how to test furi_string_reserve?
// test furi_string_reset
furi_string_reset(string);
mu_check(furi_string_empty(string));
// test furi_string_swap
furi_string_set(string, "test");
FuriString* swap_string = furi_string_alloc_set("swap");
furi_string_swap(string, swap_string);
mu_check(furi_string_cmp(string, "swap") == 0);
mu_check(furi_string_cmp(swap_string, "test") == 0);
furi_string_free(swap_string);
// test furi_string_move
FuriString* move_string = furi_string_alloc_set("move");
furi_string_move(string, move_string);
mu_check(furi_string_cmp(string, "move") == 0);
// move_string is now empty
// and tested by leaked memory check at the end of the tests
furi_string_set(string, "abracadabra");
// test furi_string_hash
mu_assert_int_eq(0xc3bc16d7, furi_string_hash(string));
// test furi_string_size
mu_assert_int_eq(11, furi_string_size(string));
// test furi_string_empty
mu_check(!furi_string_empty(string));
furi_string_reset(string);
mu_check(furi_string_empty(string));
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_getters) {
FuriString* string = furi_string_alloc_set("test");
// test furi_string_get_char
mu_check(furi_string_get_char(string, 0) == 't');
mu_check(furi_string_get_char(string, 1) == 'e');
mu_check(furi_string_get_char(string, 2) == 's');
mu_check(furi_string_get_char(string, 3) == 't');
// test furi_string_get_cstr
mu_assert_string_eq("test", furi_string_get_cstr(string));
furi_string_free(string);
}
static FuriString* furi_string_vprintf_test(FuriString* string, const char format[], ...) {
va_list args;
va_start(args, format);
furi_string_vprintf(string, format, args);
va_end(args);
return string;
}
MU_TEST(mu_test_furi_string_setters) {
FuriString* tmp;
FuriString* string = furi_string_alloc();
// test furi_string_set_str
furi_string_set_str(string, "test");
mu_assert_string_eq("test", furi_string_get_cstr(string));
// test furi_string_set
tmp = furi_string_alloc_set("more");
furi_string_set(string, tmp);
furi_string_free(tmp);
mu_assert_string_eq("more", furi_string_get_cstr(string));
// test furi_string_set_strn
furi_string_set_strn(string, "test", 2);
mu_assert_string_eq("te", furi_string_get_cstr(string));
// test furi_string_set_char
furi_string_set_char(string, 0, 'a');
furi_string_set_char(string, 1, 'b');
mu_assert_string_eq("ab", furi_string_get_cstr(string));
// test furi_string_set_n
tmp = furi_string_alloc_set("dodecahedron");
furi_string_set_n(string, tmp, 4, 5);
furi_string_free(tmp);
mu_assert_string_eq("cahed", furi_string_get_cstr(string));
// test furi_string_printf
furi_string_printf(string, "test %d %s %c 0x%02x", 1, "two", '3', 0x04);
mu_assert_string_eq("test 1 two 3 0x04", furi_string_get_cstr(string));
// test furi_string_vprintf
furi_string_vprintf_test(string, "test %d %s %c 0x%02x", 4, "five", '6', 0x07);
mu_assert_string_eq("test 4 five 6 0x07", furi_string_get_cstr(string));
furi_string_free(string);
}
static FuriString* furi_string_cat_vprintf_test(FuriString* string, const char format[], ...) {
va_list args;
va_start(args, format);
furi_string_cat_vprintf(string, format, args);
va_end(args);
return string;
}
MU_TEST(mu_test_furi_string_appends) {
FuriString* tmp;
FuriString* string = furi_string_alloc();
// test furi_string_push_back
furi_string_push_back(string, 't');
furi_string_push_back(string, 'e');
furi_string_push_back(string, 's');
furi_string_push_back(string, 't');
mu_assert_string_eq("test", furi_string_get_cstr(string));
furi_string_push_back(string, '!');
mu_assert_string_eq("test!", furi_string_get_cstr(string));
// test furi_string_cat_str
furi_string_cat_str(string, "test");
mu_assert_string_eq("test!test", furi_string_get_cstr(string));
// test furi_string_cat
tmp = furi_string_alloc_set("more");
furi_string_cat(string, tmp);
furi_string_free(tmp);
mu_assert_string_eq("test!testmore", furi_string_get_cstr(string));
// test furi_string_cat_printf
furi_string_cat_printf(string, "test %d %s %c 0x%02x", 1, "two", '3', 0x04);
mu_assert_string_eq("test!testmoretest 1 two 3 0x04", furi_string_get_cstr(string));
// test furi_string_cat_vprintf
furi_string_cat_vprintf_test(string, "test %d %s %c 0x%02x", 4, "five", '6', 0x07);
mu_assert_string_eq(
"test!testmoretest 1 two 3 0x04test 4 five 6 0x07", furi_string_get_cstr(string));
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_compare) {
FuriString* string_1 = furi_string_alloc_set("string_1");
FuriString* string_2 = furi_string_alloc_set("string_2");
// test furi_string_cmp
mu_assert_int_eq(0, furi_string_cmp(string_1, string_1));
mu_assert_int_eq(0, furi_string_cmp(string_2, string_2));
mu_assert_int_eq(-1, furi_string_cmp(string_1, string_2));
mu_assert_int_eq(1, furi_string_cmp(string_2, string_1));
// test furi_string_cmp_str
mu_assert_int_eq(0, furi_string_cmp_str(string_1, "string_1"));
mu_assert_int_eq(0, furi_string_cmp_str(string_2, "string_2"));
mu_assert_int_eq(-1, furi_string_cmp_str(string_1, "string_2"));
mu_assert_int_eq(1, furi_string_cmp_str(string_2, "string_1"));
// test furi_string_cmpi
furi_string_set(string_1, "string");
furi_string_set(string_2, "StrIng");
mu_assert_int_eq(0, furi_string_cmpi(string_1, string_1));
mu_assert_int_eq(0, furi_string_cmpi(string_2, string_2));
mu_assert_int_eq(0, furi_string_cmpi(string_1, string_2));
mu_assert_int_eq(0, furi_string_cmpi(string_2, string_1));
furi_string_set(string_1, "string_1");
furi_string_set(string_2, "StrIng_2");
mu_assert_int_eq(32, furi_string_cmp(string_1, string_2));
mu_assert_int_eq(-32, furi_string_cmp(string_2, string_1));
mu_assert_int_eq(-1, furi_string_cmpi(string_1, string_2));
mu_assert_int_eq(1, furi_string_cmpi(string_2, string_1));
// test furi_string_cmpi_str
furi_string_set(string_1, "string");
mu_assert_int_eq(0, furi_string_cmp_str(string_1, "string"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "String"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STring"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRing"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRIng"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRINg"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRING"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "string"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "String"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STring"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRing"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRIng"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRINg"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRING"));
furi_string_free(string_1);
furi_string_free(string_2);
}
MU_TEST(mu_test_furi_string_search) {
// 012345678901234567
FuriString* haystack = furi_string_alloc_set("test321test123test");
FuriString* needle = furi_string_alloc_set("test");
// test furi_string_search
mu_assert_int_eq(0, furi_string_search(haystack, needle));
mu_assert_int_eq(7, furi_string_search(haystack, needle, 1));
mu_assert_int_eq(14, furi_string_search(haystack, needle, 8));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search(haystack, needle, 15));
FuriString* tmp = furi_string_alloc_set("testnone");
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search(haystack, tmp));
furi_string_free(tmp);
// test furi_string_search_str
mu_assert_int_eq(0, furi_string_search_str(haystack, "test"));
mu_assert_int_eq(7, furi_string_search_str(haystack, "test", 1));
mu_assert_int_eq(14, furi_string_search_str(haystack, "test", 8));
mu_assert_int_eq(4, furi_string_search_str(haystack, "321"));
mu_assert_int_eq(11, furi_string_search_str(haystack, "123"));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_str(haystack, "testnone"));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_str(haystack, "test", 15));
// test furi_string_search_char
mu_assert_int_eq(0, furi_string_search_char(haystack, 't'));
mu_assert_int_eq(1, furi_string_search_char(haystack, 'e'));
mu_assert_int_eq(2, furi_string_search_char(haystack, 's'));
mu_assert_int_eq(3, furi_string_search_char(haystack, 't', 1));
mu_assert_int_eq(7, furi_string_search_char(haystack, 't', 4));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_char(haystack, 'x'));
// test furi_string_search_rchar
mu_assert_int_eq(17, furi_string_search_rchar(haystack, 't'));
mu_assert_int_eq(15, furi_string_search_rchar(haystack, 'e'));
mu_assert_int_eq(16, furi_string_search_rchar(haystack, 's'));
mu_assert_int_eq(13, furi_string_search_rchar(haystack, '3'));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_rchar(haystack, '3', 14));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_rchar(haystack, 'x'));
furi_string_free(haystack);
furi_string_free(needle);
}
MU_TEST(mu_test_furi_string_equality) {
FuriString* string = furi_string_alloc_set("test");
FuriString* string_eq = furi_string_alloc_set("test");
FuriString* string_neq = furi_string_alloc_set("test2");
// test furi_string_equal
mu_check(furi_string_equal(string, string_eq));
mu_check(!furi_string_equal(string, string_neq));
// test furi_string_equal_str
mu_check(furi_string_equal_str(string, "test"));
mu_check(!furi_string_equal_str(string, "test2"));
mu_check(furi_string_equal_str(string_neq, "test2"));
mu_check(!furi_string_equal_str(string_neq, "test"));
furi_string_free(string);
furi_string_free(string_eq);
furi_string_free(string_neq);
}
MU_TEST(mu_test_furi_string_replace) {
FuriString* needle = furi_string_alloc_set("test");
FuriString* replace = furi_string_alloc_set("replace");
FuriString* string = furi_string_alloc_set("test123test");
// test furi_string_replace_at
furi_string_replace_at(string, 4, 3, "!biglongword!");
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
// test furi_string_replace
mu_assert_int_eq(17, furi_string_replace(string, needle, replace, 1));
mu_assert_string_eq("test!biglongword!replace", furi_string_get_cstr(string));
mu_assert_int_eq(0, furi_string_replace(string, needle, replace));
mu_assert_string_eq("replace!biglongword!replace", furi_string_get_cstr(string));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_replace(string, needle, replace));
mu_assert_string_eq("replace!biglongword!replace", furi_string_get_cstr(string));
// test furi_string_replace_str
mu_assert_int_eq(20, furi_string_replace_str(string, "replace", "test", 1));
mu_assert_string_eq("replace!biglongword!test", furi_string_get_cstr(string));
mu_assert_int_eq(0, furi_string_replace_str(string, "replace", "test"));
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_replace_str(string, "replace", "test"));
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
// test furi_string_replace_all
furi_string_replace_all(string, needle, replace);
mu_assert_string_eq("replace!biglongword!replace", furi_string_get_cstr(string));
// test furi_string_replace_all_str
furi_string_replace_all_str(string, "replace", "test");
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
furi_string_free(string);
furi_string_free(needle);
furi_string_free(replace);
}
MU_TEST(mu_test_furi_string_start_end) {
FuriString* string = furi_string_alloc_set("start_end");
FuriString* start = furi_string_alloc_set("start");
FuriString* end = furi_string_alloc_set("end");
// test furi_string_start_with
mu_check(furi_string_start_with(string, start));
mu_check(!furi_string_start_with(string, end));
// test furi_string_start_with_str
mu_check(furi_string_start_with_str(string, "start"));
mu_check(!furi_string_start_with_str(string, "end"));
// test furi_string_end_with
mu_check(furi_string_end_with(string, end));
mu_check(!furi_string_end_with(string, start));
// test furi_string_end_with_str
mu_check(furi_string_end_with_str(string, "end"));
mu_check(!furi_string_end_with_str(string, "start"));
furi_string_free(string);
furi_string_free(start);
furi_string_free(end);
}
MU_TEST(mu_test_furi_string_trim) {
FuriString* string = furi_string_alloc_set("biglongstring");
// test furi_string_left
furi_string_left(string, 7);
mu_assert_string_eq("biglong", furi_string_get_cstr(string));
// test furi_string_right
furi_string_right(string, 3);
mu_assert_string_eq("long", furi_string_get_cstr(string));
// test furi_string_mid
furi_string_mid(string, 1, 2);
mu_assert_string_eq("on", furi_string_get_cstr(string));
// test furi_string_trim
furi_string_set(string, " \n\r\tbiglongstring \n\r\t ");
furi_string_trim(string);
mu_assert_string_eq("biglongstring", furi_string_get_cstr(string));
furi_string_set(string, "aaaabaaaabbaaabaaaabbtestaaaaaabbaaabaababaa");
furi_string_trim(string, "ab");
mu_assert_string_eq("test", furi_string_get_cstr(string));
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_utf8) {
FuriString* utf8_string = furi_string_alloc_set("イルカ");
// test furi_string_utf8_length
mu_assert_int_eq(9, furi_string_size(utf8_string));
mu_assert_int_eq(3, furi_string_utf8_length(utf8_string));
// test furi_string_utf8_decode
const uint8_t dolphin_emoji_array[4] = {0xF0, 0x9F, 0x90, 0xAC};
FuriStringUTF8State state = FuriStringUTF8StateStarting;
FuriStringUnicodeValue value = 0;
furi_string_utf8_decode(dolphin_emoji_array[0], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateDecoding3, state);
furi_string_utf8_decode(dolphin_emoji_array[1], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateDecoding2, state);
furi_string_utf8_decode(dolphin_emoji_array[2], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateDecoding1, state);
furi_string_utf8_decode(dolphin_emoji_array[3], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateStarting, state);
mu_assert_int_eq(0x1F42C, value);
// test furi_string_utf8_push
furi_string_set(utf8_string, "");
furi_string_utf8_push(utf8_string, value);
mu_assert_string_eq("🐬", furi_string_get_cstr(utf8_string));
furi_string_free(utf8_string);
}
MU_TEST_SUITE(test_suite) {
MU_SUITE_CONFIGURE(&test_setup, &test_teardown);
MU_RUN_TEST(mu_test_furi_string_alloc_free);
MU_RUN_TEST(mu_test_furi_string_mem);
MU_RUN_TEST(mu_test_furi_string_getters);
MU_RUN_TEST(mu_test_furi_string_setters);
MU_RUN_TEST(mu_test_furi_string_appends);
MU_RUN_TEST(mu_test_furi_string_compare);
MU_RUN_TEST(mu_test_furi_string_search);
MU_RUN_TEST(mu_test_furi_string_equality);
MU_RUN_TEST(mu_test_furi_string_replace);
MU_RUN_TEST(mu_test_furi_string_start_end);
MU_RUN_TEST(mu_test_furi_string_trim);
MU_RUN_TEST(mu_test_furi_string_utf8);
}
int run_minunit_test_furi_string() {
MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE;
}

View File

@@ -0,0 +1,116 @@
#include <stdio.h>
#include <furi.h>
#include <furi_hal.h>
#include <lp5562_reg.h>
#include "../minunit.h"
#define DATA_SIZE 4
static void furi_hal_i2c_int_setup() {
furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
}
static void furi_hal_i2c_int_teardown() {
furi_hal_i2c_release(&furi_hal_i2c_handle_power);
}
MU_TEST(furi_hal_i2c_int_1b) {
bool ret = false;
uint8_t data_one = 0;
// 1 byte: read, write, read
ret = furi_hal_i2c_read_reg_8(
&furi_hal_i2c_handle_power,
LP5562_ADDRESS,
LP5562_CHANNEL_BLUE_CURRENT_REGISTER,
&data_one,
LP5562_I2C_TIMEOUT);
mu_assert(ret, "0 read_reg_8 failed");
mu_assert(data_one != 0, "0 invalid data");
ret = furi_hal_i2c_write_reg_8(
&furi_hal_i2c_handle_power,
LP5562_ADDRESS,
LP5562_CHANNEL_BLUE_CURRENT_REGISTER,
data_one,
LP5562_I2C_TIMEOUT);
mu_assert(ret, "1 write_reg_8 failed");
ret = furi_hal_i2c_read_reg_8(
&furi_hal_i2c_handle_power,
LP5562_ADDRESS,
LP5562_CHANNEL_BLUE_CURRENT_REGISTER,
&data_one,
LP5562_I2C_TIMEOUT);
mu_assert(ret, "2 read_reg_8 failed");
mu_assert(data_one != 0, "2 invalid data");
}
MU_TEST(furi_hal_i2c_int_3b) {
bool ret = false;
uint8_t data_many[DATA_SIZE] = {0};
// 3 byte: read, write, read
data_many[0] = LP5562_CHANNEL_BLUE_CURRENT_REGISTER;
ret = furi_hal_i2c_tx(
&furi_hal_i2c_handle_power, LP5562_ADDRESS, data_many, 1, LP5562_I2C_TIMEOUT);
mu_assert(ret, "3 tx failed");
ret = furi_hal_i2c_rx(
&furi_hal_i2c_handle_power,
LP5562_ADDRESS,
data_many + 1,
DATA_SIZE - 1,
LP5562_I2C_TIMEOUT);
mu_assert(ret, "4 rx failed");
for(size_t i = 0; i < DATA_SIZE; i++) mu_assert(data_many[i] != 0, "4 invalid data_many");
ret = furi_hal_i2c_tx(
&furi_hal_i2c_handle_power, LP5562_ADDRESS, data_many, DATA_SIZE, LP5562_I2C_TIMEOUT);
mu_assert(ret, "5 tx failed");
ret = furi_hal_i2c_tx(
&furi_hal_i2c_handle_power, LP5562_ADDRESS, data_many, 1, LP5562_I2C_TIMEOUT);
mu_assert(ret, "6 tx failed");
ret = furi_hal_i2c_rx(
&furi_hal_i2c_handle_power,
LP5562_ADDRESS,
data_many + 1,
DATA_SIZE - 1,
LP5562_I2C_TIMEOUT);
mu_assert(ret, "7 rx failed");
for(size_t i = 0; i < DATA_SIZE; i++) mu_assert(data_many[i] != 0, "7 invalid data_many");
}
MU_TEST(furi_hal_i2c_int_1b_fail) {
bool ret = false;
uint8_t data_one = 0;
// 1 byte: fail, read, fail, write, fail, read
data_one = 0;
ret = furi_hal_i2c_read_reg_8(
&furi_hal_i2c_handle_power,
LP5562_ADDRESS + 0x10,
LP5562_CHANNEL_BLUE_CURRENT_REGISTER,
&data_one,
LP5562_I2C_TIMEOUT);
mu_assert(!ret, "8 read_reg_8 failed");
mu_assert(data_one == 0, "8 invalid data");
ret = furi_hal_i2c_read_reg_8(
&furi_hal_i2c_handle_power,
LP5562_ADDRESS,
LP5562_CHANNEL_BLUE_CURRENT_REGISTER,
&data_one,
LP5562_I2C_TIMEOUT);
mu_assert(ret, "9 read_reg_8 failed");
mu_assert(data_one != 0, "9 invalid data");
}
MU_TEST_SUITE(furi_hal_i2c_int_suite) {
MU_SUITE_CONFIGURE(&furi_hal_i2c_int_setup, &furi_hal_i2c_int_teardown);
MU_RUN_TEST(furi_hal_i2c_int_1b);
MU_RUN_TEST(furi_hal_i2c_int_3b);
MU_RUN_TEST(furi_hal_i2c_int_1b_fail);
}
int run_minunit_test_furi_hal() {
MU_RUN_SUITE(furi_hal_i2c_int_suite);
return MU_EXIT_CODE;
}

View File

@@ -11,7 +11,7 @@
typedef struct {
InfraredDecoderHandler* decoder_handler;
InfraredEncoderHandler* encoder_handler;
string_t file_path;
FuriString* file_path;
FlipperFormat* ff;
} InfraredTest;
@@ -23,7 +23,7 @@ static void infrared_test_alloc() {
test->decoder_handler = infrared_alloc_decoder();
test->encoder_handler = infrared_alloc_encoder();
test->ff = flipper_format_buffered_file_alloc(storage);
string_init(test->file_path);
test->file_path = furi_string_alloc();
}
static void infrared_test_free() {
@@ -31,18 +31,18 @@ static void infrared_test_free() {
infrared_free_decoder(test->decoder_handler);
infrared_free_encoder(test->encoder_handler);
flipper_format_free(test->ff);
string_clear(test->file_path);
furi_string_free(test->file_path);
furi_record_close(RECORD_STORAGE);
free(test);
test = NULL;
}
static bool infrared_test_prepare_file(const char* protocol_name) {
string_t file_type;
string_init(file_type);
FuriString* file_type;
file_type = furi_string_alloc();
bool success = false;
string_printf(
furi_string_printf(
test->file_path,
"%s%s%s%s",
IR_TEST_FILES_DIR,
@@ -52,14 +52,15 @@ static bool infrared_test_prepare_file(const char* protocol_name) {
do {
uint32_t format_version;
if(!flipper_format_buffered_file_open_existing(test->ff, string_get_cstr(test->file_path)))
if(!flipper_format_buffered_file_open_existing(
test->ff, furi_string_get_cstr(test->file_path)))
break;
if(!flipper_format_read_header(test->ff, file_type, &format_version)) break;
if(string_cmp_str(file_type, "IR tests file") || format_version != 1) break;
if(furi_string_cmp_str(file_type, "IR tests file") || format_version != 1) break;
success = true;
} while(false);
string_clear(file_type);
furi_string_free(file_type);
return success;
}
@@ -68,18 +69,18 @@ static bool infrared_test_load_raw_signal(
const char* signal_name,
uint32_t** timings,
uint32_t* timings_count) {
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
bool success = false;
do {
bool is_name_found = false;
for(; !is_name_found && flipper_format_read_string(ff, "name", buf);
is_name_found = !string_cmp_str(buf, signal_name))
is_name_found = !furi_string_cmp(buf, signal_name))
;
if(!is_name_found) break;
if(!flipper_format_read_string(ff, "type", buf) || string_cmp_str(buf, "raw")) break;
if(!flipper_format_read_string(ff, "type", buf) || furi_string_cmp_str(buf, "raw")) break;
if(!flipper_format_get_value_count(ff, "data", timings_count)) break;
if(!*timings_count) break;
@@ -91,18 +92,18 @@ static bool infrared_test_load_raw_signal(
success = true;
} while(false);
string_clear(buf);
furi_string_free(buf);
return success;
}
static bool infrared_test_read_message(FlipperFormat* ff, InfraredMessage* message) {
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
bool success = false;
do {
if(!flipper_format_read_string(ff, "protocol", buf)) break;
message->protocol = infrared_get_protocol_by_name(string_get_cstr(buf));
message->protocol = infrared_get_protocol_by_name(furi_string_get_cstr(buf));
if(!infrared_is_protocol_valid(message->protocol)) break;
if(!flipper_format_read_hex(ff, "address", (uint8_t*)&message->address, sizeof(uint32_t)))
break;
@@ -112,7 +113,7 @@ static bool infrared_test_read_message(FlipperFormat* ff, InfraredMessage* messa
success = true;
} while(false);
string_clear(buf);
furi_string_free(buf);
return success;
}
@@ -121,18 +122,19 @@ static bool infrared_test_load_messages(
const char* signal_name,
InfraredMessage** messages,
uint32_t* messages_count) {
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
bool success = false;
do {
bool is_name_found = false;
for(; !is_name_found && flipper_format_read_string(ff, "name", buf);
is_name_found = !string_cmp_str(buf, signal_name))
is_name_found = !furi_string_cmp(buf, signal_name))
;
if(!is_name_found) break;
if(!flipper_format_read_string(ff, "type", buf) || string_cmp_str(buf, "parsed_array"))
if(!flipper_format_read_string(ff, "type", buf) ||
furi_string_cmp_str(buf, "parsed_array"))
break;
if(!flipper_format_read_uint32(ff, "count", messages_count, 1)) break;
if(!*messages_count) break;
@@ -151,7 +153,7 @@ static bool infrared_test_load_messages(
success = true;
} while(false);
string_clear(buf);
furi_string_free(buf);
return success;
}
@@ -213,26 +215,26 @@ static void infrared_test_run_encoder(InfraredProtocol protocol, uint32_t test_i
InfraredMessage* input_messages;
uint32_t input_messages_count;
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
const char* protocol_name = infrared_get_protocol_name(protocol);
mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file");
string_printf(buf, "encoder_input%d", test_index);
furi_string_printf(buf, "encoder_input%ld", test_index);
mu_assert(
infrared_test_load_messages(
test->ff, string_get_cstr(buf), &input_messages, &input_messages_count),
test->ff, furi_string_get_cstr(buf), &input_messages, &input_messages_count),
"Failed to load messages from file");
string_printf(buf, "encoder_expected%d", test_index);
furi_string_printf(buf, "encoder_expected%ld", test_index);
mu_assert(
infrared_test_load_raw_signal(
test->ff, string_get_cstr(buf), &expected_timings, &expected_timings_count),
test->ff, furi_string_get_cstr(buf), &expected_timings, &expected_timings_count),
"Failed to load raw signal from file");
flipper_format_buffered_file_close(test->ff);
string_clear(buf);
furi_string_free(buf);
uint32_t j = 0;
timings = malloc(sizeof(uint32_t) * timings_count);
@@ -267,22 +269,22 @@ static void infrared_test_run_encoder_decoder(InfraredProtocol protocol, uint32_
uint32_t input_messages_count;
bool level = false;
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
timings = malloc(sizeof(uint32_t) * timings_count);
const char* protocol_name = infrared_get_protocol_name(protocol);
mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file");
string_printf(buf, "encoder_decoder_input%d", test_index);
furi_string_printf(buf, "encoder_decoder_input%ld", test_index);
mu_assert(
infrared_test_load_messages(
test->ff, string_get_cstr(buf), &input_messages, &input_messages_count),
test->ff, furi_string_get_cstr(buf), &input_messages, &input_messages_count),
"Failed to load messages from file");
flipper_format_buffered_file_close(test->ff);
string_clear(buf);
furi_string_free(buf);
for(uint32_t message_counter = 0; message_counter < input_messages_count; ++message_counter) {
const InfraredMessage* message_encoded = &input_messages[message_counter];
@@ -327,25 +329,27 @@ static void infrared_test_run_decoder(InfraredProtocol protocol, uint32_t test_i
InfraredMessage* messages;
uint32_t messages_count;
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
mu_assert(
infrared_test_prepare_file(infrared_get_protocol_name(protocol)),
"Failed to prepare test file");
string_printf(buf, "decoder_input%d", test_index);
furi_string_printf(buf, "decoder_input%ld", test_index);
mu_assert(
infrared_test_load_raw_signal(test->ff, string_get_cstr(buf), &timings, &timings_count),
infrared_test_load_raw_signal(
test->ff, furi_string_get_cstr(buf), &timings, &timings_count),
"Failed to load raw signal from file");
string_printf(buf, "decoder_expected%d", test_index);
furi_string_printf(buf, "decoder_expected%ld", test_index);
mu_assert(
infrared_test_load_messages(test->ff, string_get_cstr(buf), &messages, &messages_count),
infrared_test_load_messages(
test->ff, furi_string_get_cstr(buf), &messages, &messages_count),
"Failed to load messages from file");
flipper_format_buffered_file_close(test->ff);
string_clear(buf);
furi_string_free(buf);
InfraredMessage message_decoded_check_local;
bool level = 0;
@@ -420,6 +424,7 @@ MU_TEST(infrared_test_decoder_mixed) {
infrared_test_run_decoder(InfraredProtocolRC5, 5);
infrared_test_run_decoder(InfraredProtocolSamsung32, 1);
infrared_test_run_decoder(InfraredProtocolSIRC, 3);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1);
}
MU_TEST(infrared_test_decoder_nec) {
@@ -485,6 +490,15 @@ MU_TEST(infrared_test_encoder_rc6) {
infrared_test_run_encoder(InfraredProtocolRC6, 1);
}
MU_TEST(infrared_test_decoder_kaseikyo) {
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 2);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 3);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 4);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 5);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 6);
}
MU_TEST(infrared_test_encoder_decoder_all) {
infrared_test_run_encoder_decoder(InfraredProtocolNEC, 1);
infrared_test_run_encoder_decoder(InfraredProtocolNECext, 1);
@@ -494,6 +508,7 @@ MU_TEST(infrared_test_encoder_decoder_all) {
infrared_test_run_encoder_decoder(InfraredProtocolRC6, 1);
infrared_test_run_encoder_decoder(InfraredProtocolRC5, 1);
infrared_test_run_encoder_decoder(InfraredProtocolSIRC, 1);
infrared_test_run_encoder_decoder(InfraredProtocolKaseikyo, 1);
}
MU_TEST_SUITE(infrared_test) {
@@ -511,6 +526,7 @@ MU_TEST_SUITE(infrared_test) {
MU_RUN_TEST(infrared_test_decoder_nec);
MU_RUN_TEST(infrared_test_decoder_samsung32);
MU_RUN_TEST(infrared_test_decoder_necext1);
MU_RUN_TEST(infrared_test_decoder_kaseikyo);
MU_RUN_TEST(infrared_test_decoder_mixed);
MU_RUN_TEST(infrared_test_encoder_decoder_all);
}

View File

@@ -0,0 +1,75 @@
#include <furi.c>
#include "../minunit.h"
#include <update_util/resources/manifest.h>
#define TAG "Manifest"
MU_TEST(manifest_type_test) {
mu_assert(ResourceManifestEntryTypeUnknown == 0, "ResourceManifestEntryTypeUnknown != 0\r\n");
mu_assert(ResourceManifestEntryTypeVersion == 1, "ResourceManifestEntryTypeVersion != 1\r\n");
mu_assert(
ResourceManifestEntryTypeTimestamp == 2, "ResourceManifestEntryTypeTimestamp != 2\r\n");
mu_assert(
ResourceManifestEntryTypeDirectory == 3, "ResourceManifestEntryTypeDirectory != 3\r\n");
mu_assert(ResourceManifestEntryTypeFile == 4, "ResourceManifestEntryTypeFile != 4\r\n");
}
MU_TEST(manifest_iteration_test) {
bool result = true;
size_t counters[5] = {0};
Storage* storage = furi_record_open(RECORD_STORAGE);
ResourceManifestReader* manifest_reader = resource_manifest_reader_alloc(storage);
do {
// Open manifest file
if(!resource_manifest_reader_open(manifest_reader, EXT_PATH("unit_tests/Manifest"))) {
result = false;
break;
}
// Iterate forward
ResourceManifestEntry* entry_ptr = NULL;
while((entry_ptr = resource_manifest_reader_next(manifest_reader))) {
FURI_LOG_D(TAG, "F:%u:%s", entry_ptr->type, furi_string_get_cstr(entry_ptr->name));
if(entry_ptr->type > 4) {
mu_fail("entry_ptr->type > 4\r\n");
result = false;
break;
}
counters[entry_ptr->type]++;
}
if(!result) break;
// Iterate backward
while((entry_ptr = resource_manifest_reader_previous(manifest_reader))) {
FURI_LOG_D(TAG, "B:%u:%s", entry_ptr->type, furi_string_get_cstr(entry_ptr->name));
if(entry_ptr->type > 4) {
mu_fail("entry_ptr->type > 4\r\n");
result = false;
break;
}
counters[entry_ptr->type]--;
}
} while(false);
resource_manifest_reader_free(manifest_reader);
furi_record_close(RECORD_STORAGE);
mu_assert(counters[ResourceManifestEntryTypeUnknown] == 0, "Unknown counter != 0\r\n");
mu_assert(counters[ResourceManifestEntryTypeVersion] == 0, "Version counter != 0\r\n");
mu_assert(counters[ResourceManifestEntryTypeTimestamp] == 0, "Timestamp counter != 0\r\n");
mu_assert(counters[ResourceManifestEntryTypeDirectory] == 0, "Directory counter != 0\r\n");
mu_assert(counters[ResourceManifestEntryTypeFile] == 0, "File counter != 0\r\n");
mu_assert(result, "Manifest forward iterate failed\r\n");
}
MU_TEST_SUITE(manifest_suite) {
MU_RUN_TEST(manifest_type_test);
MU_RUN_TEST(manifest_iteration_test);
}
int run_minunit_test_manifest() {
MU_RUN_SUITE(manifest_suite);
return MU_EXIT_CODE;
}

View File

@@ -316,7 +316,7 @@ void minunit_print_fail(const char* error);
MU__SAFE_BLOCK( \
double minunit_tmp_e; double minunit_tmp_r; minunit_assert++; minunit_tmp_e = (expected); \
minunit_tmp_r = (result); \
if(fabs(minunit_tmp_e - minunit_tmp_r) > MINUNIT_EPSILON) { \
if(fabs(minunit_tmp_e - minunit_tmp_r) > (double)MINUNIT_EPSILON) { \
int minunit_significant_figures = 1 - log10(MINUNIT_EPSILON); \
snprintf( \
minunit_last_message, \

View File

@@ -5,6 +5,8 @@
#include <lib/nfc/protocols/nfca.h>
#include <lib/nfc/helpers/mf_classic_dict.h>
#include <lib/digital_signal/digital_signal.h>
#include <lib/nfc/nfc_device.h>
#include <lib/nfc/helpers/nfc_generators.h>
#include <lib/flipper_format/flipper_format_i.h>
#include <lib/toolbox/stream/file_stream.h>
@@ -16,6 +18,8 @@
#define NFC_TEST_RESOURCES_DIR EXT_PATH("unit_tests/nfc/")
#define NFC_TEST_SIGNAL_SHORT_FILE "nfc_nfca_signal_short.nfc"
#define NFC_TEST_SIGNAL_LONG_FILE "nfc_nfca_signal_long.nfc"
#define NFC_TEST_DICT_PATH EXT_PATH("unit_tests/mf_classic_dict.nfc")
#define NFC_TEST_NFC_DEV_PATH EXT_PATH("unit_tests/nfc/nfc_dev_test.nfc")
static const char* nfc_test_file_type = "Flipper NFC test";
static const uint32_t nfc_test_file_version = 1;
@@ -53,14 +57,15 @@ static bool nfc_test_read_signal_from_file(const char* file_name) {
bool success = false;
FlipperFormat* file = flipper_format_file_alloc(nfc_test->storage);
string_t file_type;
string_init(file_type);
FuriString* file_type;
file_type = furi_string_alloc();
uint32_t file_version = 0;
do {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, file_type, &file_version)) break;
if(string_cmp_str(file_type, nfc_test_file_type) || file_version != nfc_test_file_version)
if(furi_string_cmp_str(file_type, nfc_test_file_type) ||
file_version != nfc_test_file_version)
break;
if(!flipper_format_read_uint32(file, "Data length", &nfc_test->test_data_len, 1)) break;
if(nfc_test->test_data_len > NFC_TEST_DATA_MAX_LEN) break;
@@ -76,7 +81,7 @@ static bool nfc_test_read_signal_from_file(const char* file_name) {
success = true;
} while(false);
string_clear(file_type);
furi_string_free(file_type);
flipper_format_free(file);
return success;
@@ -97,7 +102,10 @@ static bool nfc_test_digital_signal_test_encode(
do {
// Read test data
if(!nfc_test_read_signal_from_file(file_name)) break;
if(!nfc_test_read_signal_from_file(file_name)) {
FURI_LOG_E(TAG, "Failed to read signal from file");
break;
}
// Encode signal
FURI_CRITICAL_ENTER();
@@ -111,7 +119,7 @@ static bool nfc_test_digital_signal_test_encode(
// Check timings
if(time > encode_max_time) {
FURI_LOG_E(
TAG, "Encoding time: %d us while accepted value: %d us", time, encode_max_time);
TAG, "Encoding time: %ld us while accepted value: %ld us", time, encode_max_time);
break;
}
@@ -131,7 +139,7 @@ static bool nfc_test_digital_signal_test_encode(
ref_timings_sum += ref[i];
if(timings_diff > timing_tolerance) {
FURI_LOG_E(
TAG, "Too big differece in %d timings. Ref: %d, DUT: %d", i, ref[i], dut[i]);
TAG, "Too big difference in %d timings. Ref: %ld, DUT: %ld", i, ref[i], dut[i]);
timing_check_success = false;
break;
}
@@ -142,16 +150,16 @@ static bool nfc_test_digital_signal_test_encode(
if(sum_diff > timings_sum_tolerance) {
FURI_LOG_E(
TAG,
"Too big difference in timings sum. Ref: %d, DUT: %d",
"Too big difference in timings sum. Ref: %ld, DUT: %ld",
ref_timings_sum,
dut_timings_sum);
break;
}
FURI_LOG_I(TAG, "Encoding time: %d us. Acceptable time: %d us", time, encode_max_time);
FURI_LOG_I(TAG, "Encoding time: %ld us. Acceptable time: %ld us", time, encode_max_time);
FURI_LOG_I(
TAG,
"Timings sum difference: %d [1/64MHZ]. Acceptable difference: %d [1/64MHz]",
"Timings sum difference: %ld [1/64MHZ]. Acceptable difference: %ld [1/64MHz]",
sum_diff,
timings_sum_tolerance);
success = true;
@@ -174,8 +182,8 @@ MU_TEST(nfc_digital_signal_test) {
MU_TEST(mf_classic_dict_test) {
MfClassicDict* instance = NULL;
uint64_t key = 0;
string_t temp_str;
string_init(temp_str);
FuriString* temp_str;
temp_str = furi_string_alloc();
instance = mf_classic_dict_alloc(MfClassicDictTypeUnitTest);
mu_assert(instance != NULL, "mf_classic_dict_alloc\r\n");
@@ -184,7 +192,7 @@ MU_TEST(mf_classic_dict_test) {
mf_classic_dict_get_total_keys(instance) == 0,
"mf_classic_dict_get_total_keys == 0 assert failed\r\n");
string_set(temp_str, "2196FAD8115B");
furi_string_set(temp_str, "2196FAD8115B");
mu_assert(
mf_classic_dict_add_key_str(instance, temp_str),
"mf_classic_dict_add_key == true assert failed\r\n");
@@ -199,7 +207,7 @@ MU_TEST(mf_classic_dict_test) {
mf_classic_dict_get_key_at_index_str(instance, temp_str, 0),
"mf_classic_dict_get_key_at_index_str == true assert failed\r\n");
mu_assert(
string_cmp(temp_str, "2196FAD8115B") == 0,
furi_string_cmp(temp_str, "2196FAD8115B") == 0,
"string_cmp(temp_str, \"2196FAD8115B\") == 0 assert failed\r\n");
mu_assert(mf_classic_dict_rewind(instance), "mf_classic_dict_rewind == 1 assert failed\r\n");
@@ -216,14 +224,304 @@ MU_TEST(mf_classic_dict_test) {
"mf_classic_dict_delete_index == true assert failed\r\n");
mf_classic_dict_free(instance);
string_clear(temp_str);
furi_string_free(temp_str);
}
MU_TEST(mf_classic_dict_load_test) {
Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage != NULL, "storage != NULL assert failed\r\n");
// Delete unit test dict file if exists
if(storage_file_exists(storage, NFC_TEST_DICT_PATH)) {
mu_assert(
storage_simply_remove(storage, NFC_TEST_DICT_PATH),
"remove == true assert failed\r\n");
}
// Create unit test dict file
Stream* file_stream = file_stream_alloc(storage);
mu_assert(file_stream != NULL, "file_stream != NULL assert failed\r\n");
mu_assert(
file_stream_open(file_stream, NFC_TEST_DICT_PATH, FSAM_WRITE, FSOM_OPEN_ALWAYS),
"file_stream_open == true assert failed\r\n");
// Write unit test dict file
char key_str[] = "a0a1a2a3a4a5";
mu_assert(
stream_write_cstring(file_stream, key_str) == strlen(key_str),
"write == true assert failed\r\n");
// Close unit test dict file
mu_assert(file_stream_close(file_stream), "file_stream_close == true assert failed\r\n");
// Load unit test dict file
MfClassicDict* instance = NULL;
instance = mf_classic_dict_alloc(MfClassicDictTypeUnitTest);
mu_assert(instance != NULL, "mf_classic_dict_alloc\r\n");
uint32_t total_keys = mf_classic_dict_get_total_keys(instance);
mu_assert(total_keys == 1, "total_keys == 1 assert failed\r\n");
// Read key
uint64_t key_ref = 0xa0a1a2a3a4a5;
uint64_t key_dut = 0;
FuriString* temp_str = furi_string_alloc();
mu_assert(
mf_classic_dict_get_next_key_str(instance, temp_str),
"get_next_key_str == true assert failed\r\n");
mu_assert(furi_string_cmp_str(temp_str, key_str) == 0, "invalid key loaded\r\n");
mu_assert(mf_classic_dict_rewind(instance), "mf_classic_dict_rewind == 1 assert failed\r\n");
mu_assert(
mf_classic_dict_get_next_key(instance, &key_dut),
"get_next_key == true assert failed\r\n");
mu_assert(key_dut == key_ref, "invalid key loaded\r\n");
furi_string_free(temp_str);
mf_classic_dict_free(instance);
// Check that MfClassicDict added new line to the end of the file
mu_assert(
file_stream_open(file_stream, NFC_TEST_DICT_PATH, FSAM_READ, FSOM_OPEN_EXISTING),
"file_stream_open == true assert failed\r\n");
mu_assert(stream_seek(file_stream, -1, StreamOffsetFromEnd), "seek == true assert failed\r\n");
uint8_t last_char = 0;
mu_assert(stream_read(file_stream, &last_char, 1) == 1, "read == true assert failed\r\n");
mu_assert(last_char == '\n', "last_char == '\\n' assert failed\r\n");
mu_assert(file_stream_close(file_stream), "file_stream_close == true assert failed\r\n");
// Delete unit test dict file
mu_assert(
storage_simply_remove(storage, NFC_TEST_DICT_PATH), "remove == true assert failed\r\n");
stream_free(file_stream);
furi_record_close(RECORD_STORAGE);
}
MU_TEST(nfca_file_test) {
NfcDevice* nfc = nfc_device_alloc();
mu_assert(nfc != NULL, "nfc_device_data != NULL assert failed\r\n");
nfc->format = NfcDeviceSaveFormatUid;
// Fill the UID, sak, ATQA and type
uint8_t uid[7] = {0x04, 0x01, 0x23, 0x45, 0x67, 0x89, 0x00};
memcpy(nfc->dev_data.nfc_data.uid, uid, 7);
nfc->dev_data.nfc_data.uid_len = 7;
nfc->dev_data.nfc_data.sak = 0x08;
nfc->dev_data.nfc_data.atqa[0] = 0x00;
nfc->dev_data.nfc_data.atqa[1] = 0x04;
nfc->dev_data.nfc_data.type = FuriHalNfcTypeA;
// Save the NFC device data to the file
mu_assert(
nfc_device_save(nfc, NFC_TEST_NFC_DEV_PATH), "nfc_device_save == true assert failed\r\n");
nfc_device_free(nfc);
// Load the NFC device data from the file
NfcDevice* nfc_validate = nfc_device_alloc();
mu_assert(
nfc_device_load(nfc_validate, NFC_TEST_NFC_DEV_PATH, true),
"nfc_device_load == true assert failed\r\n");
// Check the UID, sak, ATQA and type
mu_assert(memcmp(nfc_validate->dev_data.nfc_data.uid, uid, 7) == 0, "uid assert failed\r\n");
mu_assert(nfc_validate->dev_data.nfc_data.sak == 0x08, "sak == 0x08 assert failed\r\n");
mu_assert(
nfc_validate->dev_data.nfc_data.atqa[0] == 0x00, "atqa[0] == 0x00 assert failed\r\n");
mu_assert(
nfc_validate->dev_data.nfc_data.atqa[1] == 0x04, "atqa[1] == 0x04 assert failed\r\n");
mu_assert(
nfc_validate->dev_data.nfc_data.type == FuriHalNfcTypeA,
"type == FuriHalNfcTypeA assert failed\r\n");
nfc_device_free(nfc_validate);
}
static void mf_classic_generator_test(uint8_t uid_len, MfClassicType type) {
NfcDevice* nfc_dev = nfc_device_alloc();
mu_assert(nfc_dev != NULL, "nfc_device_data != NULL assert failed\r\n");
nfc_dev->format = NfcDeviceSaveFormatMifareClassic;
// Create a test file
nfc_generate_mf_classic(&nfc_dev->dev_data, uid_len, type);
// Get the uid from generated MFC
uint8_t uid[7] = {0};
memcpy(uid, nfc_dev->dev_data.nfc_data.uid, uid_len);
uint8_t sak = nfc_dev->dev_data.nfc_data.sak;
uint8_t atqa[2] = {};
memcpy(atqa, nfc_dev->dev_data.nfc_data.atqa, 2);
MfClassicData* mf_data = &nfc_dev->dev_data.mf_classic_data;
// Check the manufacturer block (should be uid[uid_len] + BCC (for 4byte only) + SAK + ATQA0 + ATQA1 + 0xFF[rest])
uint8_t manufacturer_block[16] = {0};
memcpy(manufacturer_block, nfc_dev->dev_data.mf_classic_data.block[0].value, 16);
mu_assert(
memcmp(manufacturer_block, uid, uid_len) == 0,
"manufacturer_block uid doesn't match the file\r\n");
uint8_t position = 0;
if(uid_len == 4) {
position = uid_len;
uint8_t bcc = 0;
for(int i = 0; i < uid_len; i++) {
bcc ^= uid[i];
}
mu_assert(manufacturer_block[position] == bcc, "manufacturer_block bcc assert failed\r\n");
} else {
position = uid_len - 1;
}
mu_assert(manufacturer_block[position + 1] == sak, "manufacturer_block sak assert failed\r\n");
mu_assert(
manufacturer_block[position + 2] == atqa[0], "manufacturer_block atqa0 assert failed\r\n");
mu_assert(
manufacturer_block[position + 3] == atqa[1], "manufacturer_block atqa1 assert failed\r\n");
for(uint8_t i = position + 4; i < 16; i++) {
mu_assert(
manufacturer_block[i] == 0xFF, "manufacturer_block[i] == 0xFF assert failed\r\n");
}
// Reference sector trailers (should be 0xFF[6] + 0xFF + 0x07 + 0x80 + 0x69 + 0xFF[6])
uint8_t sector_trailer[16] = {
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0x07,
0x80,
0x69,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF};
// Reference block data
uint8_t block_data[16] = {};
memset(block_data, 0xff, sizeof(block_data));
uint16_t total_blocks = mf_classic_get_total_block_num(type);
for(size_t i = 1; i < total_blocks; i++) {
if(mf_classic_is_sector_trailer(i)) {
mu_assert(
memcmp(mf_data->block[i].value, sector_trailer, 16) == 0,
"Failed sector trailer compare");
} else {
mu_assert(memcmp(mf_data->block[i].value, block_data, 16) == 0, "Failed data compare");
}
}
// Save the NFC device data to the file
mu_assert(
nfc_device_save(nfc_dev, NFC_TEST_NFC_DEV_PATH),
"nfc_device_save == true assert failed\r\n");
// Verify that key cache is saved
FuriString* key_cache_name = furi_string_alloc();
furi_string_set_str(key_cache_name, "/ext/nfc/.cache/");
for(size_t i = 0; i < uid_len; i++) {
furi_string_cat_printf(key_cache_name, "%02X", uid[i]);
}
furi_string_cat_printf(key_cache_name, ".keys");
mu_assert(
storage_common_stat(nfc_dev->storage, furi_string_get_cstr(key_cache_name), NULL) ==
FSE_OK,
"Key cache file save failed");
nfc_device_free(nfc_dev);
// Load the NFC device data from the file
NfcDevice* nfc_validate = nfc_device_alloc();
mu_assert(nfc_validate, "Nfc device alloc assert");
mu_assert(
nfc_device_load(nfc_validate, NFC_TEST_NFC_DEV_PATH, false),
"nfc_device_load == true assert failed\r\n");
// Check the UID, sak, ATQA and type
mu_assert(
memcmp(nfc_validate->dev_data.nfc_data.uid, uid, uid_len) == 0,
"uid compare assert failed\r\n");
mu_assert(nfc_validate->dev_data.nfc_data.sak == sak, "sak compare assert failed\r\n");
mu_assert(
memcmp(nfc_validate->dev_data.nfc_data.atqa, atqa, 2) == 0,
"atqa compare assert failed\r\n");
mu_assert(
nfc_validate->dev_data.nfc_data.type == FuriHalNfcTypeA,
"type == FuriHalNfcTypeA assert failed\r\n");
// Check the manufacturer block
mu_assert(
memcmp(nfc_validate->dev_data.mf_classic_data.block[0].value, manufacturer_block, 16) == 0,
"manufacturer_block assert failed\r\n");
// Check other blocks
for(size_t i = 1; i < total_blocks; i++) {
if(mf_classic_is_sector_trailer(i)) {
mu_assert(
memcmp(mf_data->block[i].value, sector_trailer, 16) == 0,
"Failed sector trailer compare");
} else {
mu_assert(memcmp(mf_data->block[i].value, block_data, 16) == 0, "Failed data compare");
}
}
nfc_device_free(nfc_validate);
// Check saved key cache
NfcDevice* nfc_keys = nfc_device_alloc();
mu_assert(nfc_validate, "Nfc device alloc assert");
nfc_keys->dev_data.nfc_data.uid_len = uid_len;
memcpy(nfc_keys->dev_data.nfc_data.uid, uid, uid_len);
mu_assert(nfc_device_load_key_cache(nfc_keys), "Failed to load key cache");
uint8_t total_sec = mf_classic_get_total_sectors_num(type);
uint8_t default_key[6] = {};
memset(default_key, 0xff, 6);
for(size_t i = 0; i < total_sec; i++) {
MfClassicSectorTrailer* sec_tr =
mf_classic_get_sector_trailer_by_sector(&nfc_keys->dev_data.mf_classic_data, i);
mu_assert(memcmp(sec_tr->key_a, default_key, 6) == 0, "Failed key compare");
mu_assert(memcmp(sec_tr->key_b, default_key, 6) == 0, "Failed key compare");
}
// Delete key cache file
mu_assert(
storage_common_remove(nfc_keys->storage, furi_string_get_cstr(key_cache_name)) == FSE_OK,
"Failed to remove key cache file");
furi_string_free(key_cache_name);
nfc_device_free(nfc_keys);
}
MU_TEST(mf_mini_file_test) {
mf_classic_generator_test(4, MfClassicTypeMini);
}
MU_TEST(mf_classic_1k_4b_file_test) {
mf_classic_generator_test(4, MfClassicType1k);
}
MU_TEST(mf_classic_4k_4b_file_test) {
mf_classic_generator_test(4, MfClassicType4k);
}
MU_TEST(mf_classic_1k_7b_file_test) {
mf_classic_generator_test(7, MfClassicType1k);
}
MU_TEST(mf_classic_4k_7b_file_test) {
mf_classic_generator_test(7, MfClassicType4k);
}
MU_TEST_SUITE(nfc) {
nfc_test_alloc();
MU_RUN_TEST(nfca_file_test);
MU_RUN_TEST(mf_mini_file_test);
MU_RUN_TEST(mf_classic_1k_4b_file_test);
MU_RUN_TEST(mf_classic_4k_4b_file_test);
MU_RUN_TEST(mf_classic_1k_7b_file_test);
MU_RUN_TEST(mf_classic_4k_7b_file_test);
MU_RUN_TEST(nfc_digital_signal_test);
MU_RUN_TEST(mf_classic_dict_test);
MU_RUN_TEST(mf_classic_dict_load_test);
nfc_test_free();
}

View File

@@ -0,0 +1,62 @@
#include <furi.h>
#include <furi_hal.h>
#include "../minunit.h"
static void power_test_deinit(void) {
// Try to reset to default charging voltage
furi_hal_power_set_battery_charging_voltage(4.208f);
}
MU_TEST(test_power_charge_voltage_exact) {
// Power of 16mV charge voltages get applied exactly
// (bq25896 charge controller works in 16mV increments)
//
// This test may need adapted if other charge controllers are used in the future.
for(uint16_t charge_mv = 3840; charge_mv <= 4208; charge_mv += 16) {
float charge_volt = (float)charge_mv / 1000.0f;
furi_hal_power_set_battery_charging_voltage(charge_volt);
mu_assert_double_eq(charge_volt, furi_hal_power_get_battery_charging_voltage());
}
}
MU_TEST(test_power_charge_voltage_floating_imprecision) {
// 4.016f should act as 4.016 V, even with floating point imprecision
furi_hal_power_set_battery_charging_voltage(4.016f);
mu_assert_double_eq(4.016f, furi_hal_power_get_battery_charging_voltage());
}
MU_TEST(test_power_charge_voltage_inexact) {
// Charge voltages that are not power of 16mV get truncated down
furi_hal_power_set_battery_charging_voltage(3.841f);
mu_assert_double_eq(3.840, furi_hal_power_get_battery_charging_voltage());
furi_hal_power_set_battery_charging_voltage(3.900f);
mu_assert_double_eq(3.888, furi_hal_power_get_battery_charging_voltage());
furi_hal_power_set_battery_charging_voltage(4.200f);
mu_assert_double_eq(4.192, furi_hal_power_get_battery_charging_voltage());
}
MU_TEST(test_power_charge_voltage_invalid_clamped) {
// Out-of-range charge voltages get clamped to 3.840 V and 4.208 V
furi_hal_power_set_battery_charging_voltage(3.808f);
mu_assert_double_eq(3.840, furi_hal_power_get_battery_charging_voltage());
// NOTE: Intentionally picking a small increment above 4.208 V to reduce the risk of an
// unhappy battery if this fails.
furi_hal_power_set_battery_charging_voltage(4.240f);
mu_assert_double_eq(4.208, furi_hal_power_get_battery_charging_voltage());
}
MU_TEST_SUITE(test_power_suite) {
MU_RUN_TEST(test_power_charge_voltage_exact);
MU_RUN_TEST(test_power_charge_voltage_floating_imprecision);
MU_RUN_TEST(test_power_charge_voltage_inexact);
MU_RUN_TEST(test_power_charge_voltage_invalid_clamped);
power_test_deinit();
}
int run_minunit_test_power() {
MU_RUN_SUITE(test_power_suite);
return MU_EXIT_CODE;
}

View File

@@ -10,7 +10,6 @@
#include <furi.h>
#include "../minunit.h"
#include <stdint.h>
#include <stream_buffer.h>
#include <pb.h>
#include <pb_encode.h>
#include <m-list.h>
@@ -34,7 +33,7 @@ static uint32_t command_id = 0;
typedef struct {
RpcSession* session;
StreamBufferHandle_t output_stream;
FuriStreamBuffer* output_stream;
SemaphoreHandle_t close_session_semaphore;
SemaphoreHandle_t terminate_semaphore;
TickType_t timeout;
@@ -90,7 +89,7 @@ static void test_rpc_setup(void) {
}
furi_check(rpc_session[0].session);
rpc_session[0].output_stream = xStreamBufferCreate(1000, 1);
rpc_session[0].output_stream = furi_stream_buffer_alloc(4096, 1);
rpc_session_set_send_bytes_callback(rpc_session[0].session, output_bytes_callback);
rpc_session[0].close_session_semaphore = xSemaphoreCreateBinary();
rpc_session[0].terminate_semaphore = xSemaphoreCreateBinary();
@@ -110,7 +109,7 @@ static void test_rpc_setup_second_session(void) {
}
furi_check(rpc_session[1].session);
rpc_session[1].output_stream = xStreamBufferCreate(1000, 1);
rpc_session[1].output_stream = furi_stream_buffer_alloc(1000, 1);
rpc_session_set_send_bytes_callback(rpc_session[1].session, output_bytes_callback);
rpc_session[1].close_session_semaphore = xSemaphoreCreateBinary();
rpc_session[1].terminate_semaphore = xSemaphoreCreateBinary();
@@ -126,7 +125,7 @@ static void test_rpc_teardown(void) {
rpc_session_close(rpc_session[0].session);
furi_check(xSemaphoreTake(rpc_session[0].terminate_semaphore, portMAX_DELAY));
furi_record_close(RECORD_RPC);
vStreamBufferDelete(rpc_session[0].output_stream);
furi_stream_buffer_free(rpc_session[0].output_stream);
vSemaphoreDelete(rpc_session[0].close_session_semaphore);
vSemaphoreDelete(rpc_session[0].terminate_semaphore);
++command_id;
@@ -141,7 +140,7 @@ static void test_rpc_teardown_second_session(void) {
xSemaphoreTake(rpc_session[1].terminate_semaphore, 0);
rpc_session_close(rpc_session[1].session);
furi_check(xSemaphoreTake(rpc_session[1].terminate_semaphore, portMAX_DELAY));
vStreamBufferDelete(rpc_session[1].output_stream);
furi_stream_buffer_free(rpc_session[1].output_stream);
vSemaphoreDelete(rpc_session[1].close_session_semaphore);
vSemaphoreDelete(rpc_session[1].terminate_semaphore);
++command_id;
@@ -268,8 +267,8 @@ static PB_CommandStatus test_rpc_storage_get_file_error(File* file) {
static void output_bytes_callback(void* ctx, uint8_t* got_bytes, size_t got_size) {
RpcSessionContext* callbacks_context = ctx;
size_t bytes_sent =
xStreamBufferSend(callbacks_context->output_stream, got_bytes, got_size, FuriWaitForever);
size_t bytes_sent = furi_stream_buffer_send(
callbacks_context->output_stream, got_bytes, got_size, FuriWaitForever);
(void)bytes_sent;
furi_check(bytes_sent == got_size);
}
@@ -534,7 +533,8 @@ static bool test_rpc_pb_stream_read(pb_istream_t* istream, pb_byte_t* buf, size_
TickType_t now = xTaskGetTickCount();
int32_t time_left = session_context->timeout - now;
time_left = MAX(time_left, 0);
bytes_received = xStreamBufferReceive(session_context->output_stream, buf, count, time_left);
bytes_received =
furi_stream_buffer_receive(session_context->output_stream, buf, count, time_left);
return (count == bytes_received);
}

View File

@@ -75,7 +75,7 @@ typedef struct {
bool visited;
} StorageTestPath;
DICT_DEF2(StorageTestPathDict, string_t, STRING_OPLIST, StorageTestPath, M_POD_OPLIST)
DICT_DEF2(StorageTestPathDict, FuriString*, FURI_STRING_OPLIST, StorageTestPath, M_POD_OPLIST)
static StorageTestPathDict_t*
storage_test_paths_alloc(const StorageTestPathDesc paths[], size_t paths_count) {
@@ -83,15 +83,15 @@ static StorageTestPathDict_t*
StorageTestPathDict_init(*data);
for(size_t i = 0; i < paths_count; i++) {
string_t key;
string_init_set(key, paths[i].path);
FuriString* key;
key = furi_string_alloc_set(paths[i].path);
StorageTestPath value = {
.is_dir = paths[i].is_dir,
.visited = false,
};
StorageTestPathDict_set_at(*data, key, value);
string_clear(key);
furi_string_free(key);
}
return data;
@@ -102,7 +102,7 @@ static void storage_test_paths_free(StorageTestPathDict_t* data) {
free(data);
}
static bool storage_test_paths_mark(StorageTestPathDict_t* data, string_t path, bool is_dir) {
static bool storage_test_paths_mark(StorageTestPathDict_t* data, FuriString* path, bool is_dir) {
bool found = false;
StorageTestPath* record = StorageTestPathDict_get(*data, path);
@@ -148,27 +148,27 @@ static bool write_file_13DA(Storage* storage, const char* path) {
}
static void storage_dirs_create(Storage* storage, const char* base) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
storage_common_mkdir(storage, base);
for(size_t i = 0; i < COUNT_OF(storage_test_dirwalk_paths); i++) {
string_printf(path, "%s/%s", base, storage_test_dirwalk_paths[i]);
storage_common_mkdir(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_test_dirwalk_paths[i]);
storage_common_mkdir(storage, furi_string_get_cstr(path));
}
for(size_t i = 0; i < COUNT_OF(storage_test_dirwalk_files); i++) {
string_printf(path, "%s/%s", base, storage_test_dirwalk_files[i]);
write_file_13DA(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_test_dirwalk_files[i]);
write_file_13DA(storage, furi_string_get_cstr(path));
}
string_clear(path);
furi_string_free(path);
}
MU_TEST_1(test_dirwalk_full, Storage* storage) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
FileInfo fileinfo;
StorageTestPathDict_t* paths =
@@ -178,12 +178,12 @@ MU_TEST_1(test_dirwalk_full, Storage* storage) {
mu_check(dir_walk_open(dir_walk, EXT_PATH("dirwalk")));
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
string_right(path, strlen(EXT_PATH("dirwalk/")));
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
}
dir_walk_free(dir_walk);
string_clear(path);
furi_string_free(path);
mu_check(storage_test_paths_check(paths) == false);
@@ -191,8 +191,8 @@ MU_TEST_1(test_dirwalk_full, Storage* storage) {
}
MU_TEST_1(test_dirwalk_no_recursive, Storage* storage) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
FileInfo fileinfo;
StorageTestPathDict_t* paths = storage_test_paths_alloc(
@@ -203,12 +203,12 @@ MU_TEST_1(test_dirwalk_no_recursive, Storage* storage) {
mu_check(dir_walk_open(dir_walk, EXT_PATH("dirwalk")));
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
string_right(path, strlen(EXT_PATH("dirwalk/")));
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
}
dir_walk_free(dir_walk);
string_clear(path);
furi_string_free(path);
mu_check(storage_test_paths_check(paths) == false);
@@ -230,8 +230,8 @@ static bool test_dirwalk_filter_no_folder_ext(const char* name, FileInfo* filein
}
MU_TEST_1(test_dirwalk_filter, Storage* storage) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
FileInfo fileinfo;
StorageTestPathDict_t* paths = storage_test_paths_alloc(
@@ -242,12 +242,12 @@ MU_TEST_1(test_dirwalk_filter, Storage* storage) {
mu_check(dir_walk_open(dir_walk, EXT_PATH("dirwalk")));
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
string_right(path, strlen(EXT_PATH("dirwalk/")));
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
}
dir_walk_free(dir_walk);
string_clear(path);
furi_string_free(path);
mu_check(storage_test_paths_check(paths) == false);

View File

@@ -43,11 +43,8 @@ MU_TEST(storage_file_open_lock) {
File* file = storage_file_alloc(storage);
// file_locker thread start
FuriThread* locker_thread = furi_thread_alloc();
furi_thread_set_name(locker_thread, "StorageFileLocker");
furi_thread_set_stack_size(locker_thread, 2048);
furi_thread_set_context(locker_thread, semaphore);
furi_thread_set_callback(locker_thread, storage_file_locker);
FuriThread* locker_thread =
furi_thread_alloc_ex("StorageFileLocker", 2048, storage_file_locker, semaphore);
furi_thread_start(locker_thread);
// wait for file lock
@@ -58,7 +55,7 @@ MU_TEST(storage_file_open_lock) {
storage_file_close(file);
// file_locker thread stop
mu_check(furi_thread_join(locker_thread) == FuriStatusOk);
mu_check(furi_thread_join(locker_thread));
furi_thread_free(locker_thread);
// clean data
@@ -133,11 +130,8 @@ MU_TEST(storage_dir_open_lock) {
File* file = storage_file_alloc(storage);
// file_locker thread start
FuriThread* locker_thread = furi_thread_alloc();
furi_thread_set_name(locker_thread, "StorageDirLocker");
furi_thread_set_stack_size(locker_thread, 2048);
furi_thread_set_context(locker_thread, semaphore);
furi_thread_set_callback(locker_thread, storage_dir_locker);
FuriThread* locker_thread =
furi_thread_alloc_ex("StorageDirLocker", 2048, storage_dir_locker, semaphore);
furi_thread_start(locker_thread);
// wait for dir lock
@@ -148,7 +142,7 @@ MU_TEST(storage_dir_open_lock) {
storage_dir_close(file);
// file_locker thread stop
mu_check(furi_thread_join(locker_thread) == FuriStatusOk);
mu_check(furi_thread_join(locker_thread));
furi_thread_free(locker_thread);
// clean data
@@ -211,22 +205,22 @@ static bool check_file_13DA(Storage* storage, const char* path) {
}
static void storage_dir_create(Storage* storage, const char* base) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
storage_common_mkdir(storage, base);
for(size_t i = 0; i < COUNT_OF(storage_copy_test_paths); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
storage_common_mkdir(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
storage_common_mkdir(storage, furi_string_get_cstr(path));
}
for(size_t i = 0; i < COUNT_OF(storage_copy_test_files); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
write_file_13DA(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
write_file_13DA(storage, furi_string_get_cstr(path));
}
string_clear(path);
furi_string_free(path);
}
static void storage_dir_remove(Storage* storage, const char* base) {
@@ -235,15 +229,15 @@ static void storage_dir_remove(Storage* storage, const char* base) {
static bool storage_dir_rename_check(Storage* storage, const char* base) {
bool result = false;
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
result = (storage_common_stat(storage, base, NULL) == FSE_OK);
if(result) {
for(size_t i = 0; i < COUNT_OF(storage_copy_test_paths); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
result = (storage_common_stat(storage, string_get_cstr(path), NULL) == FSE_OK);
furi_string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
result = (storage_common_stat(storage, furi_string_get_cstr(path), NULL) == FSE_OK);
if(!result) {
break;
}
@@ -252,15 +246,15 @@ static bool storage_dir_rename_check(Storage* storage, const char* base) {
if(result) {
for(size_t i = 0; i < COUNT_OF(storage_copy_test_files); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
result = check_file_13DA(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
result = check_file_13DA(storage, furi_string_get_cstr(path));
if(!result) {
break;
}
}
}
string_clear(path);
furi_string_free(path);
return result;
}

View File

@@ -18,8 +18,8 @@ static const char* stream_test_right_data =
MU_TEST_1(stream_composite_subtest, Stream* stream) {
const size_t data_size = 128;
uint8_t data[data_size];
string_t string_lee;
string_init_set(string_lee, "lee");
FuriString* string_lee;
string_lee = furi_string_alloc_set("lee");
// test that stream is empty
// "" -> ""
@@ -72,8 +72,32 @@ MU_TEST_1(stream_composite_subtest, Stream* stream) {
mu_check(stream_seek(stream, -3, StreamOffsetFromEnd));
mu_check(stream_tell(stream) == 4);
// write string with replacemet
// test seeks to char. content: '1337_69'
stream_rewind(stream);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionForward));
mu_check(stream_tell(stream) == 1);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionForward));
mu_check(stream_tell(stream) == 2);
mu_check(stream_seek_to_char(stream, '_', StreamDirectionForward));
mu_check(stream_tell(stream) == 4);
mu_check(stream_seek_to_char(stream, '9', StreamDirectionForward));
mu_check(stream_tell(stream) == 6);
mu_check(!stream_seek_to_char(stream, '9', StreamDirectionForward));
mu_check(stream_tell(stream) == 6);
mu_check(stream_seek_to_char(stream, '_', StreamDirectionBackward));
mu_check(stream_tell(stream) == 4);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionBackward));
mu_check(stream_tell(stream) == 2);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionBackward));
mu_check(stream_tell(stream) == 1);
mu_check(!stream_seek_to_char(stream, '3', StreamDirectionBackward));
mu_check(stream_tell(stream) == 1);
mu_check(stream_seek_to_char(stream, '1', StreamDirectionBackward));
mu_check(stream_tell(stream) == 0);
// write string with replacement
// "1337_69" -> "1337lee"
mu_check(stream_seek(stream, 4, StreamOffsetFromStart));
mu_check(stream_write_string(stream, string_lee) == 3);
mu_check(stream_size(stream) == 7);
mu_check(stream_tell(stream) == 7);
@@ -219,21 +243,21 @@ MU_TEST_1(stream_composite_subtest, Stream* stream) {
mu_check(stream_eof(stream));
mu_assert_int_eq(0, stream_tell(stream));
// insert formated string at the end of stream
// insert formatted string at the end of stream
// "" -> "dio666"
mu_check(stream_insert_format(stream, "%s%d", "dio", 666));
mu_assert_int_eq(6, stream_size(stream));
mu_check(stream_eof(stream));
mu_assert_int_eq(6, stream_tell(stream));
// insert formated string at the end of stream
// insert formatted string at the end of stream
// "dio666" -> "dio666zlo555"
mu_check(stream_insert_format(stream, "%s%d", "zlo", 555));
mu_assert_int_eq(12, stream_size(stream));
mu_check(stream_eof(stream));
mu_assert_int_eq(12, stream_tell(stream));
// insert formated string at the 6 pos
// insert formatted string at the 6 pos
// "dio666" -> "dio666baba13zlo555"
mu_check(stream_seek(stream, 6, StreamOffsetFromStart));
mu_check(stream_insert_format(stream, "%s%d", "baba", 13));
@@ -267,7 +291,7 @@ MU_TEST_1(stream_composite_subtest, Stream* stream) {
mu_assert_int_eq(9, stream_tell(stream));
mu_check(stream_eof(stream));
string_clear(string_lee);
furi_string_free(string_lee);
}
MU_TEST(stream_composite_test) {
@@ -416,10 +440,10 @@ MU_TEST(stream_buffered_write_after_read_test) {
}
MU_TEST(stream_buffered_large_file_test) {
string_t input_data;
string_t output_data;
string_init(input_data);
string_init(output_data);
FuriString* input_data;
FuriString* output_data;
input_data = furi_string_alloc();
output_data = furi_string_alloc();
Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -429,7 +453,7 @@ MU_TEST(stream_buffered_large_file_test) {
const size_t rep_count = data_size / line_size + 1;
for(size_t i = 0; i < rep_count; ++i) {
string_cat_printf(input_data, "%s\n", stream_test_data);
furi_string_cat_printf(input_data, "%s\n", stream_test_data);
}
// write test data to file
@@ -437,8 +461,8 @@ MU_TEST(stream_buffered_large_file_test) {
mu_check(buffered_file_stream_open(
stream, EXT_PATH("filestream.str"), FSAM_READ_WRITE, FSOM_CREATE_ALWAYS));
mu_assert_int_eq(0, stream_size(stream));
mu_assert_int_eq(string_size(input_data), stream_write_string(stream, input_data));
mu_assert_int_eq(string_size(input_data), stream_size(stream));
mu_assert_int_eq(furi_string_size(input_data), stream_write_string(stream, input_data));
mu_assert_int_eq(furi_string_size(input_data), stream_size(stream));
const size_t substr_start = 8;
const size_t substr_len = 11;
@@ -475,23 +499,23 @@ MU_TEST(stream_buffered_large_file_test) {
// read the whole file
mu_check(stream_rewind(stream));
string_t tmp;
string_init(tmp);
FuriString* tmp;
tmp = furi_string_alloc();
while(stream_read_line(stream, tmp)) {
string_cat(output_data, tmp);
furi_string_cat(output_data, tmp);
}
string_clear(tmp);
furi_string_free(tmp);
// check against generated data
mu_assert_int_eq(string_size(input_data), string_size(output_data));
mu_check(string_equal_p(input_data, output_data));
mu_assert_int_eq(furi_string_size(input_data), furi_string_size(output_data));
mu_check(furi_string_equal(input_data, output_data));
mu_check(stream_eof(stream));
stream_free(stream);
furi_record_close(RECORD_STORAGE);
string_clear(input_data);
string_clear(output_data);
furi_string_free(input_data);
furi_string_free(output_data);
}
MU_TEST_SUITE(stream_suite) {

View File

@@ -5,15 +5,16 @@
#include <lib/subghz/transmitter.h>
#include <lib/subghz/subghz_keystore.h>
#include <lib/subghz/subghz_file_encoder_worker.h>
#include <lib/subghz/protocols/registry.h>
#include <lib/subghz/protocols/protocol_items.h>
#include <flipper_format/flipper_format_i.h>
#define TAG "SubGhz TEST"
#define KEYSTORE_DIR_NAME EXT_PATH("subghz/assets/keeloq_mfcodes")
#define CAME_ATOMO_DIR_NAME EXT_PATH("subghz/assets/came_atomo")
#define NICE_FLOR_S_DIR_NAME EXT_PATH("subghz/assets/nice_flor_s")
#define ALUTECH_AT_4N_DIR_NAME EXT_PATH("subghz/assets/alutech_at_4n")
#define TEST_RANDOM_DIR_NAME EXT_PATH("unit_tests/subghz/test_random_raw.sub")
#define TEST_RANDOM_COUNT_PARSE 233
#define TEST_RANDOM_COUNT_PARSE 329
#define TEST_TIMEOUT 10000
static SubGhzEnvironment* environment_handler;
@@ -28,12 +29,12 @@ static void subghz_test_rx_callback(
void* context) {
UNUSED(receiver);
UNUSED(context);
string_t text;
string_init(text);
FuriString* text;
text = furi_string_alloc();
subghz_protocol_decoder_base_get_string(decoder_base, text);
subghz_receiver_reset(receiver_handler);
FURI_LOG_T(TAG, "\r\n%s", string_get_cstr(text));
string_clear(text);
FURI_LOG_T(TAG, "\r\n%s", furi_string_get_cstr(text));
furi_string_free(text);
subghz_test_decoder_count++;
}
@@ -43,6 +44,10 @@ static void subghz_test_init(void) {
environment_handler, CAME_ATOMO_DIR_NAME);
subghz_environment_set_nice_flor_s_rainbow_table_file_name(
environment_handler, NICE_FLOR_S_DIR_NAME);
subghz_environment_set_alutech_at_4n_rainbow_table_file_name(
environment_handler, ALUTECH_AT_4N_DIR_NAME);
subghz_environment_set_protocol_registry(
environment_handler, (void*)&subghz_protocol_registry);
receiver_handler = subghz_receiver_alloc_init(environment_handler);
subghz_receiver_set_filter(receiver_handler, SubGhzProtocolFlag_Decodable);
@@ -141,8 +146,8 @@ static bool subghz_decode_random_test(const char* path) {
static bool subghz_encoder_test(const char* path) {
subghz_test_decoder_count = 0;
uint32_t test_start = furi_get_tick();
string_t temp_str;
string_init(temp_str);
FuriString* temp_str;
temp_str = furi_string_alloc();
bool file_load = false;
Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -167,11 +172,11 @@ static bool subghz_encoder_test(const char* path) {
} while(false);
if(file_load) {
SubGhzTransmitter* transmitter =
subghz_transmitter_alloc_init(environment_handler, string_get_cstr(temp_str));
subghz_transmitter_alloc_init(environment_handler, furi_string_get_cstr(temp_str));
subghz_transmitter_deserialize(transmitter, fff_data_file);
SubGhzProtocolDecoderBase* decoder = subghz_receiver_search_decoder_base_by_name(
receiver_handler, string_get_cstr(temp_str));
receiver_handler, furi_string_get_cstr(temp_str));
if(decoder) {
LevelDuration level_duration;
@@ -192,10 +197,11 @@ static bool subghz_encoder_test(const char* path) {
flipper_format_free(fff_data_file);
FURI_LOG_T(TAG, "\r\n Decoder count parse \033[0;33m%d\033[0m ", subghz_test_decoder_count);
if(furi_get_tick() - test_start > TEST_TIMEOUT) {
printf("\033[0;31mTest encoder %s ERROR TimeOut\033[0m\r\n", string_get_cstr(temp_str));
printf(
"\033[0;31mTest encoder %s ERROR TimeOut\033[0m\r\n", furi_string_get_cstr(temp_str));
subghz_test_decoder_count = 0;
}
string_clear(temp_str);
furi_string_free(temp_str);
return subghz_test_decoder_count ? true : false;
}
@@ -206,6 +212,152 @@ MU_TEST(subghz_keystore_test) {
"Test keystore error");
}
typedef enum {
SubGhzHalAsyncTxTestTypeNormal,
SubGhzHalAsyncTxTestTypeInvalidStart,
SubGhzHalAsyncTxTestTypeInvalidMid,
SubGhzHalAsyncTxTestTypeInvalidEnd,
SubGhzHalAsyncTxTestTypeResetStart,
SubGhzHalAsyncTxTestTypeResetMid,
SubGhzHalAsyncTxTestTypeResetEnd,
} SubGhzHalAsyncTxTestType;
typedef struct {
SubGhzHalAsyncTxTestType type;
size_t pos;
} SubGhzHalAsyncTxTest;
#define SUBGHZ_HAL_TEST_DURATION 1
static LevelDuration subghz_hal_async_tx_test_yield(void* context) {
SubGhzHalAsyncTxTest* test = context;
bool is_odd = test->pos % 2;
if(test->type == SubGhzHalAsyncTxTestTypeNormal) {
if(test->pos < API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_make(is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_reset();
} else {
furi_crash("Yield after reset");
}
} else if(test->type == SubGhzHalAsyncTxTestTypeInvalidStart) {
if(test->pos == 0) {
test->pos++;
return level_duration_make(!is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos < API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_make(is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_reset();
} else {
furi_crash("Yield after reset");
}
} else if(test->type == SubGhzHalAsyncTxTestTypeInvalidMid) {
if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_HALF / 2) {
test->pos++;
return level_duration_make(!is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos < API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_make(is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_reset();
} else {
furi_crash("Yield after reset");
}
} else if(test->type == SubGhzHalAsyncTxTestTypeInvalidEnd) {
if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL - 1) {
test->pos++;
return level_duration_make(!is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos < API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_make(is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL * 8) {
test->pos++;
return level_duration_reset();
} else {
furi_crash("Yield after reset");
}
} else if(test->type == SubGhzHalAsyncTxTestTypeResetStart) {
if(test->pos == 0) {
test->pos++;
return level_duration_reset();
} else {
furi_crash("Yield after reset");
}
} else if(test->type == SubGhzHalAsyncTxTestTypeResetMid) {
if(test->pos < API_HAL_SUBGHZ_ASYNC_TX_BUFFER_HALF / 2) {
test->pos++;
return level_duration_make(is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_HALF / 2) {
test->pos++;
return level_duration_reset();
} else {
furi_crash("Yield after reset");
}
} else if(test->type == SubGhzHalAsyncTxTestTypeResetEnd) {
if(test->pos < API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL - 1) {
test->pos++;
return level_duration_make(is_odd, SUBGHZ_HAL_TEST_DURATION);
} else if(test->pos == API_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL - 1) {
test->pos++;
return level_duration_reset();
} else {
furi_crash("Yield after reset");
}
} else {
furi_crash("Programming error");
}
}
bool subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestType type) {
SubGhzHalAsyncTxTest test = {0};
test.type = type;
furi_hal_subghz_reset();
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok650Async);
furi_hal_subghz_set_frequency_and_path(433920000);
if(!furi_hal_subghz_start_async_tx(subghz_hal_async_tx_test_yield, &test)) {
return false;
}
while(!furi_hal_subghz_is_async_tx_complete()) {
furi_delay_ms(10);
}
furi_hal_subghz_stop_async_tx();
furi_hal_subghz_sleep();
return true;
}
MU_TEST(subghz_hal_async_tx_test) {
mu_assert(
subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestTypeNormal),
"Test furi_hal_async_tx normal");
mu_assert(
subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestTypeInvalidStart),
"Test furi_hal_async_tx invalid start");
mu_assert(
subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestTypeInvalidMid),
"Test furi_hal_async_tx invalid mid");
mu_assert(
subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestTypeInvalidEnd),
"Test furi_hal_async_tx invalid end");
mu_assert(
subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestTypeResetStart),
"Test furi_hal_async_tx reset start");
mu_assert(
subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestTypeResetMid),
"Test furi_hal_async_tx reset mid");
mu_assert(
subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestTypeResetEnd),
"Test furi_hal_async_tx reset end");
}
//test decoders
MU_TEST(subghz_decoder_came_atomo_test) {
mu_assert(
@@ -340,6 +492,14 @@ MU_TEST(subghz_decoder_linear_test) {
"Test decoder " SUBGHZ_PROTOCOL_LINEAR_NAME " error\r\n");
}
MU_TEST(subghz_decoder_linear_delta3_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/linear_delta3_raw.sub"),
SUBGHZ_PROTOCOL_LINEAR_DELTA3_NAME),
"Test decoder " SUBGHZ_PROTOCOL_LINEAR_DELTA3_NAME " error\r\n");
}
MU_TEST(subghz_decoder_megacode_test) {
mu_assert(
subghz_decoder_test(
@@ -412,11 +572,11 @@ MU_TEST(subghz_decoder_honeywell_wdb_test) {
"Test decoder " SUBGHZ_PROTOCOL_HONEYWELL_WDB_NAME " error\r\n");
}
MU_TEST(subghz_decoder_magellen_test) {
MU_TEST(subghz_decoder_magellan_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/magellen_raw.sub"), SUBGHZ_PROTOCOL_MAGELLEN_NAME),
"Test decoder " SUBGHZ_PROTOCOL_MAGELLEN_NAME " error\r\n");
EXT_PATH("unit_tests/subghz/magellan_raw.sub"), SUBGHZ_PROTOCOL_MAGELLAN_NAME),
"Test decoder " SUBGHZ_PROTOCOL_MAGELLAN_NAME " error\r\n");
}
MU_TEST(subghz_decoder_intertechno_v3_test) {
@@ -434,11 +594,55 @@ MU_TEST(subghz_decoder_clemsa_test) {
"Test decoder " SUBGHZ_PROTOCOL_CLEMSA_NAME " error\r\n");
}
MU_TEST(subghz_decoder_oregon2_test) {
MU_TEST(subghz_decoder_ansonic_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/oregon2_raw.sub"), SUBGHZ_PROTOCOL_OREGON2_NAME),
"Test decoder " SUBGHZ_PROTOCOL_OREGON2_NAME " error\r\n");
EXT_PATH("unit_tests/subghz/ansonic_raw.sub"), SUBGHZ_PROTOCOL_ANSONIC_NAME),
"Test decoder " SUBGHZ_PROTOCOL_ANSONIC_NAME " error\r\n");
}
MU_TEST(subghz_decoder_smc5326_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/smc5326_raw.sub"), SUBGHZ_PROTOCOL_SMC5326_NAME),
"Test decoder " SUBGHZ_PROTOCOL_SMC5326_NAME " error\r\n");
}
MU_TEST(subghz_decoder_holtek_ht12x_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/holtek_ht12x_raw.sub"), SUBGHZ_PROTOCOL_HOLTEK_HT12X_NAME),
"Test decoder " SUBGHZ_PROTOCOL_HOLTEK_HT12X_NAME " error\r\n");
}
MU_TEST(subghz_decoder_dooya_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/dooya_raw.sub"), SUBGHZ_PROTOCOL_DOOYA_NAME),
"Test decoder " SUBGHZ_PROTOCOL_DOOYA_NAME " error\r\n");
}
MU_TEST(subghz_decoder_alutech_at_4n_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/alutech_at_4n_raw.sub"),
SUBGHZ_PROTOCOL_ALUTECH_AT_4N_NAME),
"Test decoder " SUBGHZ_PROTOCOL_ALUTECH_AT_4N_NAME " error\r\n");
}
MU_TEST(subghz_decoder_nice_one_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/nice_one_raw.sub"), SUBGHZ_PROTOCOL_NICE_FLOR_S_NAME),
"Test decoder " SUBGHZ_PROTOCOL_NICE_FLOR_S_NAME " error\r\n");
}
MU_TEST(subghz_decoder_kinggates_stylo4k_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/kinggates_stylo4k_raw.sub"),
SUBGHZ_PROTOCOL_KINGGATES_STYLO_4K_NAME),
"Test decoder " SUBGHZ_PROTOCOL_KINGGATES_STYLO_4K_NAME " error\r\n");
}
//test encoders
@@ -484,6 +688,12 @@ MU_TEST(subghz_encoder_linear_test) {
"Test encoder " SUBGHZ_PROTOCOL_LINEAR_NAME " error\r\n");
}
MU_TEST(subghz_encoder_linear_delta3_test) {
mu_assert(
subghz_encoder_test(EXT_PATH("unit_tests/subghz/linear_delta3.sub")),
"Test encoder " SUBGHZ_PROTOCOL_LINEAR_DELTA3_NAME " error\r\n");
}
MU_TEST(subghz_encoder_megacode_test) {
mu_assert(
subghz_encoder_test(EXT_PATH("unit_tests/subghz/megacode.sub")),
@@ -544,10 +754,10 @@ MU_TEST(subghz_encoder_honeywell_wdb_test) {
"Test encoder " SUBGHZ_PROTOCOL_HONEYWELL_WDB_NAME " error\r\n");
}
MU_TEST(subghz_encoder_magellen_test) {
MU_TEST(subghz_encoder_magellan_test) {
mu_assert(
subghz_encoder_test(EXT_PATH("unit_tests/subghz/magellen.sub")),
"Test encoder " SUBGHZ_PROTOCOL_MAGELLEN_NAME " error\r\n");
subghz_encoder_test(EXT_PATH("unit_tests/subghz/magellan.sub")),
"Test encoder " SUBGHZ_PROTOCOL_MAGELLAN_NAME " error\r\n");
}
MU_TEST(subghz_encoder_intertechno_v3_test) {
@@ -562,6 +772,30 @@ MU_TEST(subghz_encoder_clemsa_test) {
"Test encoder " SUBGHZ_PROTOCOL_CLEMSA_NAME " error\r\n");
}
MU_TEST(subghz_encoder_ansonic_test) {
mu_assert(
subghz_encoder_test(EXT_PATH("unit_tests/subghz/ansonic.sub")),
"Test encoder " SUBGHZ_PROTOCOL_ANSONIC_NAME " error\r\n");
}
MU_TEST(subghz_encoder_smc5326_test) {
mu_assert(
subghz_encoder_test(EXT_PATH("unit_tests/subghz/smc5326.sub")),
"Test encoder " SUBGHZ_PROTOCOL_SMC5326_NAME " error\r\n");
}
MU_TEST(subghz_encoder_holtek_ht12x_test) {
mu_assert(
subghz_encoder_test(EXT_PATH("unit_tests/subghz/holtek_ht12x.sub")),
"Test encoder " SUBGHZ_PROTOCOL_HOLTEK_HT12X_NAME " error\r\n");
}
MU_TEST(subghz_encoder_dooya_test) {
mu_assert(
subghz_encoder_test(EXT_PATH("unit_tests/subghz/dooya.sub")),
"Test encoder " SUBGHZ_PROTOCOL_DOOYA_NAME " error\r\n");
}
MU_TEST(subghz_random_test) {
mu_assert(subghz_decode_random_test(TEST_RANDOM_DIR_NAME), "Random test error\r\n");
}
@@ -570,6 +804,8 @@ MU_TEST_SUITE(subghz) {
subghz_test_init();
MU_RUN_TEST(subghz_keystore_test);
MU_RUN_TEST(subghz_hal_async_tx_test);
MU_RUN_TEST(subghz_decoder_came_atomo_test);
MU_RUN_TEST(subghz_decoder_came_test);
MU_RUN_TEST(subghz_decoder_came_twee_test);
@@ -589,6 +825,7 @@ MU_TEST_SUITE(subghz) {
MU_RUN_TEST(subghz_decoder_somfy_telis_test);
MU_RUN_TEST(subghz_decoder_star_line_test);
MU_RUN_TEST(subghz_decoder_linear_test);
MU_RUN_TEST(subghz_decoder_linear_delta3_test);
MU_RUN_TEST(subghz_decoder_megacode_test);
MU_RUN_TEST(subghz_decoder_secplus_v1_test);
MU_RUN_TEST(subghz_decoder_secplus_v2_test);
@@ -599,10 +836,16 @@ MU_TEST_SUITE(subghz) {
MU_RUN_TEST(subghz_decoder_doitrand_test);
MU_RUN_TEST(subghz_decoder_phoenix_v2_test);
MU_RUN_TEST(subghz_decoder_honeywell_wdb_test);
MU_RUN_TEST(subghz_decoder_magellen_test);
MU_RUN_TEST(subghz_decoder_magellan_test);
MU_RUN_TEST(subghz_decoder_intertechno_v3_test);
MU_RUN_TEST(subghz_decoder_clemsa_test);
MU_RUN_TEST(subghz_decoder_oregon2_test);
MU_RUN_TEST(subghz_decoder_ansonic_test);
MU_RUN_TEST(subghz_decoder_smc5326_test);
MU_RUN_TEST(subghz_decoder_holtek_ht12x_test);
MU_RUN_TEST(subghz_decoder_dooya_test);
MU_RUN_TEST(subghz_decoder_alutech_at_4n_test);
MU_RUN_TEST(subghz_decoder_nice_one_test);
MU_RUN_TEST(subghz_decoder_kinggates_stylo4k_test);
MU_RUN_TEST(subghz_encoder_princeton_test);
MU_RUN_TEST(subghz_encoder_came_test);
@@ -611,6 +854,7 @@ MU_TEST_SUITE(subghz) {
MU_RUN_TEST(subghz_encoder_nice_flo_test);
MU_RUN_TEST(subghz_encoder_keelog_test);
MU_RUN_TEST(subghz_encoder_linear_test);
MU_RUN_TEST(subghz_encoder_linear_delta3_test);
MU_RUN_TEST(subghz_encoder_megacode_test);
MU_RUN_TEST(subghz_encoder_holtek_test);
MU_RUN_TEST(subghz_encoder_secplus_v1_test);
@@ -621,9 +865,13 @@ MU_TEST_SUITE(subghz) {
MU_RUN_TEST(subghz_encoder_doitrand_test);
MU_RUN_TEST(subghz_encoder_phoenix_v2_test);
MU_RUN_TEST(subghz_encoder_honeywell_wdb_test);
MU_RUN_TEST(subghz_encoder_magellen_test);
MU_RUN_TEST(subghz_encoder_magellan_test);
MU_RUN_TEST(subghz_encoder_intertechno_v3_test);
MU_RUN_TEST(subghz_encoder_clemsa_test);
MU_RUN_TEST(subghz_encoder_ansonic_test);
MU_RUN_TEST(subghz_encoder_smc5326_test);
MU_RUN_TEST(subghz_encoder_holtek_ht12x_test);
MU_RUN_TEST(subghz_encoder_dooya_test);
MU_RUN_TEST(subghz_random_test);
subghz_test_deinit();

View File

@@ -1,5 +1,3 @@
#include "m-string.h"
#include <stdio.h>
#include <furi.h>
#include <furi_hal.h>
@@ -11,18 +9,24 @@
#define TAG "UnitTests"
int run_minunit_test_furi();
int run_minunit_test_furi_hal();
int run_minunit_test_furi_string();
int run_minunit_test_infrared();
int run_minunit_test_rpc();
int run_minunit_test_manifest();
int run_minunit_test_flipper_format();
int run_minunit_test_flipper_format_string();
int run_minunit_test_stream();
int run_minunit_test_storage();
int run_minunit_test_subghz();
int run_minunit_test_dirwalk();
int run_minunit_test_power();
int run_minunit_test_protocol_dict();
int run_minunit_test_lfrfid_protocols();
int run_minunit_test_nfc();
int run_minunit_test_bit_lib();
int run_minunit_test_float_tools();
int run_minunit_test_bt();
typedef int (*UnitTestEntry)();
@@ -33,18 +37,24 @@ typedef struct {
const UnitTest unit_tests[] = {
{.name = "furi", .entry = run_minunit_test_furi},
{.name = "furi_hal", .entry = run_minunit_test_furi_hal},
{.name = "furi_string", .entry = run_minunit_test_furi_string},
{.name = "storage", .entry = run_minunit_test_storage},
{.name = "stream", .entry = run_minunit_test_stream},
{.name = "dirwalk", .entry = run_minunit_test_dirwalk},
{.name = "manifest", .entry = run_minunit_test_manifest},
{.name = "flipper_format", .entry = run_minunit_test_flipper_format},
{.name = "flipper_format_string", .entry = run_minunit_test_flipper_format_string},
{.name = "rpc", .entry = run_minunit_test_rpc},
{.name = "subghz", .entry = run_minunit_test_subghz},
{.name = "infrared", .entry = run_minunit_test_infrared},
{.name = "nfc", .entry = run_minunit_test_nfc},
{.name = "power", .entry = run_minunit_test_power},
{.name = "protocol_dict", .entry = run_minunit_test_protocol_dict},
{.name = "lfrfid", .entry = run_minunit_test_lfrfid_protocols},
{.name = "bit_lib", .entry = run_minunit_test_bit_lib},
{.name = "float_tools", .entry = run_minunit_test_float_tools},
{.name = "bt", .entry = run_minunit_test_bt},
};
void minunit_print_progress() {
@@ -60,14 +70,13 @@ void minunit_print_progress() {
}
void minunit_print_fail(const char* str) {
printf(FURI_LOG_CLR_E "%s\r\n" FURI_LOG_CLR_RESET, str);
printf(_FURI_LOG_CLR_E "%s\r\n" _FURI_LOG_CLR_RESET, str);
}
void unit_tests_cli(Cli* cli, string_t args, void* context) {
void unit_tests_cli(Cli* cli, FuriString* args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
uint32_t failed_tests = 0;
minunit_run = 0;
minunit_assert = 0;
minunit_fail = 0;
@@ -91,34 +100,37 @@ void unit_tests_cli(Cli* cli, string_t args, void* context) {
break;
}
if(string_size(args)) {
if(string_cmp_str(args, unit_tests[i].name) == 0) {
failed_tests += unit_tests[i].entry();
if(furi_string_size(args)) {
if(furi_string_cmp_str(args, unit_tests[i].name) == 0) {
unit_tests[i].entry();
} else {
printf("Skipping %s\r\n", unit_tests[i].name);
}
} else {
failed_tests += unit_tests[i].entry();
unit_tests[i].entry();
}
}
printf("\r\nFailed tests: %lu\r\n", failed_tests);
// Time report
cycle_counter = (furi_get_tick() - cycle_counter);
printf("Consumed: %lu ms\r\n", cycle_counter);
if(minunit_run != 0) {
printf("\r\nFailed tests: %u\r\n", minunit_fail);
// Wait for tested services and apps to deallocate memory
furi_delay_ms(200);
uint32_t heap_after = memmgr_get_free_heap();
printf("Leaked: %ld\r\n", heap_before - heap_after);
// Time report
cycle_counter = (furi_get_tick() - cycle_counter);
printf("Consumed: %lu ms\r\n", cycle_counter);
// Final Report
if(failed_tests == 0) {
notification_message(notification, &sequence_success);
printf("Status: PASSED\r\n");
} else {
notification_message(notification, &sequence_error);
printf("Status: FAILED\r\n");
// Wait for tested services and apps to deallocate memory
furi_delay_ms(200);
uint32_t heap_after = memmgr_get_free_heap();
printf("Leaked: %ld\r\n", heap_before - heap_after);
// Final Report
if(minunit_fail == 0) {
notification_message(notification, &sequence_success);
printf("Status: PASSED\r\n");
} else {
notification_message(notification, &sequence_error);
printf("Status: FAILED\r\n");
}
}
}

View File

@@ -1,12 +1,12 @@
App(
appid="USB_Mouse",
name="USB Mouse",
apptype=FlipperAppType.PLUGIN,
apptype=FlipperAppType.DEBUG,
entry_point="usb_mouse_app",
cdefines=["APP_USB_MOUSE"],
requires=["gui"],
stack_size=1 * 1024,
order=60,
fap_icon="../../plugins/mousejacker/mouse_10px.png",
fap_category="Misc",
fap_category="Debug",
)

View File

@@ -0,0 +1,5 @@
App(
appid="example_apps",
name="Example apps bundle",
apptype=FlipperAppType.METAPACKAGE,
)

View File

@@ -0,0 +1,24 @@
# Application icons
To use icons, do the following:
* add a line to the application manifest: `fap_icon_assets="folder"`, where `folder` points to the folder where your icons are located
* add `#include "application_id_icons.h"` to the application code, where `application_id` is the appid from the manifest
* every icon in the folder will be available as a `I_icon_name` variable, where `icon_name` is the name of the icon file without the extension
## Example
We have an application with the following manifest:
```
App(
appid="example_images",
...
fap_icon_assets="images",
)
```
So the icons are in the `images` folder and will be available in the generated `example_images_icons.h` file.
The example code is located in `example_images_main.c` and contains the following line:
```
#include "example_images_icons.h"
```
Image `dolphin_71x25.png` is available as `I_dolphin_71x25`.

View File

@@ -0,0 +1,10 @@
App(
appid="example_images",
name="Example: Images",
apptype=FlipperAppType.EXTERNAL,
entry_point="example_images_main",
requires=["gui"],
stack_size=1 * 1024,
fap_category="Examples",
fap_icon_assets="images",
)

View File

@@ -0,0 +1,81 @@
#include <furi.h>
#include <furi_hal.h>
#include <gui/gui.h>
#include <input/input.h>
/* Magic happens here -- this file is generated by fbt.
* Just set fap_icon_assets in application.fam and #include {APPID}_icons.h */
#include "example_images_icons.h"
typedef struct {
uint8_t x, y;
} ImagePosition;
static ImagePosition image_position = {.x = 0, .y = 0};
// Screen is 128x64 px
static void app_draw_callback(Canvas* canvas, void* ctx) {
UNUSED(ctx);
canvas_clear(canvas);
canvas_draw_icon(canvas, image_position.x % 128, image_position.y % 64, &I_dolphin_71x25);
}
static void app_input_callback(InputEvent* input_event, void* ctx) {
furi_assert(ctx);
FuriMessageQueue* event_queue = ctx;
furi_message_queue_put(event_queue, input_event, FuriWaitForever);
}
int32_t example_images_main(void* p) {
UNUSED(p);
FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
// Configure view port
ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, app_draw_callback, view_port);
view_port_input_callback_set(view_port, app_input_callback, event_queue);
// Register view port in GUI
Gui* gui = furi_record_open(RECORD_GUI);
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
InputEvent event;
bool running = true;
while(running) {
if(furi_message_queue_get(event_queue, &event, 100) == FuriStatusOk) {
if((event.type == InputTypePress) || (event.type == InputTypeRepeat)) {
switch(event.key) {
case InputKeyLeft:
image_position.x -= 2;
break;
case InputKeyRight:
image_position.x += 2;
break;
case InputKeyUp:
image_position.y -= 2;
break;
case InputKeyDown:
image_position.y += 2;
break;
default:
running = false;
break;
}
}
}
view_port_update(view_port);
}
view_port_enabled_set(view_port, false);
gui_remove_view_port(gui, view_port);
view_port_free(view_port);
furi_message_queue_free(event_queue);
furi_record_close(RECORD_GUI);
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,44 @@
# 1-Wire Thermometer
This example application demonstrates the use of the 1-Wire library with a DS18B20 thermometer.
It also covers basic GUI, input handling, threads and localisation.
## Electrical connections
Before launching the application, connect the sensor to Flipper's external GPIO according to the table below:
| DS18B20 | Flipper |
| :-----: | :-----: |
| VDD | 9 |
| GND | 18 |
| DQ | 17 |
*NOTE 1*: GND is also available on pins 8 and 11.
*NOTE 2*: For any other pin than 17, connect an external 4.7k pull-up resistor to pin 9.
## Launching the application
In order to launch this demo, follow the steps below:
1. Make sure your Flipper has an SD card installed.
2. Connect your Flipper to the computer via a USB cable.
3. Run `./fbt launch_app APPSRC=example_thermo` in your terminal emulator of choice.
## Changing the data pin
It is possible to use other GPIO pin as a 1-Wire data pin. In order to change it, set the `THERMO_GPIO_PIN` macro to any of the options listed below:
```c
/* Possible GPIO pin choices:
- gpio_ext_pc0
- gpio_ext_pc1
- gpio_ext_pc3
- gpio_ext_pb2
- gpio_ext_pb3
- gpio_ext_pa4
- gpio_ext_pa6
- gpio_ext_pa7
- ibutton_gpio
*/
#define THERMO_GPIO_PIN (ibutton_gpio)
```
Do not forget about the external pull-up resistor as these pins do not have one built-in.
With the changes been made, recompile and launch the application again.
The on-screen text should reflect it by asking to connect the thermometer to another pin.

View File

@@ -0,0 +1,10 @@
App(
appid="example_thermo",
name="Example: Thermometer",
apptype=FlipperAppType.EXTERNAL,
entry_point="example_thermo_main",
requires=["gui"],
stack_size=1 * 1024,
fap_icon="example_thermo_10px.png",
fap_category="Examples",
)

View File

@@ -0,0 +1,356 @@
/*
* This file contains an example application that reads and displays
* the temperature from a DS18B20 1-wire thermometer.
*
* It also covers basic GUI, input handling, threads and localisation.
*
* References:
* [1] DS18B20 Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/DS18B20.pdf
*/
#include <gui/gui.h>
#include <gui/view_port.h>
#include <core/thread.h>
#include <core/kernel.h>
#include <locale/locale.h>
#include <one_wire/maxim_crc.h>
#include <one_wire/one_wire_host.h>
#define UPDATE_PERIOD_MS 1000UL
#define TEXT_STORE_SIZE 64U
#define DS18B20_CMD_CONVERT 0x44U
#define DS18B20_CMD_READ_SCRATCHPAD 0xbeU
#define DS18B20_CFG_RESOLUTION_POS 5U
#define DS18B20_CFG_RESOLUTION_MASK 0x03U
#define DS18B20_DECIMAL_PART_MASK 0x0fU
#define DS18B20_SIGN_MASK 0xf0U
/* Possible GPIO pin choices:
- gpio_ext_pc0
- gpio_ext_pc1
- gpio_ext_pc3
- gpio_ext_pb2
- gpio_ext_pb3
- gpio_ext_pa4
- gpio_ext_pa6
- gpio_ext_pa7
- ibutton_gpio
*/
#define THERMO_GPIO_PIN (ibutton_gpio)
/* Flags which the reader thread responds to */
typedef enum {
ReaderThreadFlagExit = 1,
} ReaderThreadFlag;
typedef union {
struct {
uint8_t temp_lsb; /* Least significant byte of the temperature */
uint8_t temp_msb; /* Most significant byte of the temperature */
uint8_t user_alarm_high; /* User register 1 (Temp high alarm) */
uint8_t user_alarm_low; /* User register 2 (Temp low alarm) */
uint8_t config; /* Configuration register */
uint8_t reserved[3]; /* Not used */
uint8_t crc; /* CRC checksum for error detection */
} fields;
uint8_t bytes[9];
} DS18B20Scratchpad;
/* Application context structure */
typedef struct {
Gui* gui;
ViewPort* view_port;
FuriThread* reader_thread;
FuriMessageQueue* event_queue;
OneWireHost* onewire;
float temp_celsius;
bool has_device;
} ExampleThermoContext;
/*************** 1-Wire Communication and Processing *****************/
/* Commands the thermometer to begin measuring the temperature. */
static void example_thermo_request_temperature(ExampleThermoContext* context) {
OneWireHost* onewire = context->onewire;
/* All 1-wire transactions must happen in a critical section, i.e
not interrupted by other threads. */
FURI_CRITICAL_ENTER();
bool success = false;
do {
/* Each communication with a 1-wire device starts by a reset.
The functon will return true if a device responded with a presence pulse. */
if(!onewire_host_reset(onewire)) break;
/* After the reset, a ROM operation must follow.
If there is only one device connected, the "Skip ROM" command is most appropriate
(it can also be used to address all of the connected devices in some cases).*/
onewire_host_skip(onewire);
/* After the ROM operation, a device-specific command is issued.
In this case, it's a request to start measuring the temperature. */
onewire_host_write(onewire, DS18B20_CMD_CONVERT);
success = true;
} while(false);
context->has_device = success;
FURI_CRITICAL_EXIT();
}
/* Reads the measured temperature from the thermometer. */
static void example_thermo_read_temperature(ExampleThermoContext* context) {
/* If there was no device detected, don't try to read the temperature */
if(!context->has_device) {
return;
}
OneWireHost* onewire = context->onewire;
/* All 1-wire transactions must happen in a critical section, i.e
not interrupted by other threads. */
FURI_CRITICAL_ENTER();
bool success = false;
do {
DS18B20Scratchpad buf;
/* Attempt reading the temperature 10 times before giving up */
size_t attempts_left = 10;
do {
/* Each communication with a 1-wire device starts by a reset.
The functon will return true if a device responded with a presence pulse. */
if(!onewire_host_reset(onewire)) continue;
/* After the reset, a ROM operation must follow.
If there is only one device connected, the "Skip ROM" command is most appropriate
(it can also be used to address all of the connected devices in some cases).*/
onewire_host_skip(onewire);
/* After the ROM operation, a device-specific command is issued.
This time, it will be the "Read Scratchpad" command which will
prepare the device's internal buffer memory for reading. */
onewire_host_write(onewire, DS18B20_CMD_READ_SCRATCHPAD);
/* The actual reading happens here. A total of 9 bytes is read. */
onewire_host_read_bytes(onewire, buf.bytes, sizeof(buf.bytes));
/* Calculate the checksum and compare it with one provided by the device. */
const uint8_t crc = maxim_crc8(buf.bytes, sizeof(buf.bytes) - 1, MAXIM_CRC8_INIT);
/* Checksums match, exit the loop */
if(crc == buf.fields.crc) break;
} while(--attempts_left);
if(attempts_left == 0) break;
/* Get the measurement resolution from the configuration register. (See [1] page 9) */
const uint8_t resolution_mode = (buf.fields.config >> DS18B20_CFG_RESOLUTION_POS) &
DS18B20_CFG_RESOLUTION_MASK;
/* Generate a mask for undefined bits in the decimal part. (See [1] page 6) */
const uint8_t decimal_mask =
(DS18B20_DECIMAL_PART_MASK << (DS18B20_CFG_RESOLUTION_MASK - resolution_mode)) &
DS18B20_DECIMAL_PART_MASK;
/* Get the integer and decimal part of the temperature (See [1] page 6) */
const uint8_t integer_part = (buf.fields.temp_msb << 4U) | (buf.fields.temp_lsb >> 4U);
const uint8_t decimal_part = buf.fields.temp_lsb & decimal_mask;
/* Calculate the sign of the temperature (See [1] page 6) */
const bool is_negative = (buf.fields.temp_msb & DS18B20_SIGN_MASK) != 0;
/* Combine the integer and decimal part together */
const float temp_celsius_abs = integer_part + decimal_part / 16.f;
/* Set the appropriate sign */
context->temp_celsius = is_negative ? -temp_celsius_abs : temp_celsius_abs;
success = true;
} while(false);
context->has_device = success;
FURI_CRITICAL_EXIT();
}
/* Periodically requests measurements and reads temperature. This function runs in a separare thread. */
static int32_t example_thermo_reader_thread_callback(void* ctx) {
ExampleThermoContext* context = ctx;
for(;;) {
/* Tell the termometer to start measuring the temperature. The process may take up to 750ms. */
example_thermo_request_temperature(context);
/* Wait for the measurement to finish. At the same time wait for an exit signal. */
const uint32_t flags =
furi_thread_flags_wait(ReaderThreadFlagExit, FuriFlagWaitAny, UPDATE_PERIOD_MS);
/* If an exit signal was received, return from this thread. */
if(flags != (unsigned)FuriFlagErrorTimeout) break;
/* The measurement is now ready, read it from the termometer. */
example_thermo_read_temperature(context);
}
return 0;
}
/*************** GUI, Input and Main Loop *****************/
/* Draw the GUI of the application. The screen is completely redrawn during each call. */
static void example_thermo_draw_callback(Canvas* canvas, void* ctx) {
ExampleThermoContext* context = ctx;
char text_store[TEXT_STORE_SIZE];
const size_t middle_x = canvas_width(canvas) / 2U;
canvas_set_font(canvas, FontPrimary);
canvas_draw_str_aligned(canvas, middle_x, 12, AlignCenter, AlignBottom, "Thermometer Demo");
canvas_draw_line(canvas, 0, 16, 128, 16);
canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned(
canvas, middle_x, 30, AlignCenter, AlignBottom, "Connnect thermometer");
snprintf(
text_store,
TEXT_STORE_SIZE,
"to GPIO pin %ld",
furi_hal_resources_get_ext_pin_number(&THERMO_GPIO_PIN));
canvas_draw_str_aligned(canvas, middle_x, 42, AlignCenter, AlignBottom, text_store);
canvas_set_font(canvas, FontKeyboard);
if(context->has_device) {
float temp;
char temp_units;
/* The applicaton is locale-aware.
Change Settings->System->Units to check it out. */
switch(locale_get_measurement_unit()) {
case LocaleMeasurementUnitsMetric:
temp = context->temp_celsius;
temp_units = 'C';
break;
case LocaleMeasurementUnitsImperial:
temp = locale_celsius_to_fahrenheit(context->temp_celsius);
temp_units = 'F';
break;
default:
furi_crash("Illegal measurement units");
}
/* If a reading is available, display it */
snprintf(text_store, TEXT_STORE_SIZE, "Temperature: %+.1f%c", (double)temp, temp_units);
} else {
/* Or show a message that no data is available */
strncpy(text_store, "-- No data --", TEXT_STORE_SIZE);
}
canvas_draw_str_aligned(canvas, middle_x, 58, AlignCenter, AlignBottom, text_store);
}
/* This function is called from the GUI thread. All it does is put the event
into the application's queue so it can be processed later. */
static void example_thermo_input_callback(InputEvent* event, void* ctx) {
ExampleThermoContext* context = ctx;
furi_message_queue_put(context->event_queue, event, FuriWaitForever);
}
/* Starts the reader thread and handles the input */
static void example_thermo_run(ExampleThermoContext* context) {
/* Configure the hardware in host mode */
onewire_host_start(context->onewire);
/* Start the reader thread. It will talk to the thermometer in the background. */
furi_thread_start(context->reader_thread);
/* An endless loop which handles the input*/
for(bool is_running = true; is_running;) {
InputEvent event;
/* Wait for an input event. Input events come from the GUI thread via a callback. */
const FuriStatus status =
furi_message_queue_get(context->event_queue, &event, FuriWaitForever);
/* This application is only interested in short button presses. */
if((status != FuriStatusOk) || (event.type != InputTypeShort)) {
continue;
}
/* When the user presses the "Back" button, break the loop and exit the application. */
if(event.key == InputKeyBack) {
is_running = false;
}
}
/* Signal the reader thread to cease operation and exit */
furi_thread_flags_set(furi_thread_get_id(context->reader_thread), ReaderThreadFlagExit);
/* Wait for the reader thread to finish */
furi_thread_join(context->reader_thread);
/* Reset the hardware */
onewire_host_stop(context->onewire);
}
/******************** Initialisation & startup *****************************/
/* Allocate the memory and initialise the variables */
static ExampleThermoContext* example_thermo_context_alloc() {
ExampleThermoContext* context = malloc(sizeof(ExampleThermoContext));
context->view_port = view_port_alloc();
view_port_draw_callback_set(context->view_port, example_thermo_draw_callback, context);
view_port_input_callback_set(context->view_port, example_thermo_input_callback, context);
context->event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
context->reader_thread = furi_thread_alloc();
furi_thread_set_stack_size(context->reader_thread, 1024U);
furi_thread_set_context(context->reader_thread, context);
furi_thread_set_callback(context->reader_thread, example_thermo_reader_thread_callback);
context->gui = furi_record_open(RECORD_GUI);
gui_add_view_port(context->gui, context->view_port, GuiLayerFullscreen);
context->onewire = onewire_host_alloc(&THERMO_GPIO_PIN);
return context;
}
/* Release the unused resources and deallocate memory */
static void example_thermo_context_free(ExampleThermoContext* context) {
view_port_enabled_set(context->view_port, false);
gui_remove_view_port(context->gui, context->view_port);
onewire_host_free(context->onewire);
furi_thread_free(context->reader_thread);
furi_message_queue_free(context->event_queue);
view_port_free(context->view_port);
furi_record_close(RECORD_GUI);
}
/* The application's entry point. Execution starts from here. */
int32_t example_thermo_main(void* p) {
UNUSED(p);
/* Allocate all of the necessary structures */
ExampleThermoContext* context = example_thermo_context_alloc();
/* Start the applicaton's main loop. It won't return until the application was requested to exit. */
example_thermo_run(context);
/* Release all unneeded resources */
example_thermo_context_free(context);
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -5,7 +5,7 @@ App(
entry_point="archive_app",
cdefines=["APP_ARCHIVE"],
requires=["gui"],
stack_size=4 * 1024,
stack_size=6 * 1024,
icon="A_FileManager_14",
order=0,
)

View File

@@ -21,7 +21,7 @@ static void archive_tick_event_callback(void* context) {
static ArchiveApp* archive_alloc() {
ArchiveApp* archive = malloc(sizeof(ArchiveApp));
string_init(archive->fav_move_str);
archive->fav_move_str = furi_string_alloc();
archive->scene_manager = scene_manager_alloc(&archive_scene_handlers, archive);
archive->view_dispatcher = view_dispatcher_alloc();
@@ -81,7 +81,7 @@ void archive_free(ArchiveApp* archive) {
scene_manager_free(archive->scene_manager);
browser_free(archive->browser);
string_clear(archive->fav_move_str);
furi_string_free(archive->fav_move_str);
furi_record_close(RECORD_DIALOGS);
archive->dialogs = NULL;

View File

@@ -36,7 +36,7 @@ struct ArchiveApp {
Loading* loading;
FuriPubSubSubscription* loader_stop_subscription;
string_t fav_move_str;
FuriString* fav_move_str;
char text_store[MAX_NAME_LEN];
char file_extension[MAX_EXT_LEN + 1];
};

View File

@@ -13,7 +13,7 @@ ArchiveAppTypeEnum archive_get_app_type(const char* path) {
}
app_name++;
for(size_t i = 0; i < COUNT_OF(known_apps); i++) {
for(size_t i = 0; i < COUNT_OF(known_apps); i++) { //-V1008
if(strncmp(app_name, known_apps[i], strlen(known_apps[i])) == 0) {
return i;
}

View File

@@ -1,12 +1,14 @@
#include <archive/views/archive_browser_view.h>
#include "archive_files.h"
#include "archive_apps.h"
#include "archive_browser.h"
#include "../views/archive_browser_view.h"
#include <core/common_defines.h>
#include <core/log.h>
#include "gui/modules/file_browser_worker.h"
#include "m-string.h"
#include <gui/modules/file_browser_worker.h>
#include <fap_loader/fap_loader_app.h>
#include <math.h>
#include <furi_hal.h>
static void
archive_folder_open_cb(void* context, uint32_t item_cnt, int32_t file_idx, bool is_root) {
@@ -19,9 +21,11 @@ static void
if((item_cnt == 0) && (archive_is_home(browser)) && (tab != ArchiveTabBrowser)) {
archive_switch_tab(browser, browser->last_tab_switch_dir);
} else if(!string_start_with_str_p(browser->path, "/app:")) {
} else if(!furi_string_start_with_str(browser->path, "/app:")) {
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
files_array_reset(model->files);
model->item_cnt = item_cnt;
model->item_idx = (file_idx > 0) ? file_idx : 0;
@@ -31,8 +35,8 @@ static void
model->list_offset = 0;
model->list_loading = true;
model->folder_loading = false;
return false;
});
},
false);
archive_update_offset(browser);
file_browser_worker_load(browser->worker, load_offset, FILE_LIST_BUF_LEN);
@@ -44,25 +48,38 @@ static void archive_list_load_cb(void* context, uint32_t list_load_offset) {
ArchiveBrowserView* browser = (ArchiveBrowserView*)context;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
files_array_reset(model->files);
model->array_offset = list_load_offset;
return false;
});
},
false);
}
static void archive_list_item_cb(void* context, string_t item_path, bool is_folder, bool is_last) {
static void archive_list_item_cb(
void* context,
FuriString* item_path,
uint32_t idx,
bool is_folder,
bool is_last) {
furi_assert(context);
UNUSED(idx);
ArchiveBrowserView* browser = (ArchiveBrowserView*)context;
if(!is_last) {
archive_add_file_item(browser, is_folder, string_get_cstr(item_path));
archive_add_file_item(browser, is_folder, furi_string_get_cstr(item_path));
} else {
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
if(model->item_cnt <= BROWSER_SORT_THRESHOLD) {
files_array_sort(model->files);
}
model->list_loading = false;
return true;
});
},
true);
}
}
@@ -71,20 +88,19 @@ static void archive_long_load_cb(void* context) {
ArchiveBrowserView* browser = (ArchiveBrowserView*)context;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
model->folder_loading = true;
return true;
});
browser->view, ArchiveBrowserViewModel * model, { model->folder_loading = true; }, true);
}
static void archive_file_browser_set_path(
ArchiveBrowserView* browser,
string_t path,
FuriString* path,
const char* filter_ext,
bool skip_assets) {
bool skip_assets,
bool hide_dot_files) {
furi_assert(browser);
if(!browser->worker_running) {
browser->worker = file_browser_worker_alloc(path, filter_ext, skip_assets);
browser->worker =
file_browser_worker_alloc(path, NULL, filter_ext, skip_assets, hide_dot_files);
file_browser_worker_set_callback_context(browser->worker, browser);
file_browser_worker_set_folder_callback(browser->worker, archive_folder_open_cb);
file_browser_worker_set_list_callback(browser->worker, archive_list_load_cb);
@@ -93,7 +109,8 @@ static void archive_file_browser_set_path(
browser->worker_running = true;
} else {
furi_assert(browser->worker);
file_browser_worker_set_config(browser->worker, path, filter_ext, skip_assets);
file_browser_worker_set_config(
browser->worker, path, filter_ext, skip_assets, hide_dot_files);
}
}
@@ -112,7 +129,9 @@ void archive_update_offset(ArchiveBrowserView* browser) {
furi_assert(browser);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
uint16_t bounds = model->item_cnt > 3 ? 2 : model->item_cnt;
if((model->item_cnt > 3u) && (model->item_idx >= ((int32_t)model->item_cnt - 1))) {
@@ -124,33 +143,34 @@ void archive_update_offset(ArchiveBrowserView* browser) {
model->list_offset =
CLAMP(model->item_idx - 1, (int32_t)model->item_cnt - bounds, 0);
}
return true;
});
},
true);
}
void archive_update_focus(ArchiveBrowserView* browser, const char* target) {
furi_assert(browser);
furi_assert(target);
archive_get_items(browser, string_get_cstr(browser->path));
archive_get_items(browser, furi_string_get_cstr(browser->path));
if(!archive_file_get_array_size(browser) && archive_is_home(browser)) {
archive_switch_tab(browser, TAB_RIGHT);
archive_switch_tab(browser, TAB_LEFT);
} else {
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
uint16_t idx = 0;
while(idx < files_array_size(model->files)) {
ArchiveFile_t* current = files_array_get(model->files, idx);
if(!string_search(current->path, target)) {
if(!furi_string_search(current->path, target)) {
model->item_idx = idx + model->array_offset;
break;
}
++idx;
}
return false;
});
},
false);
archive_update_offset(browser);
}
@@ -161,10 +181,10 @@ size_t archive_file_get_array_size(ArchiveBrowserView* browser) {
uint16_t size = 0;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
size = files_array_size(model->files);
return false;
});
browser->view,
ArchiveBrowserViewModel * model,
{ size = files_array_size(model->files); },
false);
return size;
}
@@ -172,11 +192,13 @@ void archive_set_item_count(ArchiveBrowserView* browser, uint32_t count) {
furi_assert(browser);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
model->item_cnt = count;
model->item_idx = CLAMP(model->item_idx, (int32_t)model->item_cnt - 1, 0);
return false;
});
},
false);
archive_update_offset(browser);
}
@@ -185,7 +207,9 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) {
uint32_t items_cnt = 0;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
files_array_remove_v(
model->files,
model->item_idx - model->array_offset,
@@ -193,11 +217,11 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) {
model->item_cnt--;
model->item_idx = CLAMP(model->item_idx, (int32_t)model->item_cnt - 1, 0);
items_cnt = model->item_cnt;
return false;
});
},
false);
if((items_cnt == 0) && (archive_is_home(browser))) {
archive_switch_tab(browser, TAB_RIGHT);
archive_switch_tab(browser, TAB_LEFT);
}
archive_update_offset(browser);
@@ -207,7 +231,9 @@ void archive_file_array_swap(ArchiveBrowserView* browser, int8_t dir) {
furi_assert(browser);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
ArchiveFile_t temp;
size_t array_size = files_array_size(model->files) - 1;
uint8_t swap_idx = CLAMP((size_t)(model->item_idx + dir), array_size, 0u);
@@ -225,18 +251,18 @@ void archive_file_array_swap(ArchiveBrowserView* browser, int8_t dir) {
} else {
files_array_swap_at(model->files, model->item_idx, swap_idx);
}
return false;
});
},
false);
}
void archive_file_array_rm_all(ArchiveBrowserView* browser) {
furi_assert(browser);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
files_array_reset(model->files);
return false;
});
browser->view,
ArchiveBrowserViewModel * model,
{ files_array_reset(model->files); },
false);
}
void archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) {
@@ -245,7 +271,9 @@ void archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) {
int32_t offset_new = 0;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
if(model->item_cnt > FILE_LIST_BUF_LEN) {
if(dir < 0) {
offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 3;
@@ -255,14 +283,13 @@ void archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) {
offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 1;
}
if(offset_new > 0) {
offset_new =
CLAMP(offset_new, (int32_t)model->item_cnt - FILE_LIST_BUF_LEN, 0);
offset_new = CLAMP(offset_new, (int32_t)model->item_cnt, 0);
} else {
offset_new = 0;
}
}
return false;
});
},
false);
file_browser_worker_load(browser->worker, offset_new, FILE_LIST_BUF_LEN);
}
@@ -272,12 +299,14 @@ ArchiveFile_t* archive_get_current_file(ArchiveBrowserView* browser) {
ArchiveFile_t* selected = NULL;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
selected = files_array_size(model->files) ?
files_array_get(model->files, model->item_idx - model->array_offset) :
NULL;
return false;
});
},
false);
return selected;
}
@@ -287,11 +316,13 @@ ArchiveFile_t* archive_get_file_at(ArchiveBrowserView* browser, size_t idx) {
ArchiveFile_t* selected = NULL;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
idx = CLAMP(idx - model->array_offset, files_array_size(model->files), 0u);
selected = files_array_size(model->files) ? files_array_get(model->files, idx) : NULL;
return false;
});
},
false);
return selected;
}
@@ -300,10 +331,7 @@ ArchiveTabEnum archive_get_tab(ArchiveBrowserView* browser) {
ArchiveTabEnum tab_id = 0;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
tab_id = model->tab_idx;
return false;
});
browser->view, ArchiveBrowserViewModel * model, { tab_id = model->tab_idx; }, false);
return tab_id;
}
@@ -315,22 +343,19 @@ bool archive_is_home(ArchiveBrowserView* browser) {
}
const char* default_path = archive_get_default_path(archive_get_tab(browser));
return (string_cmp_str(browser->path, default_path) == 0);
return (furi_string_cmp_str(browser->path, default_path) == 0);
}
const char* archive_get_name(ArchiveBrowserView* browser) {
ArchiveFile_t* selected = archive_get_current_file(browser);
return string_get_cstr(selected->path);
return furi_string_get_cstr(selected->path);
}
void archive_set_tab(ArchiveBrowserView* browser, ArchiveTabEnum tab) {
furi_assert(browser);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
model->tab_idx = tab;
return false;
});
browser->view, ArchiveBrowserViewModel * model, { model->tab_idx = tab; }, false);
}
void archive_add_app_item(ArchiveBrowserView* browser, const char* name) {
@@ -339,40 +364,60 @@ void archive_add_app_item(ArchiveBrowserView* browser, const char* name) {
ArchiveFile_t item;
ArchiveFile_t_init(&item);
string_set_str(item.path, name);
furi_string_set(item.path, name);
archive_set_file_type(&item, name, false, true);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
files_array_push_back(model->files, item);
model->item_cnt = files_array_size(model->files);
return false;
});
},
false);
ArchiveFile_t_clear(&item);
}
static bool archive_get_fap_meta(FuriString* file_path, FuriString* fap_name, uint8_t** icon_ptr) {
Storage* storage = furi_record_open(RECORD_STORAGE);
bool success = false;
if(fap_loader_load_name_and_icon(file_path, storage, icon_ptr, fap_name)) {
success = true;
}
furi_record_close(RECORD_STORAGE);
return success;
}
void archive_add_file_item(ArchiveBrowserView* browser, bool is_folder, const char* name) {
furi_assert(browser);
furi_assert(name);
ArchiveFile_t item;
ArchiveFile_t_init(&item);
string_init_set_str(item.path, name);
archive_set_file_type(&item, string_get_cstr(browser->path), is_folder, false);
furi_string_set(item.path, name);
archive_set_file_type(&item, furi_string_get_cstr(browser->path), is_folder, false);
if(item.type == ArchiveFileTypeApplication) {
item.custom_icon_data = malloc(FAP_MANIFEST_MAX_ICON_SIZE);
if(!archive_get_fap_meta(item.path, item.custom_name, &item.custom_icon_data)) {
free(item.custom_icon_data);
item.custom_icon_data = NULL;
}
}
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
files_array_push_back(model->files, item);
return false;
});
browser->view,
ArchiveBrowserViewModel * model,
{ files_array_push_back(model->files, item); },
false);
ArchiveFile_t_clear(&item);
}
void archive_show_file_menu(ArchiveBrowserView* browser, bool show) {
furi_assert(browser);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
if(show) {
if(archive_is_item_in_array(model, model->item_idx)) {
model->menu = true;
@@ -380,35 +425,32 @@ void archive_show_file_menu(ArchiveBrowserView* browser, bool show) {
menu_array_reset(model->context_menu);
ArchiveFile_t* selected =
files_array_get(model->files, model->item_idx - model->array_offset);
selected->fav = archive_is_favorite("%s", string_get_cstr(selected->path));
selected->fav =
archive_is_favorite("%s", furi_string_get_cstr(selected->path));
}
} else {
model->menu = false;
model->menu_idx = 0;
}
return true;
});
},
true);
}
void archive_favorites_move_mode(ArchiveBrowserView* browser, bool active) {
furi_assert(browser);
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
model->move_fav = active;
return true;
});
browser->view, ArchiveBrowserViewModel * model, { model->move_fav = active; }, true);
}
static bool archive_is_dir_exists(string_t path) {
if(string_equal_str_p(path, STORAGE_ANY_PATH_PREFIX)) {
static bool archive_is_dir_exists(FuriString* path) {
if(furi_string_equal(path, STORAGE_ANY_PATH_PREFIX)) {
return true;
}
bool state = false;
FileInfo file_info;
Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_common_stat(storage, string_get_cstr(path), &file_info) == FSE_OK) {
if(storage_common_stat(storage, furi_string_get_cstr(path), &file_info) == FSE_OK) {
if(file_info.flags & FSF_DIRECTORY) {
state = true;
}
@@ -428,20 +470,27 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
} else {
tab = (tab + 1) % ArchiveTabTotal;
}
if(tab == ArchiveTabInternal && !furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
if(key == InputKeyLeft) {
tab = ((tab - 1) + ArchiveTabTotal) % ArchiveTabTotal;
} else {
tab = (tab + 1) % ArchiveTabTotal;
}
}
browser->is_root = true;
archive_set_tab(browser, tab);
string_set_str(browser->path, archive_get_default_path(tab));
furi_string_set(browser->path, archive_get_default_path(tab));
bool tab_empty = true;
if(tab == ArchiveTabFavorites) {
if(archive_favorites_count(browser) > 0) {
tab_empty = false;
}
} else if(string_start_with_str_p(browser->path, "/app:")) {
char* app_name = strchr(string_get_cstr(browser->path), ':');
} else if(furi_string_start_with_str(browser->path, "/app:")) {
char* app_name = strchr(furi_string_get_cstr(browser->path), ':');
if(app_name != NULL) {
if(archive_app_is_available(browser, string_get_cstr(browser->path))) {
if(archive_app_is_available(browser, furi_string_get_cstr(browser->path))) {
tab_empty = false;
}
}
@@ -449,8 +498,10 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
tab = archive_get_tab(browser);
if(archive_is_dir_exists(browser->path)) {
bool skip_assets = (strcmp(archive_get_tab_ext(tab), "*") == 0) ? false : true;
// Hide dot files everywhere except Browser
bool hide_dot_files = (strcmp(archive_get_tab_ext(tab), "*") == 0) ? false : true;
archive_file_browser_set_path(
browser, browser->path, archive_get_tab_ext(tab), skip_assets);
browser, browser->path, archive_get_tab_ext(tab), skip_assets, hide_dot_files);
tab_empty = false; // Empty check will be performed later
}
}
@@ -459,29 +510,28 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
archive_switch_tab(browser, key);
} else {
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
browser->view,
ArchiveBrowserViewModel * model,
{
model->item_idx = 0;
model->array_offset = 0;
return false;
});
archive_get_items(browser, string_get_cstr(browser->path));
},
false);
archive_get_items(browser, furi_string_get_cstr(browser->path));
archive_update_offset(browser);
}
}
void archive_enter_dir(ArchiveBrowserView* browser, string_t path) {
void archive_enter_dir(ArchiveBrowserView* browser, FuriString* path) {
furi_assert(browser);
furi_assert(path);
int32_t idx_temp = 0;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
idx_temp = model->item_idx;
return false;
});
browser->view, ArchiveBrowserViewModel * model, { idx_temp = model->item_idx; }, false);
string_set(browser->path, path);
furi_string_set(browser->path, path);
file_browser_worker_folder_enter(browser->worker, path, idx_temp);
}
@@ -497,9 +547,6 @@ void archive_refresh_dir(ArchiveBrowserView* browser) {
int32_t idx_temp = 0;
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
idx_temp = model->item_idx;
return false;
});
browser->view, ArchiveBrowserViewModel * model, { idx_temp = model->item_idx; }, false);
file_browser_worker_folder_refresh(browser->worker, idx_temp);
}

View File

@@ -3,9 +3,9 @@
#include "../archive_i.h"
#include <storage/storage.h>
#define TAB_RIGHT InputKeyRight // Default tab swith direction
#define TAB_LEFT InputKeyLeft // Default tab switch direction
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
#define FILE_LIST_BUF_LEN 100
#define FILE_LIST_BUF_LEN 50
static const char* tab_default_paths[] = {
[ArchiveTabFavorites] = "/app:favorites",
@@ -16,7 +16,8 @@ static const char* tab_default_paths[] = {
[ArchiveTabInfrared] = ANY_PATH("infrared"),
[ArchiveTabBadUsb] = ANY_PATH("badusb"),
[ArchiveTabU2f] = "/app:u2f",
[ArchiveTabApps] = ANY_PATH("apps"),
[ArchiveTabApplications] = ANY_PATH("apps"),
[ArchiveTabInternal] = STORAGE_INT_PATH_PREFIX,
[ArchiveTabBrowser] = STORAGE_ANY_PATH_PREFIX,
};
@@ -28,7 +29,7 @@ static const char* known_ext[] = {
[ArchiveFileTypeInfrared] = ".ir",
[ArchiveFileTypeBadUsb] = ".txt",
[ArchiveFileTypeU2f] = "?",
[ArchiveFileTypeApps] = ".fap",
[ArchiveFileTypeApplication] = ".fap",
[ArchiveFileTypeUpdateManifest] = ".fuf",
[ArchiveFileTypeFolder] = "?",
[ArchiveFileTypeUnknown] = "*",
@@ -43,7 +44,8 @@ static const ArchiveFileTypeEnum known_type[] = {
[ArchiveTabInfrared] = ArchiveFileTypeInfrared,
[ArchiveTabBadUsb] = ArchiveFileTypeBadUsb,
[ArchiveTabU2f] = ArchiveFileTypeU2f,
[ArchiveTabApps] = ArchiveFileTypeApps,
[ArchiveTabApplications] = ArchiveFileTypeApplication,
[ArchiveTabInternal] = ArchiveFileTypeUnknown,
[ArchiveTabBrowser] = ArchiveFileTypeUnknown,
};
@@ -87,6 +89,6 @@ void archive_show_file_menu(ArchiveBrowserView* browser, bool show);
void archive_favorites_move_mode(ArchiveBrowserView* browser, bool active);
void archive_switch_tab(ArchiveBrowserView* browser, InputKey key);
void archive_enter_dir(ArchiveBrowserView* browser, string_t name);
void archive_enter_dir(ArchiveBrowserView* browser, FuriString* name);
void archive_leave_dir(ArchiveBrowserView* browser);
void archive_refresh_dir(ArchiveBrowserView* browser);

View File

@@ -6,8 +6,8 @@
#define ARCHIVE_FAV_FILE_BUF_LEN 32
static bool archive_favorites_read_line(File* file, string_t str_result) {
string_reset(str_result);
static bool archive_favorites_read_line(File* file, FuriString* str_result) {
furi_string_reset(str_result);
uint8_t buffer[ARCHIVE_FAV_FILE_BUF_LEN];
bool result = false;
@@ -34,7 +34,7 @@ static bool archive_favorites_read_line(File* file, string_t str_result) {
result = true;
break;
} else {
string_push_back(str_result, buffer[i]);
furi_string_push_back(str_result, buffer[i]);
}
}
@@ -52,8 +52,8 @@ uint16_t archive_favorites_count(void* context) {
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
string_t buffer;
string_init(buffer);
FuriString* buffer;
buffer = furi_string_alloc();
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
uint16_t lines = 0;
@@ -63,7 +63,7 @@ uint16_t archive_favorites_count(void* context) {
if(!archive_favorites_read_line(file, buffer)) {
break;
}
if(!string_size(buffer)) {
if(!furi_string_size(buffer)) {
continue; // Skip empty lines
}
++lines;
@@ -72,7 +72,7 @@ uint16_t archive_favorites_count(void* context) {
storage_file_close(file);
string_clear(buffer);
furi_string_free(buffer);
storage_file_free(file);
furi_record_close(RECORD_STORAGE);
@@ -80,8 +80,8 @@ uint16_t archive_favorites_count(void* context) {
}
static bool archive_favourites_rescan() {
string_t buffer;
string_init(buffer);
FuriString* buffer;
buffer = furi_string_alloc();
Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage);
@@ -91,23 +91,25 @@ static bool archive_favourites_rescan() {
if(!archive_favorites_read_line(file, buffer)) {
break;
}
if(!string_size(buffer)) {
if(!furi_string_size(buffer)) {
continue;
}
if(string_search(buffer, "/app:") == 0) {
if(archive_app_is_available(NULL, string_get_cstr(buffer))) {
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", string_get_cstr(buffer));
if(furi_string_search(buffer, "/app:") == 0) {
if(archive_app_is_available(NULL, furi_string_get_cstr(buffer))) {
archive_file_append(
ARCHIVE_FAV_TEMP_PATH, "%s\n", furi_string_get_cstr(buffer));
}
} else {
if(storage_file_exists(storage, string_get_cstr(buffer))) {
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", string_get_cstr(buffer));
if(storage_file_exists(storage, furi_string_get_cstr(buffer))) {
archive_file_append(
ARCHIVE_FAV_TEMP_PATH, "%s\n", furi_string_get_cstr(buffer));
}
}
}
}
string_clear(buffer);
furi_string_free(buffer);
storage_file_close(file);
storage_common_remove(storage, ARCHIVE_FAV_PATH);
@@ -127,9 +129,9 @@ bool archive_favorites_read(void* context) {
Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage);
string_t buffer;
FuriString* buffer;
FileInfo file_info;
string_init(buffer);
buffer = furi_string_alloc();
bool need_refresh = false;
uint16_t file_count = 0;
@@ -143,39 +145,39 @@ bool archive_favorites_read(void* context) {
if(!archive_favorites_read_line(file, buffer)) {
break;
}
if(!string_size(buffer)) {
if(!furi_string_size(buffer)) {
continue;
}
if(string_search(buffer, "/app:") == 0) {
if(archive_app_is_available(browser, string_get_cstr(buffer))) {
archive_add_app_item(browser, string_get_cstr(buffer));
if(furi_string_search(buffer, "/app:") == 0) {
if(archive_app_is_available(browser, furi_string_get_cstr(buffer))) {
archive_add_app_item(browser, furi_string_get_cstr(buffer));
file_count++;
} else {
need_refresh = true;
}
} else {
if(storage_file_exists(storage, string_get_cstr(buffer))) {
storage_common_stat(storage, string_get_cstr(buffer), &file_info);
if(storage_file_exists(storage, furi_string_get_cstr(buffer))) {
storage_common_stat(storage, furi_string_get_cstr(buffer), &file_info);
archive_add_file_item(
browser, (file_info.flags & FSF_DIRECTORY), string_get_cstr(buffer));
browser, (file_info.flags & FSF_DIRECTORY), furi_string_get_cstr(buffer));
file_count++;
} else {
need_refresh = true;
}
}
string_reset(buffer);
furi_string_reset(buffer);
}
}
storage_file_close(file);
string_clear(buffer);
furi_string_free(buffer);
storage_file_free(file);
furi_record_close(RECORD_STORAGE);
archive_set_item_count(browser, file_count);
if(need_refresh) {
if(need_refresh) { //-V547
archive_favourites_rescan();
}
@@ -183,14 +185,14 @@ bool archive_favorites_read(void* context) {
}
bool archive_favorites_delete(const char* format, ...) {
string_t buffer;
string_t filename;
FuriString* buffer;
FuriString* filename;
va_list args;
va_start(args, format);
string_init_vprintf(filename, format, args);
filename = furi_string_alloc_vprintf(format, args);
va_end(args);
string_init(buffer);
buffer = furi_string_alloc();
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
@@ -201,18 +203,18 @@ bool archive_favorites_delete(const char* format, ...) {
if(!archive_favorites_read_line(file, buffer)) {
break;
}
if(!string_size(buffer)) {
if(!furi_string_size(buffer)) {
continue;
}
if(string_search(buffer, filename)) {
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", string_get_cstr(buffer));
if(furi_string_search(buffer, filename)) {
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", furi_string_get_cstr(buffer));
}
}
}
string_clear(buffer);
string_clear(filename);
furi_string_free(buffer);
furi_string_free(filename);
storage_file_close(file);
storage_common_remove(fs_api, ARCHIVE_FAV_PATH);
@@ -226,14 +228,14 @@ bool archive_favorites_delete(const char* format, ...) {
}
bool archive_is_favorite(const char* format, ...) {
string_t buffer;
string_t filename;
FuriString* buffer;
FuriString* filename;
va_list args;
va_start(args, format);
string_init_vprintf(filename, format, args);
filename = furi_string_alloc_vprintf(format, args);
va_end(args);
string_init(buffer);
buffer = furi_string_alloc();
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
@@ -245,10 +247,10 @@ bool archive_is_favorite(const char* format, ...) {
if(!archive_favorites_read_line(file, buffer)) {
break;
}
if(!string_size(buffer)) {
if(!furi_string_size(buffer)) {
continue;
}
if(!string_search(buffer, filename)) {
if(!furi_string_search(buffer, filename)) {
found = true;
break;
}
@@ -256,8 +258,8 @@ bool archive_is_favorite(const char* format, ...) {
}
storage_file_close(file);
string_clear(buffer);
string_clear(filename);
furi_string_free(buffer);
furi_string_free(filename);
storage_file_free(file);
furi_record_close(RECORD_STORAGE);
@@ -271,13 +273,13 @@ bool archive_favorites_rename(const char* src, const char* dst) {
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
string_t path;
string_t buffer;
FuriString* path;
FuriString* buffer;
string_init(buffer);
string_init(path);
buffer = furi_string_alloc();
path = furi_string_alloc();
string_printf(path, "%s", src);
furi_string_printf(path, "%s", src);
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
if(result) {
@@ -285,19 +287,19 @@ bool archive_favorites_rename(const char* src, const char* dst) {
if(!archive_favorites_read_line(file, buffer)) {
break;
}
if(!string_size(buffer)) {
if(!furi_string_size(buffer)) {
continue;
}
archive_file_append(
ARCHIVE_FAV_TEMP_PATH,
"%s\n",
string_search(buffer, path) ? string_get_cstr(buffer) : dst);
furi_string_search(buffer, path) ? furi_string_get_cstr(buffer) : dst);
}
}
string_clear(buffer);
string_clear(path);
furi_string_free(buffer);
furi_string_free(path);
storage_file_close(file);
storage_common_remove(fs_api, ARCHIVE_FAV_PATH);
@@ -325,7 +327,7 @@ void archive_favorites_save(void* context) {
for(size_t i = 0; i < archive_file_get_array_size(browser); i++) {
ArchiveFile_t* item = archive_get_file_at(browser, i);
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", string_get_cstr(item->path));
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", furi_string_get_cstr(item->path));
}
storage_common_remove(fs_api, ARCHIVE_FAV_PATH);

Some files were not shown because too many files have changed in this diff Show More