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

Compare commits

..

660 Commits

Author SHA1 Message Date
MX
d953d35991 Merge branch 'dev' into release 2023-05-05 23:33:23 +03:00
MX
1feb876a32 update changelog 2023-05-05 17:58:58 +03:00
MX
6b186622cb Merge branch 'fz-dev' into dev 2023-05-05 16:10:00 +03:00
MX
7ddde7e6ca Fuzzers remove excessive free's
thanks to @Willy-JL
2023-05-05 16:09:06 +03:00
あく
914129a0d9 [FL-3289] Various Furi/FuriHal bug fixes and improvements (#2637)
* Furi: properly handle thread free before TCB scrapping, add furi_free - more invasive version of free to memmgr. FuriHal: add DWT comparator api to cortex. Updater, RPC: refactor various thread shanenigans. Code cleanup.
* Rollback free macros and related changes
2023-05-05 21:40:55 +09:00
MX
b0b9e507e7 SubGHz combine FuriString allocs 2023-05-05 03:51:16 +03:00
MX
4e78367ec4 Merge branch 'fz-dev' into dev 2023-05-05 03:31:18 +03:00
MX
c36b788b2d Use COUNT_OF in mouse jiggler 2023-05-05 03:17:53 +03:00
MX
1f0c2c1266 SubGhz refactor merge pt 0 2023-05-05 02:09:21 +03:00
Sergey Gavrilov
ac05387803 [FL-3270] Loader refactoring, part 1 (#2593)
* Loader: menu part
* Settings: remove unused loader api
* Desktop: get loader from record_open
* CLI: remove unneeded loader api
* gitignore: ignore .old files
* Loader: now really a service
* Loader: working service prototype
* Loader: cli, system start hooks
* CI/CD: make happy
* Loader: autorun
* Loader: lock and unlock
* Loader: rearrange code
* Gui, module menu: fix memleak
* Updater test: add timeout
* added update timeouts and max run duration
* Github: revert updater test workflow changes
* Loader: less missleading message in info cli command

Co-authored-by: doomwastaken <k.volkov@flipperdevices.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-05-04 17:46:00 +03:00
Sergey Gavrilov
a7d1ec03e8 [FL-3270] Loader refactoring, part 1 (#2593)
* Loader: menu part
* Settings: remove unused loader api
* Desktop: get loader from record_open
* CLI: remove unneeded loader api
* gitignore: ignore .old files
* Loader: now really a service
* Loader: working service prototype
* Loader: cli, system start hooks
* CI/CD: make happy
* Loader: autorun
* Loader: lock and unlock
* Loader: rearrange code
* Gui, module menu: fix memleak
* Updater test: add timeout
* added update timeouts and max run duration
* Github: revert updater test workflow changes
* Loader: less missleading message in info cli command

Co-authored-by: doomwastaken <k.volkov@flipperdevices.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-05-04 12:48:13 +09:00
Skorpionm
d2ca67d261 [FL-3242] SubGhz: refactoring app (#2554)
* SubGhz: add SubGhzThresholdRssi
* SubGhz: remove direct reading of subghz-txrx-txrx_state
* SubGhz: remove direct reading subghz->txrx->hopper_state
* SubGhz: remove direct reading subghz->lock
* SubGhz: check load type file
* SubGhz: remove direct reading subghz->txrx->rx_key_state
* SubGhz: remove direct reading subghz->txrx->speaker_state
* SubGhz: refactoring subghz_scene_set_type.c
* SubGhz: moving "txrx" entity to a separate file
* SubGhz: show error tx start
* SubGhz: refactoring RPC
* SubGhz: value get optimizations
* SubGhz: fix name file
* SubGhz: add function description
* SubGhz: fix double back with a blocked transmission in this region and speacker, when a transmission is blocked in this region
* SubGhz: correct spelling
* SubGhz: better naming
* SubGhz: simplify includes

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-05-04 12:04:26 +09:00
MX
3a51b3f70c Update changelog 2023-05-03 21:58:07 +03:00
MX
6874b3b429 We don't use region provision so remove 00 from about screens 2023-05-03 21:53:44 +03:00
MX
9d58b492a8 Merge pull request #454 from amec0e/dev
Updated infrared assets
2023-05-03 20:21:02 +03:00
MX
1b72acd68e Merge pull request #452 from clipboard1/dev
Added numpad keyboard to HID app
2023-05-03 20:19:41 +03:00
MX
30f79f838e rename 2023-05-03 20:16:20 +03:00
MX
22c514575c Merge branch 'dev' into numpad 2023-05-03 20:08:57 +03:00
MX
d110a3ef26 Update wifi marauder version 2023-05-03 18:48:13 +03:00
MX
cae4790ef2 Merge branch 'fz-dev' into dev 2023-05-03 17:15:59 +03:00
Raymond Lucke
71e85ac367 Add HID mouse auto-clicker. (#2627)
* Add HID mouse auto-clicker.

* Add click rate adjustment to HID auto-clicker.

* Fix formatting.

* HidRemote: modify jiggler/clicker event filter and allow repeat to change click rate

---------

Co-authored-by: あく <alleteam@gmail.com>
2023-05-03 15:38:09 +09:00
hedger
c3ececcf96 [FL-3174] Dolphin builder in ufbt; minor ufbt/fbt improvements (#2601)
* ufbt: added "dolphin_ext" target (expects "external" subfolder in cwd with dolphin assets); cleaned up unused code
* ufbt: codestyle fixes
* scripts: fixed style according to ruff linter
* scripts: additional cleanup & codestyle fixes
* github: pass target hw code when installing local SDK with ufbt
* ufbt: added error message for missing folder in dolphin builder
* scripts: more linter fixes
* sdk: added flipper_format_stream; ufbt: support for --extra-define
* fbt: reduced amount of global defines
* scripts, fbt: rearranged imports

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-05-03 14:48:49 +09:00
Nikolay Minaylov
015ab4a024 [#2591] BadUSB: command parser fix (#2607)
Co-authored-by: あく <alleteam@gmail.com>
2023-05-03 13:39:14 +09:00
Skorpionm
59386f9fa9 WS: add protocol "Wendox W6726" (#2604)
* WS: add protocol  "Wendox"
* WS: add bat status
* WS: add CRC, refactoring
* WS: description added
* WS: fix name file
* WeatherStation: cleanup alien symbols

Co-authored-by: あく <alleteam@gmail.com>
2023-05-03 13:15:47 +09:00
Eric Betts
dfbacd1a47 [#2612] Remove spaces in CSN(#2616)
Co-authored-by: あく <alleteam@gmail.com>
2023-05-03 13:05:24 +09:00
hedger
c5b460b416 [FL-3260] Added API version to device info (#2611)
* hal: device_info: added API version to "firmware.api.major" & "firmware.api.minor"
* FuriHal: bump device info version

Co-authored-by: あく <alleteam@gmail.com>
2023-05-03 12:58:59 +09:00
Lewis Westbury
5c09bc5b2d Gui: relax some asserts in view (#2623)
* Remove assertion preventing replacement of view input callback
* Gui: relax some asserts in view

Co-authored-by: あく <alleteam@gmail.com>
2023-05-03 12:33:30 +09:00
あく
23c946ef50 Move gauge calibration to separate header, add f18 calibration (#2622) 2023-05-03 06:08:41 +04:00
Georgii Surkov
238005890e [FL-3294] Fix TERMINFO on Linux systems (#2630)
* Fix TERMINFO on Linux systems
* Set TERMINFO_DIRS only on Linux
* Unset TERMINFO_DIRS if it was not set before
2023-05-03 00:56:25 +03:00
amec0e
dd6c031a31 Updated tv.ir
New additions, Added full sharp tv support. Reverted Vizio raw data change, will add this if needed
2023-05-02 21:00:24 +01:00
amec0e
79566b7fa3 Updated projectors.ir
New additions
2023-05-02 20:54:15 +01:00
amec0e
7ba96ad653 Updated fans.ir
New additions
2023-05-02 20:53:48 +01:00
amec0e
bf0e853413 Updated audio.ir
Updated last checked, no new additions
2023-05-02 20:53:25 +01:00
amec0e
259855e788 Updated ac.ir
New additions
2023-05-02 20:52:41 +01:00
clipboard1
11a39927ef Merge branch 'dev' of https://github.com/clipboard1/unleashed-firmware into dev 2023-05-02 22:25:33 +05:00
clipboard1
356db794b5 Added numpad keyboard 2023-05-02 22:25:05 +05:00
MX
2e162c1131 Replace QR code with good old link 2023-05-02 04:20:22 +03:00
MX
4b74d13e10 Merge branch 'dev' into release 2023-05-02 03:40:11 +03:00
MX
311cbf709c update changelog 2023-05-02 03:39:17 +03:00
MX
2852990566 Add sharp and vizio to ir database 2023-05-02 03:36:28 +03:00
MX
b801f70f3a OFW PR 2627: Add HID mouse auto-clicker
by rwl4
2023-05-02 03:01:50 +03:00
MX
e24cb944ff Temp fix desktop lock bug and update changelog 2023-05-02 02:38:42 +03:00
MX
fe6bf3c7d6 Revert some changes 2023-05-02 02:25:52 +03:00
MX
0ef37df4ae Update TOTP / run fbt format 2023-05-01 20:55:09 +03:00
MX
2eac821f7f Update readme 2023-05-01 20:53:09 +03:00
MX
f9e5ef2aa9 Merge pull request #450 from leo-need-more-coffee/dev
Add bumberduck
2023-05-01 20:47:48 +03:00
Лень :)
d01600ea0f Update application.fam 2023-05-01 20:46:27 +03:00
Лень :)
13a65d45a3 Update LICENSE 2023-05-01 20:46:10 +03:00
Лень :)
099f907972 Add files via upload 2023-05-01 20:39:37 +03:00
Лень :)
b65f666578 Delete applications/external/flipperzero-bomberduck directory 2023-05-01 20:38:57 +03:00
Лень :)
3b40696c9e Add files via upload 2023-05-01 20:37:25 +03:00
MX
a9e47454d5 Fix SWD Probe plugin GPIO pins state
Reset pins after exit
2023-05-01 16:17:47 +03:00
MX
512fe8aead Fix readme 2023-04-30 14:59:38 +03:00
MX
d1456929ec Merge remote-tracking branch 'origin/dev' into dev 2023-04-29 21:41:43 +03:00
MX
b86d155e8e Remove ko-fi 2023-04-29 21:41:09 +03:00
MX
999a2c7134 Merge pull request #447 from krolchonok/hid_refactor_unl
Hid refactor unl
2023-04-29 19:06:31 +03:00
ushastoe
947dd1b754 Change UP&DOWN swipe 2023-04-29 18:20:54 +03:00
ushastoe
5085a17bcb HID app refactor 2023-04-29 18:16:53 +03:00
Max Andreev
e42aec68c5 Disable ci/cd on release* branches (#2624) 2023-04-28 23:25:20 +09:00
MX
2aad416cc2 Merge pull request #443 from krolchonok/46-version-"how-to-install"
Update HowToInstall.md
2023-04-28 14:05:52 +03:00
MX
e87256e01f Update TOTP 2023-04-28 14:04:16 +03:00
MX
96375e8244 Version instead of branch 2023-04-28 14:00:40 +03:00
ushastoe
c0de75367f Update HowToInstall.md 2023-04-28 01:43:27 +03:00
ushastoe
7b21dd7082 Update HowToInstall.md 2023-04-28 01:41:03 +03:00
ushastoe
b31e955744 Update HowToInstall.md 2023-04-28 01:39:58 +03:00
ushastoe
41895118bd Update HowToInstall.md
46 version
2023-04-28 01:28:40 +03:00
MX
98bf353287 Merge branch 'dev' into release 2023-04-27 22:15:19 +03:00
MX
d85e097ee5 Fix ibutton fuzzer stop values 2023-04-27 21:45:30 +03:00
MX
6ed182013d Sync ibutton fuzzer code
PR with key updates from @team-orangeBlue
2023-04-27 21:12:02 +03:00
MX
1afa3916ac Update changelog 2023-04-27 20:21:04 +03:00
MX
eb8c751b31 Merge branch 'dev' into release 2023-04-27 19:58:25 +03:00
MX
de3ad734f9 Merge branch 'fz-dev' into dev 2023-04-27 17:10:34 +03:00
あく
408edb3e99 Keep HSI16 working in stop mode. (#2621) 2023-04-27 23:01:13 +09:00
MX
9abad8704f Merge branch 'dev' into release 2023-04-27 04:02:39 +03:00
MX
a2b2e486ea Update changelog, docs, readme 2023-04-27 04:02:00 +03:00
MX
5881ad9685 Merge pull request #441 from amec0e/dev
Updated infrared assets
2023-04-27 02:53:16 +03:00
MX
243edf7e13 Confirm when removing t5577 password
add extra scene
2023-04-27 02:40:33 +03:00
MX
6119d6e102 OFW PR 2616: Picopass: remove spaces in CSN
by bettse
2023-04-27 02:02:27 +03:00
MX
f967e75819 Merge remote-tracking branch 'flipperdevices/skorp/ws_add_wendox' into dev 2023-04-27 02:00:24 +03:00
MX
3b02dd316d Merge remote-tracking branch 'flipperdevices/astra/3284-mifare-classic-fix-read' into dev 2023-04-27 02:00:15 +03:00
Astra
102dd690b7 Fix emulating empty keys as 0s 2023-04-27 00:28:21 +03:00
Astra
0a32cd2528 I was outplayed by the C programming language 2023-04-27 00:27:57 +03:00
MX
f48a2713bc Add log files icon in wifi marauder 2023-04-27 00:18:12 +03:00
MX
10c4cd0f41 Update WifI marauder app
https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion/pull/11
2023-04-27 00:13:28 +03:00
MX
451ec9cba0 Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-04-26 23:50:37 +03:00
MX
6c0c0bd0be Merge branch 'fz-dev' into dev 2023-04-25 23:30:44 +03:00
あく
0ec8fc4c55 FuriHal: use proper divider for core2 when transition to sleep, remove extra stop mode transition checks, cleanup code. Furi: proper assert and check messages. (#2615) 2023-04-26 00:11:42 +04:00
amec0e
a5f86b3025 Updated tv.ir
Updated "Last Checked", No new additions
2023-04-25 18:57:18 +01:00
amec0e
f682053174 Updated projectors.ir
Updated "Last Checked", No new additions
2023-04-25 18:57:02 +01:00
amec0e
b49314deb0 Updated audio.ir
Updated "Last Checked", No new additions
2023-04-25 18:56:44 +01:00
amec0e
3bb5763b1b Updated audio.ir
Updated "Last Checked", No new additions
2023-04-25 18:56:26 +01:00
amec0e
35d876b816 Updated ac.ir
Updated "Last Checked", No new additions
2023-04-25 18:56:09 +01:00
MX
ff45b425e3 Merge branch 'fz-dev' into dev 2023-04-25 20:16:32 +03:00
hedger
d70ba2b740 [FL-3286] Don't reboot on crash in debug builds (#2613)
* furi: never reboot on furi_crash in debug builds
* furi: crash info: added registers
* furi: check and assert optimization, split registers and stack info dump
* furi: macro uppercase

Co-authored-by: SG <who.just.the.doctor@gmail.com>
2023-04-26 01:33:13 +09:00
SkorP
6b09dfca76 WS: fix name file 2023-04-25 11:40:50 +04:00
SkorP
9caedb422d WS: description added 2023-04-25 11:36:27 +04:00
SkorP
6a9bdeae3e WS: add CRC, refactoring 2023-04-25 11:22:35 +04:00
MX
30447d7660 Rename to make it fit on screen 2023-04-25 03:39:16 +03:00
MX
d7f9cbf9ca CI update args 2023-04-25 02:40:33 +03:00
MX
6271409e5a Allow locking without pin using Up menu on desktop 2023-04-25 02:09:29 +03:00
MX
ab669b26da Fix very old and funny subghz bugs
Fixed Frequency Ananyzer issues
Fixed read mode issues
Fixed re-inits in HAL
2023-04-25 01:42:20 +03:00
nminaylov
87a023c75d BadUSB: command parser fix 2023-04-25 01:41:30 +03:00
MX
afe109ce27 Merge branch 'fz-dev' into dev 2023-04-25 01:41:19 +03:00
hedger
1ef70c0bb4 [FL-3280] cubewb: downgraded to v1.15.0 (#2605)
* cubewb: downgraded to v1.15.0
* hal: updated f18 symbols to match LL
* hal: flash: use furi_hal_cortex_timer for timeouts
* scripts: fixed cube version validation from config file
* hal: flash: added 3 seconds timeout when waiting for C2 to unlock flash controller. On timeout, triggers furi_check
* nfc: fixed missing interrupt setup on multiple platformSetIrqCallback() invocations
* hal: gpio: don't trigger furi_check on furi_hal_gpio_add_int_callback() with same parameters
* Reverted NFC fixes - will be in a separate PR
* scripts: storage: fixed exception handler for paths
2023-04-24 16:19:36 +09:00
MX
8cb3b67295 Fix external radio SPI handlers 2023-04-24 01:56:43 +03:00
MX
69530cd50f RFID: More user-friendly RAW emulation
Made by Dan Caprita <dan@caprita.ro>

https://forum.flipperzero.one/t/electra-intercom/6368/43
2023-04-23 19:03:23 +03:00
hedger
02c4b6d7e2 scripts: storage: fixed exception handler for paths 2023-04-23 14:06:01 +03:00
MX
5d98d2703b Fix external subghz module 2023-04-23 02:21:10 +03:00
MX
a0597a9e6e Fix RFID Fuzzer and iButton Fuzzer Bugs 2023-04-23 01:57:38 +03:00
MX
ba0efda2aa hal: gpio: don't trigger furi_check on furi_hal_gpio_add_int_callback() with same parameters 2023-04-23 01:57:07 +03:00
MX
f693d4a8de Merge pull request #437 from gid9798/using_scene_manager
Using scene manager function
2023-04-23 01:14:11 +03:00
MX
05fab99f42 Merge remote-tracking branch 'flipperdevices/hedgetr/stack15' into dev 2023-04-23 00:46:39 +03:00
MX
082db67373 Revert "why?"
This reverts commit 1092cc92be.
2023-04-23 00:46:09 +03:00
hedger
963b19e2e0 nfc: fixed missing interrupt setup on multiple platformSetIrqCallback() invocations 2023-04-23 01:31:07 +04:00
hedger
10efb9590a scripts: fixed cube version validation from config file 2023-04-23 00:12:53 +03:00
MX
1092cc92be why? 2023-04-23 00:12:39 +03:00
hedger
ffae861bc2 hal: flash: added 3 seconds timeout when waiting for C2 to unlock flash controller. On timeout, triggers furi_check 2023-04-23 00:48:47 +04:00
hedger
a782a5ad29 scripts: fixed cube version validation from config file 2023-04-22 22:04:03 +04:00
SkorP
7aa6716892 WS: add bat status 2023-04-22 21:57:31 +04:00
hedger
d537e21c65 hal: flash: use furi_hal_cortex_timer for timeouts 2023-04-22 20:56:43 +03:00
hedger
b0fa913fa2 hal: flash: use furi_hal_cortex_timer for timeouts 2023-04-22 21:49:00 +04:00
hedger
3561f79cf4 cubewb: downgraded to v1.15.0 2023-04-22 20:42:27 +03:00
hedger
ad0db706c0 hal: updated f18 symbols to match LL 2023-04-22 21:38:40 +04:00
hedger
4671f8ca64 cubewb: downgraded to v1.15.0 2023-04-22 21:32:41 +04:00
SkorP
8a785993ed WS: add protocol "Wendox" 2023-04-22 21:03:44 +04:00
gid9798
47ece05592 using scene_manager`s function 2023-04-22 19:47:33 +03:00
gid9798
b46d9e09eb Revert "Fix add manually naming"
This reverts commit eb3a4bfa6e.
2023-04-22 17:42:41 +03:00
MX
c1292d08de Apply RFAL changes from OFW PR 2549 2023-04-22 17:28:55 +03:00
MX
3a2240f2e1 Merge pull request #436 from krolchonok/HowToInstall45
Update HowToInstall.md
2023-04-22 17:21:55 +03:00
MX
eb3a4bfa6e Fix add manually naming 2023-04-22 04:38:14 +03:00
MX
458979293d Merge pull request #433 from gid9798/combining_BFT/FAAC_scenes
Combining add manual scenes
2023-04-22 04:33:06 +03:00
MX
67c0c9fd73 Merge branch 'dev' into combining_BFT/FAAC_scenes 2023-04-22 04:27:14 +03:00
MX
cbbdf0f6de Update pictures 2023-04-22 04:25:05 +03:00
gid9798
f2a7172a84 Drop excess DOLPHIN_DEED 2023-04-21 16:17:59 +03:00
gid9798
40a5306ed4 Combining BFT/FAAC scenes 2023-04-21 16:10:08 +03:00
MX
6716c0f792 Merge branch 'dev' into release 2023-04-21 15:59:36 +03:00
MX
7514bc8b49 Final updates 2023-04-21 15:55:06 +03:00
MX
634c37fb23 Update readme and changelog 2023-04-21 13:59:49 +03:00
MX
831fc9c361 Merge pull request #432 from krolchonok/ble_refactoring
some change hid_ble
2023-04-21 13:20:59 +03:00
ushastoe
1c65ec9ef2 some change
- add [beta] for YT Shorts
- fix pause click on like button
- fix slide screen
2023-04-21 11:36:17 +03:00
MX
e8bd435fe3 fw version in json 2023-04-21 09:46:48 +03:00
MX
7747f45be3 Fix null pointer dereference 2023-04-21 07:51:37 +03:00
MX
f0e866cb56 Fix add manually naming 2023-04-21 07:38:01 +03:00
MX
d92833284e Scroll improvements 2023-04-21 07:25:34 +03:00
MX
806b6d5a37 Merge pull request #429 from wosk/rf-date
SubGHz - Add date/time to history and files
2023-04-21 06:47:50 +03:00
MX
1bb3ab8715 New option to save signal names with timestamps 2023-04-21 06:46:10 +03:00
MX
0825db36ff Merge pull request #428 from Kami-no/dev
Keynote with vertical layout
2023-04-21 05:56:35 +03:00
Nikita Vostokov
15f204bbc5 Revert "SubGhz - Add date of signal to *.sub files header"
This reverts commit 67a457dd1f.
2023-04-21 05:54:39 +03:00
MX
2b6eee1848 move icons a bit, apply fbt format
add arrow showing upper side, its not clearly how you need to hold it, arrow helps a bit
2023-04-21 05:50:30 +03:00
Nikita Vostokov
67a457dd1f SubGhz - Add date of signal to *.sub files header 2023-04-21 04:26:41 +03:00
Nikita Vostokov
95e3b7d42b [SubGHz] Show receiving time of signal 2023-04-21 03:19:55 +03:00
Nikita Vostokov
fd40a77089 Add time of Rx SubGHz signal 2023-04-21 03:19:55 +03:00
Dmitry Zinin
19becd9985 Keynote with vertical layout 2023-04-20 23:18:45 +03:00
MX
57d9cdb3c4 Merge branch 'fz-dev' into dev 2023-04-20 16:08:09 +03:00
SG
8cfb37c12f Gui, module menu: fix memleak 2023-04-20 16:05:35 +03:00
hedger
4d015a1106 [FL-3271] cubewb: updated to v1.16.0 (#2595)
* cubewb: updated project to v1.16.0
* hal: updated api_symbols for f18
* FuriHal: add missing enterprise sleep and insomnia
* FuriHal: slightly more paranoic sleep mode

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-04-20 21:57:51 +09:00
MX
dd1a92803e Adding fallback Just in case 2023-04-20 01:24:04 +03:00
MX
40e435a961 Kostily and velosipedy
!!! Needs to be re-done in proper way after ofw subghz refactoring merge
2023-04-19 19:19:26 +03:00
MX
2de476b11d Merge branch 'fz-dev' into dev 2023-04-19 17:03:56 +03:00
hedger
3932503660 [FL-3243] github: testing SDK with ufbt action (#2581)
* github: testing SDK with ufbt action
* github: also build apps with ufbt
* github: fixed dir lookup for ufbt
* ufbt: checks for compatibility on app discovery
* github: Conditional app skip for ufbt
* github: fixed app build flow with ufbt
* extra debug
* github: lint: message capture
* github: testing different output capture method for linters
* shorter version of status check
* github: updated comment actions to suppress warnings
* Reverted formatting changes

Co-authored-by: あく <alleteam@gmail.com>
2023-04-19 20:08:13 +09:00
Astra
e0fa2e7b12 [FL-3089] Raw RFID documentation (#2592)
Co-authored-by: あく <alleteam@gmail.com>
2023-04-19 18:47:01 +09:00
Astra
74fe003f8b [FL-3171] Introduce stealth mode and auto-selective lock (#2576)
* Introduce stealth mode and auto-selective lock
* Stealth mode status bar icon
* Review fixes
* Fix icon disappearing after reboot
* Support overriding stealth mode
* FuriHal: correct reserved space size in RTC SystemReg

Co-authored-by: あく <alleteam@gmail.com>
2023-04-19 18:33:23 +09:00
MX
7dfae0fb61 Just in case 2023-04-19 12:32:23 +03:00
MX
c6e5ca1fec Fix keeloq custom buttons bug
When you receive couple signals on read screen and open last one it was replacing its button with first one received
2023-04-19 11:51:08 +03:00
Astra
2c7eb53cac [FL-2505] Active RPC session icon (#2583)
* Active RPC session icon
* Add RpcOwner, don't show the RPC icon when the session was started from BLE
* Fix rpc_test and f18 api
* Bump API version

Co-authored-by: あく <alleteam@gmail.com>
2023-04-19 17:30:26 +09:00
MX
059053b9b8 SubGHz Remote add Alutech AT4N Support
Fix null pointer dereference
2023-04-18 22:16:29 +03:00
MX
ab921a6f0d Update changelog 2023-04-18 15:03:09 +03:00
MX
4a03e12636 Merge pull request #421 from amec0e/dev
Updated infrared assets
2023-04-18 14:42:16 +03:00
MX
198e67b1fc Merge pull request #425 from PhoenixSheppy/patch-1
Flip slashes for Windows builds (Backslash -> Forward Slash)
2023-04-18 14:41:55 +03:00
MX
de24d6dc14 Merge branch 'fz-dev' into dev 2023-04-18 14:40:24 +03:00
あく
f68c3b2a65 [FL-3264] Various stop mode fixes (#2584)
* BleGlue: log hci_cmd_resp invocation
* BleGlue: increase BleHciDriver stack size
* ble hid app: increase stack
* ble: comment unnecessary hci reset
* BleGlue: stricter checks in communication with core2, cleanup code
* Furi: enter insomnia when executing from RAM
---------
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2023-04-18 21:38:35 +10:00
MX
a304e9c3fa Revert "Revert Deep Sleep due to BLE issues and other random freezes"
This reverts commit addf909287.
2023-04-18 14:35:32 +03:00
MX
d1df16a2bf Improve wifi marauder keyboard
Port uart terminal keyboard into wifi marauder
2023-04-18 14:15:04 +03:00
Jacob Witt
62da755431 Flip slashes for Windows builds (Backslash -> Forward Slash)
Tried building this myself using these directions, kept getting errors.

Flipped the backslash to a forward slash, and got a successful build. 🤷‍♂️
2023-04-17 20:38:18 -05:00
MX
2eafc0ddff Merge branch 'fz-dev' into dev 2023-04-17 12:50:22 +03:00
Eric Betts
de02a0a25a [#2589] Correctly aborts when correct key is found (#2590) 2023-04-17 14:36:15 +09:00
MX
1a17699356 Improve nero radio encoder timings 2023-04-16 05:02:36 +03:00
amec0e
591a36246f Updated audio.ir
New additions
2023-04-14 22:32:32 +01:00
amec0e
59c87c819a Updated fans.ir
New additions
2023-04-14 22:07:40 +01:00
amec0e
0717061212 Updated audio.ir
New additions
2023-04-14 22:07:16 +01:00
amec0e
0f48a14181 Updated ac.ir
new additions
2023-04-14 22:06:55 +01:00
amec0e
a81ba240be Updated tv.ir
Updated last checked
2023-04-14 21:53:12 +01:00
amec0e
3ac478dfda Updated projectors.ir
new additions
2023-04-14 21:52:38 +01:00
amec0e
c1fc152251 Updated fans.ir
New additions
2023-04-14 21:52:07 +01:00
amec0e
3fc43e8ebd Updated audio.ir
Updated last checked
2023-04-14 21:51:28 +01:00
amec0e
ab5364232f Updated ac.ir
New additions
2023-04-14 21:50:53 +01:00
MX
8a468fccf0 Nero Radio 57bit experimental support
+ encoder improvements and decoder changes

Please report if you find any issues with old 56bit systems that was working before this change!
2023-04-14 23:44:18 +03:00
MX
afab1bdaad SubGhz - Temp Fix RAW recording and reading
and remove unused file
2023-04-14 23:37:20 +03:00
MX
addf909287 Revert Deep Sleep due to BLE issues and other random freezes
Waiting for proper fix
2023-04-14 14:45:35 +03:00
MX
35f7ec6c07 Merge branch 'dev' into release 2023-04-14 04:08:34 +03:00
MX
0f6c2bff06 Update changelog, disable old app 2023-04-14 04:04:43 +03:00
MX
731c752e94 Update changelog 2023-04-14 03:41:58 +03:00
MX
3191b32708 Youtube shorts remote, swap tiktok control buttons 2023-04-14 03:35:42 +03:00
MX
bd199c63ab Merge pull request #420 from krolchonok/fix-hid_ble
refactoring HID_BLE
2023-04-14 02:19:13 +03:00
MX
3c4cbf2a05 Merge pull request #416 from p0ns/gps-uart-baudrate-array
Implements an array for baudrates on GPS UART app
2023-04-14 02:11:44 +03:00
ushastoe
21b7df9ab7 refactoring
-fix TikTok Controller
-fix icon in Mouse
2023-04-14 01:59:16 +03:00
MX
7922e3bb16 docs and changelogs 2023-04-14 00:09:48 +03:00
MX
c7637a0fda Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-04-13 21:20:29 +03:00
MX
6b70e37ae3 Merge branch 'fz-dev' into dev 2023-04-13 20:25:26 +03:00
MX
9ede95954b fbt format 2023-04-13 19:44:03 +03:00
Georgii Surkov
37fb330b36 [FL-3226] Deep Sleep Idle (#2569)
* Improve RNG error handling
* Sync RTC shadow registers on Stop mode exit
* Implement working STOP2 mode
* Fix formatting
* FuriHal: disable SWD pins if debug is disabled
* Power: cleanup battery info view, handle zero current report from gauge
* Fbt: add command line argument for extra global defines
* FuriHal: cleanup debug defines in power and os, drop deep_insomnia counter.
* Add a setting to disable deep sleep
* Clean up furi_hal_power
* FuriHal,FapLoader,Debug: implement debug in stop mode, workaround resume in stop
* FuriHal: document OS and power subsystems debugging
* Furi: enable debug interface on crash

---------

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-04-14 00:47:38 +10:00
MX
39186004cc Update UART terminal
https://github.com/cool4uma/UART_Terminal
2023-04-12 19:42:24 +03:00
MX
0a844e0b62 Merge branch 'fz-dev' into dev 2023-04-12 14:51:58 +03:00
あく
5d7bdca835 FuriHal: pwr pulls for some pins (#2579) 2023-04-12 21:45:13 +10:00
Skorpionm
33e8bae78b Bugfix: ISP Programmer and SubGhz (#2574)
* AVR_ISP: fix NULL pointer dereference
* SubGhz: double back with a blocked transmission in this region
* SubGhz: fix speaker, when a transmission is blocked in this region
* SubGhz: fix speaker
* SubGhz: return region
* AVR Flasher: cleanup code

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-04-12 15:07:05 +09:00
p0ns
206eb7946b Implements an array for baudrates 2023-04-10 20:37:57 -03:00
SkorP
243fbfc19a AVR_ISP: fix NULL pointer dereference 2023-04-10 19:57:15 +03:00
MX
c2fa8a2b18 Revert "Revert changes due to Null pointer dereference"
This reverts commit 8f752b7eee.
2023-04-10 19:57:02 +03:00
gornekich
7ac7b70884 [FL-3241] NFC disable EMV support (#2571)
* nfc: remove read emv from extra actions
* nfc: remove read emv

Co-authored-by: あく <alleteam@gmail.com>
2023-04-10 23:51:55 +08:00
MX
8f752b7eee Revert changes due to Null pointer dereference 2023-04-10 18:47:20 +03:00
MX
93035f07aa Merge branch 'fz-dev' into dev 2023-04-10 18:41:51 +03:00
MX
114e8d5b6a Merge branch 'fz-dev' into dev 2023-04-10 18:41:22 +03:00
hedger
b9ccb274a7 ufbt: project & debugging updates (#2572)
* ufbt: removed warning in "channel=dev" update mode
* ufbt: removed API version warning; added get_blackmagic & get_apiversion targets
* ufbt: updater project template to include blackmagic & jlink targets
* ufbt: project template: fixes & updates
* ufbt: project template: added config update shortcut
* sdk: using fixed names for file components
2023-04-11 00:46:22 +10:00
MX
4c7fa05bfe Add alutech table to enviroment alloc and free 2023-04-10 02:55:16 +03:00
MX
c2997bb1fc Trying to fix button issues in sbughz remote 2023-04-09 23:56:41 +03:00
MX
a524fd7674 Merge branch 'dev' into release 2023-04-07 11:50:22 +03:00
MX
d8378e6819 SubGHz: Fix keyboard lock 2023-04-07 11:49:10 +03:00
Skorpionm
6cc5f30c84 Fix gpio state isp programmer (#2567)
* ISP: fix state gpio ISP Programmer
* WS: delete string debug

Co-authored-by: あく <alleteam@gmail.com>
2023-04-07 11:02:29 +08:00
MX
ff27fd3094 Merge branch 'dev' into release 2023-04-07 01:08:58 +03:00
MX
4adcc763e5 Update changelog 2023-04-07 01:08:43 +03:00
MX
977ac09fe6 Merge branch 'dev' into release 2023-04-07 01:07:08 +03:00
MX
5a7cddfb69 revert changes / update changelog 2023-04-07 00:07:12 +03:00
MX
b8dba0fd0c Update changelog 2023-04-06 23:56:48 +03:00
MX
9de6b6355e format 2023-04-06 23:50:34 +03:00
SkorP
b9bc34afbf WS: delete string debug 2023-04-06 23:50:14 +03:00
SkorP
bf29f55205 ISP: fix state gpio ISP Programmer 2023-04-06 23:50:00 +03:00
hedger
a5a95847ea scripts: sconsdist: added stub file artifact for older ufbt (#2568)
* scripts: sconsdist: added stub file artifact for older ufbt
* scripts: sconsdist: not creating dummy SDK archive
2023-04-06 23:49:28 +03:00
MX
011c0b1914 Revert nfc changes too 2023-04-06 23:45:35 +03:00
MX
a116dbc358 Revert checks temporarily 2023-04-06 23:25:30 +03:00
hedger
89161a7a1e scripts: sconsdist: added stub file artifact for older ufbt (#2568)
* scripts: sconsdist: added stub file artifact for older ufbt
* scripts: sconsdist: not creating dummy SDK archive
2023-04-07 05:37:12 +10:00
あく
0d8518d31d [FL-3232] FuriHal: fix gpio naming and add explicit pulls for vibro, speaker and ir_tx (#2565)
* FuriHal: fix gpio naming and add explicit pulls for vibro, speaker and ir_tx
* Github: workflow event debug print
* Github: proper PR head commit SHA extraction in get_env.py
2023-04-06 19:06:19 +10:00
MX
2e32d716aa Update changelog 2023-04-06 07:41:06 +03:00
MX
51d52c213b Comment debug logs back
just in case, to avoid extra calls while reading flash
2023-04-06 07:28:19 +03:00
MX
8aed2375f3 Merge branch 'fz-dev' into dev 2023-04-06 07:22:53 +03:00
MX
53f6ae7a39 Fix after-merge issues 2023-04-06 07:20:56 +03:00
MX
aac7654ca3 Merge branch 'fz-dev' into dev 2023-04-06 07:14:48 +03:00
Skorpionm
d1ad924216 [AVR_ISP]: add AVR ISP Programmer FAP (#2475)
* [AVR_ISP]: add AVR ISP Programmer FAP
* [AVR_ISP]: add auto detect AVR chip
* [AVR_ISP]: fix auto detect chip
* [AVR_ISP]: fix fast write flash
* AVR_ISP: auto set SPI speed
* AVR_ISP: add clock 4Mhz on &gpio_ext_pa4
* AVR_ISP: fix "[CRASH][ISR 4] NULL pointer dereference" with no AVR chip connected
* AVR_ISP: add AVR ISP Reader
* AVR_ISP: add read and check I32HEX file
* AVR_ISP: add write eerom, flash, fuse, lock byte
* AVR_ISP: add gui Reader, Writer
* Github: unshallow on decontamination
* AVR_ISP: move to external
* API: fix api_symbols
* AVR_ISP: add wiring scene
* GUI: model mutex FuriMutexTypeNormal -> FuriMutexTypeRecursive
* AVR_ISP: add chip_detect view
* AVR_ISP: refactoring gui ISP Programmer
* AVR_ISP: add gui "Dump AVR"
* AVR_ISP: add gui "Flash AVR"
* AVR_ISP: fix navigation gui
* GUI: model mutex FuriMutexTypeRecursive -> FuriMutexTypeNormal
* AVR_ISP: fix conflicts
* AVR_ISP: fix build
* AVR_ISP: delete images
* AVR_ISP: add images
* AVR_ISP: fix gui
* AVR_ISP: fix stuck in navigation
* AVR_ISP:  changing the Fuse bit recording logic
* AVR_ISP: fix read/write chips with memory greater than 64Kb
* AVR_ISP: fix auto set speed SPI
* AVR_ISP: fix gui
* ISP: switching on +5 volts to an external GPIO

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-04-06 12:13:30 +08:00
Astra
b4ceb55fd2 [FL-2524] Graphics cleanup and icon rotation (#2561)
* Canvas with rotation
* Full icon rotation, cleanup of unused resources
* F18 API update
* Bitmap draw cleanup
* More cleaning up
* Migrate recovery and DFU to canvas
* Make the internal draw function static
* Remove all calls to u8g2_DrawXBM

Co-authored-by: あく <alleteam@gmail.com>
2023-04-06 11:36:12 +08:00
hedger
a91d319839 [FL-3162] Moved ufbt to fbt codebase (#2520)
* scripts: moved ufbt code
* ufbt: fixed tool path
* ufbt: fixed linter/formatter target descriptions
* scripts: ufbt: cleanup
* fbt: moved fap launch target to tools; ufbt fixes
* fbt: fixed missing headers from SDK
* ufbt: removed debug output
* ufbt: moved project template to main codebase
* ufbt: fixed vscode_dist
* ufbt: path naming changes
* fbt: error message for older ufbt versions
* ufbt: docs fixes
* ufbt: fixed build dir location
* fbt: fixes for extapps objcopy
* fbt: extapps: removed extra debug output; fixed formatting
* ufbt: handle launch target for multiple known apps
* ufbt: dropping wrapper; linter fixes
* ufbt: fixed boostrap path
* ufbt: renamed entrypoint
* ufbt: updated vscode config
* ufbt: moved sconsign db location
* ufbt: fixed sconsign path
* fbt: SDK builders rework
* fbt: reworked sdk packaging
* ufbt: additional checks and state processing
* ufbt: fixed sdk state file location
* dist: not packaging pycache
* dump commit json content
* Github: more workflow debug prints
* Github: fix incorrect commit meta extraction in get_env.py
* ufbt, fbt: changed SConsEnvironmentError->StopError
* fbtenv: no longer needs SCRIPT_PATH pre-set
* ufbt: fixed sdk state check
* scripts: exception fixes for storage.py
* scripts: fbtenv: added FBT_TOOLCHAIN_PATH for on Windows for compat
* ufbt: app template: creating .gitkeep for images folder
* ufbt: app template: fixed .gitkeep creation
* docs: formatting fixes for AppManifests; added link to ufbt
* fbt: added link to PyPI for old ufbt versions
* sdk: fixed dir component paths

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-04-06 10:44:37 +08:00
Sergey Gavrilov
8a021ae48c [FL-3224] SD Driver: do not cache sd status. (#2560)
* SD Driver: do not cache sd status.
* SD Driver: fix status getter

---------

Co-authored-by: あく <alleteam@gmail.com>
2023-04-06 10:26:33 +08:00
あく
2a26680acb Furi: more gpio checks in HAL (#2549)
* Furi: more gpio checks in HAL
* Nfc: do not spawn service thread if it is already spawned

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
2023-04-06 10:19:39 +08:00
MX
9e74ca3442 Trying to fix telegram dev build message issues 2023-04-05 23:51:20 +03:00
MX
563ec6c2ab Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-04-05 22:45:27 +03:00
MX
3cdb05364b AnMotors AT4 - Add manually fixes
Fix serial first two numbers to 47 - Just in case
Looks like they are same for all remotes (may be incorrect)
2023-04-05 17:44:56 +03:00
MX
a938b4ea18 Merge branch 'fz-dev' into dev 2023-04-05 16:22:59 +03:00
Anton Chistyakov
4c488bd970 Fixing parsing troika number (#2536)
Co-authored-by: あく <alleteam@gmail.com>
2023-04-05 12:16:20 +08:00
MX
2b590f323a Merge pull request #410 from gid9798/starline_ignore
StarLine ignore option
2023-04-05 00:56:09 +03:00
MX
70eefe6de3 Fix 2023-04-05 00:52:52 +03:00
MX
85aabe7c0c Merge branch 'dev' into starline_ignore 2023-04-05 00:15:59 +03:00
gid9798
1923c15907 StarLine ignore 2023-04-04 22:42:55 +03:00
MX
ef9dd5975b Update UART Terminal
https://github.com/cool4uma/UART_Terminal/tree/main
2023-04-04 22:02:58 +03:00
MX
61ec8818db fbt format 2023-04-04 21:59:05 +03:00
MX
b122db27cc Merge pull request #407 from kallanreed/feature/ir_scope
Add ir_scope app.
2023-04-04 21:56:00 +03:00
MX
3b7b48be4a Fix Repeat in subghz remote 2023-04-04 17:38:33 +03:00
MX
d4b32dc143 Update submodule link 2023-04-04 13:50:52 +03:00
MX
2fe4508db8 Fix repeats 2023-04-04 13:37:50 +03:00
MX
862f89a57c Fix "Repeat" bugs 2023-04-04 13:32:05 +03:00
MX
bb8e1d8ee2 Merge branch 'fz-dev' into dev 2023-04-04 13:07:38 +03:00
Skorpionm
494002505e WS: fix protocol TX141TH-BV2 (#2559)
Co-authored-by: あく <alleteam@gmail.com>
2023-04-04 12:37:54 +08:00
Leo Smith
efc52ab469 BdUSBadded WAIT_FOR_BUTTON_PRESS functionality (#2544)
Co-authored-by: p4p1 <p4p1@vivaldi.net>
Co-authored-by: あく <alleteam@gmail.com>
2023-04-04 11:40:19 +08:00
Eric Betts
f98ac4c48a Add more detail to saved info screen (#2548)
* Add more detail to saved info screen
* PR feedback
* Format sources and add pvs temp files to gitignore

Co-authored-by: あく <alleteam@gmail.com>
2023-04-04 11:21:43 +08:00
kallanreed
95bd038d8a Add ir_scope external app. 2023-04-03 17:40:16 -07:00
MX
1a88e01899 Merge branch 'dev' into release 2023-04-02 03:12:58 +03:00
MX
b9c253e4c2 Update changelog 2023-04-02 01:29:43 +03:00
MX
3d5701614f AVR ISP enable 5v power on start 2023-04-02 01:11:23 +03:00
MX
dce5bfd723 OFW PR 2536: Fixing parsing troika card number
by @achistyakov

we tested on regular cards, reading is not broken, so this pr should not break anything
2023-04-02 01:11:05 +03:00
MX
6b7b95e888 Merge pull request #405 from gid9798/custom-buttons
Unification of custom buttons
2023-04-01 22:08:04 +03:00
MX
cb12369b1c Merge branch 'dev' into custom-buttons 2023-04-01 21:59:22 +03:00
MX
656e328a55 fbt format 2023-04-01 21:53:19 +03:00
MX
52944370e6 OFW PR 2548: Picopass Add more detail to saved info screen
by https://github.com/bettse
2023-04-01 21:48:04 +03:00
MX
aaeb0278b1 OFW PR 2544: added WAIT_FOR_BUTTON_PRESS functionality to badusb
by @p4p1

merging before OFW, more testing needed!
2023-04-01 21:43:42 +03:00
MX
bd78c3b3ea OFW PR 2475: AVR ISP Programmer FAP by @Skorpionm
merging before OFW, more testing needed!
2023-04-01 21:40:37 +03:00
MX
01719eceb1 oh i forgot to remove logs 2023-04-01 21:38:15 +03:00
gid9798
5603ed7ebb Transferring and combining the functionality of "custom buttons" into a separate file. 2023-04-01 21:37:04 +03:00
MX
7b1d7904c1 Beninca / Allmatic support 2023-04-01 21:36:59 +03:00
MX
f0d94e2757 Update changelog 2023-04-01 17:47:55 +03:00
MX
8a21b7c5a1 Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-04-01 17:45:52 +03:00
MX
d4a20bc37a Merge branch 'fz-dev' into dev 2023-04-01 17:41:05 +03:00
MX
d207e3f889 Fix msgs 2023-04-01 17:40:46 +03:00
hedger
f192ccce2c FatFS: use rtc for timestamping (#2555)
* fatfs: use rtc
* fatfs: removed duplicate get_fattime declaration
* pvs: fixed warnings for fatfs timestamp
* fatfs: fixed seconds packing
* FuriHal: critical section around RTC datetime access
* FatFS: remove unused configration defines, update documentation
* FuriHal: checks instead of assets in RTC

---------

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-04-01 23:50:30 +10:00
Sergey Gavrilov
ae3a3d6336 RPC: increase max message size (#2543)
* RPC: increase max message size
* RPC: do not use magic numbers
2023-03-31 16:15:15 +09:00
MX
e7cada7ac7 Improve type guessing by bits 2023-03-30 18:46:13 +03:00
MX
cae1a6cc08 SubGHz: ScherKhan more informative messages instead of "Unknown"
may be not correct, because we guessing type by bits
2023-03-30 04:51:52 +03:00
MX
37bacdd83d GPS NMEA -> Ability to see speed in Km/h
Use right button to switch between modes
2023-03-30 03:58:22 +03:00
MX
e381951ecc Fix SL 72bit false detections 2023-03-30 03:57:27 +03:00
MX
bac1859432 Update changelog 2023-03-30 03:29:58 +03:00
MX
b5ed26ad70 Move multiple func calls into one var 2023-03-30 03:09:39 +03:00
MX
fe6d44d273 Show external CC1101 in weather station and POCSAG Pager apps 2023-03-30 03:00:00 +03:00
MX
9382ed5451 Improve CI/CD messages for tg and discord dev build channels 2023-03-30 02:45:40 +03:00
MX
910e4f3217 Improve GPS NMEA UART plugin, update changelog 2023-03-30 02:22:01 +03:00
MX
fdcec4315a Merge pull request #404 from amec0e/dev
Updated IR Assets
2023-03-29 15:17:24 +03:00
amec0e
b7b4bc7fab Updated tv.ir
Updated last checked
2023-03-29 12:50:07 +01:00
amec0e
70a91aff40 Updated projectors.ir
Updated last checked
2023-03-29 12:49:43 +01:00
amec0e
e3c4a4b47f Updated fans.ir
updated last checked
2023-03-29 12:49:18 +01:00
amec0e
33b12d26cc Updated audio.ir
2 new additions
2023-03-29 12:48:46 +01:00
amec0e
b03018965a Updated ac.ir
Updated last checked
2023-03-29 12:48:17 +01:00
MX
81bee794f8 Merge pull request #403 from gid9798/clear-code-in-add-manual
Clear code in "add manual" scene
2023-03-29 04:06:51 +03:00
MX
ae3481ef6c Merge branch 'fz-dev' into dev 2023-03-28 22:44:35 +03:00
gid9798
e0928432ef Clear code in "add manual" scene 2023-03-28 11:40:00 +03:00
Eric Betts
0161d49d80 Elite progress (#2481)
* WIP: builds
* can read standard
* Test standard picopass dictiony during attack
* correctly save diversified key
* read card on success
* more logs
* update file location
* Call setup methods
* backbutton and attempt at skip
* fixed skip
* remove found key state
* rename dictionary attack
* move notification
* center button back to start menu
* wait for card
* Picopass: proper integer formatting
* Picopass: even more proper integer formatting
* remove nextState

Co-authored-by: あく <alleteam@gmail.com>
2023-03-28 17:21:14 +09:00
Sergey Gavrilov
8b2dfea925 Improved thread lifecycle (#2534)
* Core, Thread: mark thread to join from prvDeleteTCB
* USB HAL: move vars to MEM2
* Core, Thread: cleanup sources
* Cli: add magic delays on rx pipe error, prevent cli from consuming processor time
* Furi: update thread documentation

Co-authored-by: あく <alleteam@gmail.com>
2023-03-28 16:34:49 +09:00
Sergey Gavrilov
3617ad33e4 View Model: recursive mutex (#2532)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-28 15:31:21 +09:00
MX
35442d14e2 Revert "Merge pull request #400 from Pinball3D/patch-1"
This reverts commit 4d21e23de9.
2023-03-28 05:50:53 +03:00
MX
4d21e23de9 Merge pull request #400 from Pinball3D/patch-1
Update subghz_remote_app.c
2023-03-28 05:43:56 +03:00
MX
6e710c5164 Merge branch 'dev' into release 2023-03-28 04:54:07 +03:00
MX
5340ebe9ab Update changelog 2023-03-28 04:51:30 +03:00
MX
85d3ecb729 Update Wifi marauder 2023-03-28 04:21:53 +03:00
MX
74ec9760da Update readme, docs, changelog 2023-03-28 03:41:27 +03:00
MX
bb600218b6 Alutech AT4N + AN-Motors AT4 - add manually 2023-03-28 02:32:35 +03:00
MX
ce430ff7f6 Remove debug, change aprimatic default button 4 2023-03-28 01:58:35 +03:00
MX
0f06991391 Aprimatic add manually 2023-03-27 23:27:15 +03:00
MX
438664f5da Merge branch 'fz-dev' into dev 2023-03-27 23:11:31 +03:00
MX
130181614a Aprimatic emulation support testing
thats was hard!
2023-03-27 23:10:45 +03:00
Ikko Eltociear Ashimine
27341fc193 Fix typo in fbt.md (#2539)
availabe -> available

Co-authored-by: あく <alleteam@gmail.com>
2023-03-27 16:39:24 +09:00
Astra
ae9659d32d [FL-3193] Additional checks before invalidating the key (#2533) 2023-03-27 16:28:13 +09:00
MX
001e00d84a fbt format, aprimatic fixes 2023-03-26 14:59:21 +03:00
Pinball3D
5b39e80f6a Update subghz_remote_app.c
Add Back Button Functionality. Hold back button brings you to menu if there is a config for it there. If there is no config, press back brings you to menu
2023-03-25 16:11:44 -04:00
MX
6e507df2b9 Update readme and changelog 2023-03-25 07:44:40 +03:00
MX
74e928eb00 Merge pull request #398 from Willy-JL/fix-pocsag-overlap
Fix POCSAG pager RIC: text repetition and overlap
2023-03-25 07:43:32 +03:00
MX
22406f8aca MF Classic dict - Fix key delete, now works properly 2023-03-25 07:04:28 +03:00
Willy-JL
474897d644 Fix POCSAG pager RIC: text repetition (#172) 2023-03-25 03:36:27 +00:00
Astra
5391b694d1 Additional checks before invalidating the key 2023-03-24 21:32:07 +03:00
MX
6a29984e18 Merge branch 'fz-dev' into dev 2023-03-24 16:46:51 +03:00
Georgii Surkov
fad24efdf0 [FL-3188] Fix crash when emulating a DSGeneric key (#2530) 2023-03-24 09:26:43 +09:00
Georgii Surkov
b11161abb0 Fix crash when emulating a DSGeneric key 2023-03-24 01:19:38 +03:00
MX
fd56ac3400 Merge branch 'dev' into release 2023-03-23 00:42:20 +03:00
MX
2ff07a0b54 fix folders 2023-03-23 00:06:45 +03:00
MX
831999f5e1 Update extra pack links 2023-03-22 23:52:34 +03:00
MX
2bb704b6be Merge branch 'fz-dev' into dev 2023-03-22 23:22:54 +03:00
MX
4d7232d5ed Update changelog 2023-03-22 23:22:18 +03:00
Shukai Ni
9a14699aa0 Fix relative links in .md files (#2528)
Fixed some incorrect relative link, which caused 404 error when viewing in GitHub.
2023-03-23 05:19:07 +09:00
MX
73c7dce45a Merge pull request #395 from Willy-JL/ignore-api-mismatch
Fap loader add option to ignore api mismatch
2023-03-22 23:13:48 +03:00
Willy-JL
5ab574d7f2 Fap loader add option to ignore api mismatch 2023-03-22 20:01:52 +00:00
MX
9165b819f4 fix merge issues 2023-03-22 22:04:04 +03:00
MX
6057262c18 update submodule 2023-03-22 21:15:45 +03:00
MX
8002c6465d up 2023-03-22 21:13:59 +03:00
MX
795c8eeef7 Merge branch 'fz-dev' into dev 2023-03-22 21:13:39 +03:00
あく
7bf0a4786c [FL-3152] Screen streaming improvements (#2498)
* Rpc: reserve some bandwidth when screen streaming
* Move furi_hal_compress to toolbox/comporess
* Lib: heatshrink as external submodule, compile warnings fixes, better buffer management
* Lib: cleanup compressor definitions
* Rpc: add canvas orientation support
* Format Sources
2023-03-23 03:00:48 +10:00
MX
9daa51eda4 Update DS1420 to latest changes 2023-03-22 18:41:50 +03:00
MX
a81b794475 Merge branch 'fz-dev' into dev 2023-03-22 18:36:59 +03:00
Georgii Surkov
8b224ecb15 [FL-3179] 1-Wire Overdrive Mode (#2522)
* Separate ibutton to its own module, add one_wire to f18
* Move onewire cli to a separate app
* Add definitions for normal and overdrive timings
* Update api definitions
* Add rough overdrive timings definition for onewire emulation
* Remove one_wire_host_timing.h
* Add rough overdrive timings for onewire host
* Improve overdrive mode
* Working overdrive mode from flipper to flipper
* Update thermometer example app
* Turn on otg power when running thermometer example app
* Implement reset overdrive switching
* Always exit out of overdrive mode
* Improve overdrive timings
* Fix typos
* Fix reset behaviour
* Use overdrive mode everywhere in DS1996
* Improve comments
* Bump API version

Co-authored-by: あく <alleteam@gmail.com>
2023-03-22 23:54:06 +09:00
Nikolay Minaylov
1f236ede0e [#2501] Disable UART IRQs by default (#2523)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-22 23:41:14 +09:00
あく
973287b09b Github: wipe workspace before checkout (#2527)
* Github: wipe workspace before checkout

* Github: allow find to fail

* Github: limit maxdepth for find
2023-03-22 15:26:40 +04:00
あく
acc32f66e8 Github: force cleanup tree on decontaminate (#2526) 2023-03-22 14:48:41 +04:00
Shukai Ni
204b50381a Correct FAP default upload path in AppsOnSDCard.md (#2524)
Since the fap's source code is in `applications_user`, the documentation should also point to `applications_user` as the parent directory
2023-03-22 18:47:47 +09:00
MX
94d238c611 Add 418mhz to hopping list 2023-03-21 23:38:37 +03:00
MX
5b6b081664 GSN - Add manually support 2023-03-21 20:09:18 +03:00
MX
df766b1476 Update changelog 2023-03-21 19:08:58 +03:00
MX
8373a21af2 Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-03-21 19:03:53 +03:00
MX
c9cc2b5e20 extra pack dev branch 2023-03-21 18:08:13 +03:00
MX
0d03039c19 Merge branch 'fz-dev' into dev 2023-03-21 18:05:13 +03:00
MX
f5b818541e Add 318 mhz back to hopping list 2023-03-21 17:57:46 +03:00
Sam Edwards
6089e9210f BadUSB: implement boot protocol (#2496)
* BadUSB: remove unused out EP
* BadUSB: do not use iad for a single interface
* BadUSB: implement the boot protocol
* BadUSB: implement SET_PROTOCOL
* Improve HID report descriptor readability
* CODEOWNERS update

Co-authored-by: nminaylov <nm29719@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-03-21 23:53:07 +09:00
MX
db54c463e6 Fix hopper stuck at 433.42 due to wide range tx'es
When we using 433.92 remote flipper in hopping mode will stuck at 433.42 and may loose signal because of that, need to avoid using close freqs in hopping, only freqs with bigger difference like 310 -> 315
2023-03-21 17:52:21 +03:00
Nikolay Minaylov
ce50b09b28 Remove hmac_sha256 from public API (#2519)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-21 21:29:54 +09:00
AloneLiberty
bf70f4b71a NFC: Fixed writing gen1a magic tags with invalid BCC (#2511)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-21 21:03:14 +09:00
あく
fd8607398d Github: unshallow on decontamination (#2521)
* Github: unshallow on decontamination
* Github: fix syntax
* Github: decontaminate without full tree
* Github: update decontaminate action in all workflows
2023-03-21 13:55:20 +04:00
MX
1d801c38f9 Merge branch 'dev' into release 2023-03-21 03:25:06 +03:00
MX
08a2e51feb Update changelog 2023-03-21 03:22:06 +03:00
MX
e62ac748ad Merge pull request #394 from amec0e/dev
Updated infrared assets
2023-03-21 03:20:34 +03:00
amec0e
1f881c6e47 Updated tv.ir
Updated last checked
2023-03-21 00:14:09 +00:00
amec0e
127f436315 Updated projectors.ir
Updated last checked
2023-03-21 00:13:47 +00:00
amec0e
f62de11de7 Updated fans.ir
updated Last checked
2023-03-21 00:11:38 +00:00
amec0e
6e810aacb4 Updated audio.ir
new additions
2023-03-21 00:11:07 +00:00
amec0e
2ff1e22ca9 Updated ac.ir
new addition
2023-03-21 00:10:44 +00:00
MX
8afdb5b7b4 Merge branch 'dev' into release 2023-03-21 03:06:21 +03:00
MX
c80405f880 WAV Player fixes
by @LTVA1
2023-03-21 03:04:22 +03:00
MX
83624b1dee Merge branch 'dev' into release 2023-03-21 02:59:07 +03:00
MX
b3ddca1aee Update changelog 2023-03-21 02:18:04 +03:00
MX
df8a57c972 Merge branch 'fz-dev' into dev 2023-03-21 01:38:41 +03:00
Nikolay Minaylov
0444a80f19 [FL-3134] BadUSB: Script interpreter refactoring (#2485)
* Script command and character tables
* Non-blocking stringdelay, docs update
* altchar/altstring fix
* Layout select UI fix
* Remove debug print

Co-authored-by: あく <alleteam@gmail.com>
2023-03-21 02:22:03 +09:00
MX
3d90e6151c Fix include paths 2023-03-20 20:08:02 +03:00
MX
5660111b28 Merge branch 'fz-dev' into dev 2023-03-20 20:04:22 +03:00
Skorpionm
445a1aa7b0 SubGhz: fix Incorrect comparison in subghz_setting_get_hopper_frequency (#2518)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-21 01:30:57 +09:00
Georgii Surkov
0917494a80 [FL-3168] Add one_wire lib to f18, separate ibutton (#2509)
* Separate ibutton to its own module, add one_wire to f18
* Move onewire cli to a separate app

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-03-21 01:23:17 +09:00
Georgii Surkov
1d91a572cc [FL-3182] Fix typos in iButton (#2506)
* Fix a typo: right shift instead of greater than
* Fix a typo: proper iButton part number

Co-authored-by: あく <alleteam@gmail.com>
2023-03-21 00:22:40 +09:00
hedger
60ac2e9881 [FL-3161] Improved debugging experience for external apps (#2507)
* debug: automated support for multiple debug symbol files
* faploader: extra checks for app list state
* debug: trigger BP before fap's EP if under debugger
* faploader, debug: better naming
* docs: info on load breakpoint
* faploader: header cleanup
* faploader: naming fixes
* debug: less verbose; setting debug flag more often
* typo fix
2023-03-21 00:03:55 +09:00
Sergey Gavrilov
f7024cff78 SD Driver: reinit sd card on error (#2493)
* SD Driver: reinit sd card on error
* SD Driver: cleanup fatfs bindings
* Storage: optimized glue
* Storage: move fatfs initialization to appropriate subsystems, minor code cleanup
* SD Driver: minor code cleanup

Co-authored-by: あく <alleteam@gmail.com>
2023-03-20 22:09:10 +09:00
Sergey Gavrilov
6ec62f48f9 [FL-3180] OTP programmer: return exit code based on error type (#2504) 2023-03-20 21:07:17 +09:00
MX
d14364a86c OFW PR: Fixed writing gen1a magic tags with invalid BCC
PR 2511 by AloneLiberty

https://github.com/AloneLiberty/flipperzero-firmware/tree/nfc-magic-write-fix
2023-03-19 15:34:05 +03:00
MX
76d3f84a5e Update WAV Player, 16 bit support
by @LTVA1, in current condition has some issues with rewind on 16bit files, but plays them without problems
2023-03-19 02:20:23 +03:00
MX
56c11c70b3 Fix minesweeper freeze bug, do some refactoring 2023-03-18 22:19:13 +03:00
MX
56adcf1ad8 Merge branch 'dev' into release 2023-03-18 06:44:59 +03:00
MX
9e94b1fae0 Testing links 2023-03-18 06:05:22 +03:00
MX
682ac85e0a Update docs 2023-03-18 04:19:53 +03:00
MX
9a93551a2d Add ability to disable favourite app in desktop settings
And update changelog
2023-03-18 04:13:04 +03:00
MX
147a1c7aaa iButton: Add DS1420 / Update changelog 2023-03-18 03:36:56 +03:00
MX
58d4f3b531 OFW PR: 2493 - SD Driver: reinit sd card on error
No issues was found during my own testing and running sd benchmarks, sorry for rushing, I may miss something, usually I prefer to wait for official review
2023-03-18 02:50:05 +03:00
Georgii Surkov
eb355d4a16 Fix a typo: right shift instead of greater than 2023-03-18 01:17:38 +03:00
MX
3444c5245e Tertiary favourite app 2023-03-18 01:16:34 +03:00
MX
9941457cdb Fix issue #387 2023-03-17 22:51:59 +03:00
MX
54cefb7884 Merge branch 'fz-dev' into dev 2023-03-17 17:54:05 +03:00
Astra
7de7fa293b Optimize trailing slash check (#2503)
* Optimize trailing slash check
2023-03-18 00:45:42 +10:00
MX
ad27f87a0c Fix submodules 2023-03-17 04:18:15 +03:00
MX
346cf299ee Merge branch 'dev' into release 2023-03-17 04:15:27 +03:00
MX
b0928fb3cd Fix subghz external module power issues 2023-03-17 00:27:01 +03:00
MX
559b0e9b40 Small UI fixes 2023-03-16 21:24:09 +03:00
MX
67e7325f43 Update readme and changelog 2023-03-16 18:30:00 +03:00
MX
2cefc9aab0 Security+ 2.0 custom buttons 2023-03-16 18:14:39 +03:00
MX
cda605f578 Merge branch 'fz-dev' into dev 2023-03-16 17:44:22 +03:00
Guido Giorgi
25fd3c3400 iButton: Add support for Dallas DS1971 v2 (#2492)
* iButton: Add DS1971 Support refactored for v2
* Fix requested by gsurkov
* Fix DALLAS_COMMON_CMD_* use, cusotm data field to Eeprom and COPY_SCRAPTCHPAD
* Fix Emulation + Memory Info + Docs
* Fix docs, strings, refactor code

Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-03-16 23:12:43 +09:00
hedger
771c47f809 fbt: explicitly set dist suffix length, not depending on environment settings. See (#2497) 2023-03-16 22:46:18 +09:00
MX
3c3ac216dc Remember if 5v was turned off, save its state 2023-03-16 16:03:22 +03:00
MX
5de507b0c8 Update changelog and readme 2023-03-16 15:19:51 +03:00
MX
bb9ac1389b Remember last state for CC1101 external + other fixes
Reset to internal module if external is not found on all apps, not only in bruteforcer
2023-03-16 15:02:23 +03:00
MX
49378f0893 Merge branch 'fz-dev' into dev 2023-03-16 13:49:24 +03:00
Astra
6aa0c08f3a [FL-3064] Skip the read when the card is not present (#2494)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-16 18:06:11 +09:00
Astra
e90042368f [FL-3156] Mark keys as not found when they couldn't auth successfully (#2476)
* Mark keys as not found when they couldn't auth successfully
* Improve logging and fix the reading bug

Co-authored-by: あく <alleteam@gmail.com>
2023-03-16 17:58:07 +09:00
Astra
9fbf327028 [FL-1799] Require the trailing slash for root paths (#2486)
* Require the trailing slash
* Fix the swapped storages
* Fix root paths
2023-03-16 17:28:50 +09:00
MX
353adf4fb7 Update changelog and readme 2023-03-16 00:24:53 +03:00
MX
968d6d578f Add retry and delay to avoid power issues with Wifi plugins 2023-03-16 00:07:37 +03:00
MX
2046ac6604 Lets try new changes for marauder companion
https://github.com/tcpassos/flipperzero-firmware-with-wifi-marauder-companion
2023-03-16 00:00:10 +03:00
MX
2a040f245f Merge branch 'fz-dev' into dev 2023-03-15 21:25:06 +03:00
hedger
d8385b7f91 gh: use shallow clones whenever possible (#2491)
* gh: use shallow clones whenever possible
* gh: reverted submodule checks
* gh: lint: joined linting scripts
* gh: renamed linter workflow
* check python linter output
* gh: reworked linter
* checking c linter
* gh: merged submodule check & lint
* gh: renamed step
* gh: removed redundant `submodules: false`

Co-authored-by: あく <alleteam@gmail.com>
2023-03-16 00:24:56 +09:00
Liam Hays
c27d4d78f9 Fix auto-capitalization in the keyboard when the text box is empty. (#2483)
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-03-15 23:51:15 +09:00
Leopold
a69ae93871 Add new nfc apdu cli command (#2482)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-15 22:52:32 +09:00
Eric Betts
e22668e196 Picopass standard KDF dictionary (#2478)
* Split iclass dictionaries based on KDF
* Allow cancelling during key test

Co-authored-by: あく <alleteam@gmail.com>
2023-03-15 21:35:11 +09:00
Skorpionm
3a242e5fc3 SubGhz: bugfix unable to send, new generated secplus_v2 protocol (#2488)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-15 21:16:52 +09:00
hedger
d12f76dacb Nfc: fixes for latest PVS-studio 7.23 (#2490) 2023-03-15 21:01:33 +09:00
MX
fe403c6994 Remove cdefines from external apps 2023-03-15 01:53:55 +03:00
MX
05e53cac26 Fix merge issues 2023-03-15 01:25:18 +03:00
MX
8b8b78d001 Move plugins to external folder 2023-03-15 01:25:18 +03:00
MX
dd99c22792 Merge branch 'fz-dev' into dev 2023-03-14 19:55:16 +03:00
あく
ccaa3864d5 Dolphin: new spring animation, weight adjust, drop winter animation. (#2489)
* Dolphin: add new spring animation, drop winter animation, adjust weights
* Readme: update application folder structure info
2023-03-15 01:02:27 +10:00
hedger
53435579b3 [FL-3097] fbt, faploader: minimal app module implementation (#2420)
* fbt, faploader: minimal app module implementation
* faploader, libs: moved API hashtable core to flipper_application
* example: compound api
* lib: flipper_application: naming fixes, doxygen comments
* fbt: changed `requires` manifest field behavior for app extensions
* examples: refactored plugin apps; faploader: changed new API naming; fbt: changed PLUGIN app type meaning
* loader: dropped support for debug apps & plugin menus
* moved applications/plugins -> applications/external
* Restored x bit on chiplist_convert.py
* git: fixed free-dap submodule path
* pvs: updated submodule paths
* examples: example_advanced_plugins.c: removed potential memory leak on errors
* examples: example_plugins: refined requires
* fbt: not deploying app modules for debug/sample apps; extra validation for .PLUGIN-type apps
* apps: removed cdefines for external apps
* fbt: moved ext app path definition
* fbt: reworked fap_dist handling; f18: synced api_symbols.csv
* fbt: removed resources_paths for extapps
* scripts: reworked storage
* scripts: reworked runfap.py & selfupdate.py to use new api
* wip: fal runner
* fbt: moved file packaging into separate module
* scripts: storage: fixes
* scripts: storage: minor fixes for new api
* fbt: changed internal artifact storage details for external apps
* scripts: storage: additional fixes and better error reporting; examples: using APP_DATA_PATH()
* fbt, scripts: reworked launch_app to deploy plugins; moved old runfap.py to distfap.py
* fbt: extra check for plugins descriptors
* fbt: additional checks in emitter
* fbt: better info message on SDK rebuild
* scripts: removed requirements.txt
* loader: removed remnants of plugins & debug menus
* post-review fixes
2023-03-14 23:29:28 +09:00
MX
84b2242636 Check for external module when launching from favourites 2023-03-13 23:19:33 +03:00
MX
d5ea5168a0 Prepare apps for next OFW changes
PR 2420 will change PLUGIN type meaning
2023-03-13 19:25:17 +03:00
MX
c560394358 External module power bug fixes 2023-03-13 18:43:50 +03:00
MX
5ddb9bd444 Correct hopping freqs, now it actually works good 2023-03-12 18:07:54 +03:00
MX
eb57f4c7e4 Fix ironlogic add manually 2023-03-12 15:53:06 +03:00
MX
027ae3f3f6 SubGHz: Add manually extend, add support for new protocols
Schellenberg / Stilmatic and Came Space keeloq protocols support
2023-03-12 15:32:47 +03:00
MX
d32c73ad57 Update subbrute and changelog 2023-03-11 17:28:45 +03:00
MX
f67a02203b Merge branch 'fz-dev' into dev 2023-03-10 14:21:43 +03:00
あく
4bd3dca16f Fbt: fix broken resource deployment (#2477) 2023-03-10 20:13:11 +09:00
Sergey Gavrilov
c5db1aaaf5 Revert "Revert "Embed assets in elf file (#2466)""
This reverts commit a04c01a2fd.
2023-03-10 13:57:44 +03:00
Sergey Gavrilov
a04c01a2fd Revert "Embed assets in elf file (#2466)"
This reverts commit 4fd043398a.
2023-03-10 01:43:46 +03:00
MX
a48adfbaf7 Fix some strange bug 2023-03-09 23:19:08 +03:00
MX
68fed0e03d Merge branch 'fz-dev' into dev 2023-03-09 21:17:57 +03:00
AloneLiberty
0190a161ba NFC: Fix 0 block write possibility in Mifare Classic emulation (#2474)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-10 02:50:25 +09:00
Leo Smith
5b05aeea82 [#1989] updated parser and added stringln, hold and release (#2448)
* updated parser and added stringln, hold and release
* removed unused code as requested from PR
* BadUsb: tiny change to trigger rebuild

Co-authored-by: p4p1 <p4p1@vivaldi.net>
Co-authored-by: あく <alleteam@gmail.com>
2023-03-10 02:42:34 +09:00
Michal Suchánek
780da7d4d5 Upside down / left handed orientation support (#2462)
* Add backup files to .gitignore
* Added lefty support in Settings > System > hand Orient: Fixes: #1015
* Left handed mode
* Fix lefthanded mode on vertical interfaces
* Input: new composite sequence identifier
* Gui: move input mapping from Canvas to ViewPort, properly handle input mapping on View switch in ViewDispatcher
* Rpc: proper input sequencing and tagging in RpcGui
* Rpc: remove magic from RpcGui

Co-authored-by: MrDaGree <5050898+MrDaGree@users.noreply.github.com>
Co-authored-by: Willy-JL <willy.leslie@icloud.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
2023-03-10 02:13:18 +09:00
MX
c68a9f325d Update TOTP
https://github.com/akopachov/flipper-zero_authenticator
2023-03-09 18:40:09 +03:00
Sergey Gavrilov
4fd043398a Embed assets in elf file (#2466)
* FBT: file_assets generator
* Elf file: process manifest section externally
* FBT, file_assets generator: add assets signature
* Storage: assets path alias
* Flipper application: assets unpacker
* Apps, Storage: use '/data' alias for apps data
* Storage: copy file to file
* Assets: log flag, fixes
* Update f18 api
* Assets: asserts
* Assets: fix signature_data check
* App assets: example
* Example assets: fix folder structure in readme
* Assets: fix error handling
* Assets builder: use ansii instead of utf-8, use .fapassets section instead of .fapfiles, add assets path to signature
* Elf file: comment strange places
* Storage: totaly optimized storage_file_copy_to_file
2023-03-10 01:01:53 +10:00
MX
dfc45eb0f9 Merge branch 'fz-dev' into dev 2023-03-09 16:58:51 +03:00
Astra
50ef5deefc [FL-3118] Dumb mode menu freeze fix (#2456)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-09 17:24:47 +09:00
MX
05489fda7d Merge branch 'dev' into release 2023-03-09 05:08:50 +03:00
MX
319108b11c Fix Unitemp small bug
Use OneWireHostSearchModeNormal instead of NORMAL_SEARCH
2023-03-09 05:03:31 +03:00
MX
ee41413c6a Update unitemp 2023-03-09 04:47:33 +03:00
MX
71daa3e0f8 When we select ON/OFF call power enable and disable 2023-03-09 04:33:19 +03:00
MX
1249ce9b94 Option to disable auto 5v power for external radio module
Now you can use 3.3v modules without wasting a battery (bonus a bit low noise on power line)
2023-03-09 04:02:31 +03:00
MX
da9b968fc9 No more noises 2023-03-09 04:01:24 +03:00
MX
b0af6f4b53 Update changelog 2023-03-09 02:39:40 +03:00
MX
7a413f390d NFC Magic fix - reinit nfc at start 2023-03-09 02:18:51 +03:00
MX
16df48bac6 Fix external module power disable 2023-03-09 01:23:57 +03:00
MX
3b2d0486a0 Update SWD Probe
https://github.com/g3gg0/flipper-swd_probe
2023-03-09 00:00:24 +03:00
MX
ed06aa48e9 Update changelog 2023-03-08 23:12:59 +03:00
MX
e941ef5952 Merge pull request #378 from amec0e/dev
Updated infrared assets
2023-03-08 22:53:24 +03:00
MX
5d9174ac9d Merge branch 'fz-dev' into dev 2023-03-08 22:52:11 +03:00
Eric Betts
5be15152eb PicoPass: auth cleanup (#2470)
* remove redundant auth methods
* Move picopass keys to new file
* CTF key
* Format sources
* PicoPass: add pragma once to picopass_keys.h

Co-authored-by: あく <alleteam@gmail.com>
2023-03-08 20:46:30 +09:00
Liam Hays
90958a6d23 More UI fixes and improvements (#2419)
* Unify spelling of confirm exit/retry across apps.
* Unify infrared exit/retry confirm menus?
* "Keyboard Layout", not "Keyboard layout".
* Make iButton read scene prompt less awkward.
* "Detect Reader" in MF Classic saved menu instead of "Detect reader"
* NFC menu spelling changes only.
* Remove \n in strings in widget_add_string_element() calls.

Co-authored-by: あく <alleteam@gmail.com>
2023-03-08 20:27:21 +09:00
MX
ab91dc1882 External module 5v power issues fixes 2023-03-08 01:09:17 +03:00
MX
cad2f2a065 Merge branch 'fz-dev' into dev 2023-03-08 00:46:38 +03:00
MX
086be92f69 SubGHz playlist - rewind (skip or play previous file)
by alvarotorijano

https://github.com/alvarotorijano/playListMod/blob/main/playlistMod.c
2023-03-08 00:33:48 +03:00
MX
28eb4d1060 Massive plugins refactoring
Not full refactoring, only small issues is fixed and moved all plugins to furi mutex instead of valuemutex

Many small issues was found and fixed due mutex upgrade

OFW removed 60 lines of code and it was painful
2023-03-08 00:18:23 +03:00
amec0e
2ff937a278 Updated tv.ir
New additions
2023-03-07 20:17:57 +00:00
amec0e
cdc44c502e Updated projectors.ir
New additions
2023-03-07 20:17:35 +00:00
amec0e
b37c3ccf92 Updated fans.ir
Updated last checked
2023-03-07 20:16:42 +00:00
amec0e
74259c2276 Updated audio.ir 2023-03-07 20:13:01 +00:00
amec0e
3dcd5538d0 Updated ac.ir 2023-03-07 20:11:26 +00:00
AloneLiberty
eb5dae1cda NFC: Support reading Mifare Classic key B from sector trailer, reading sector with B key where A key can't read block, Nfc Magic app not using NFC folder by default (in file select) (#2437)
* NFC: Support reading Mifare Classic key B from sector trailer and reusing it for other sectors
* NFC: Fix my pointer typo
* NFC: Fix reading sector with B key where A key can't read block (fixes #2413) and fix Nfc Magic app not using NFC folder by default (in file select)
* NFC: Fix strange bug

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-03-08 03:33:59 +09:00
MX
f0471a62e5 Merge branch 'fz-dev' into dev 2023-03-07 16:45:40 +03:00
Astra
9819306731 [Fl-3147] Remove ValueMutex (#2467)
* Move keypad_test to furi_mutex
* Move text_box_test to furi_mutex
* Move snake_game to furi_mutex
* Remove ValueMutex completely
* Snake Game: simplify code and fix PVS warning
* F18: sync API symbols

Co-authored-by: あく <alleteam@gmail.com>
2023-03-07 22:09:45 +09:00
MX
b872a12517 Merge branch 'fz-dev' into dev 2023-03-07 14:47:05 +03:00
Eric Betts
eefca9f498 Support reseting iCx cards (#2451)
* Support reseting iCx cards
* add submenu
* Fix auth
* switch key derivation to use same method
* test system keys using both elite and standard kdf

Co-authored-by: あく <alleteam@gmail.com>
2023-03-07 19:53:52 +09:00
MX
e0905597fc Merge branch 'fz-dev' into dev 2023-03-07 13:09:06 +03:00
MX
6511252140 Fix external module power init 2023-03-06 14:23:59 +03:00
MX
27000f1763 Update changelog 2023-03-06 13:02:09 +03:00
MX
ada343b7df Exclude 390Mhz from freq analyzer for external module 2023-03-06 12:30:20 +03:00
GuruSteve
9dd1fb64b7 Fixed picopass load save file overrun (#2464)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-06 16:59:48 +09:00
Michal Suchánek
c0e0403b44 Fix SD card CID parsing (#2463)
The recent SD rewrite dropped a couple of lines from the CID parsing
function resulting in zero manufacturing date displayed.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2023-03-06 16:44:26 +09:00
MX
6d0c3eb3b6 Properly rename unirf remix to subghz remote
And automatically migrate user files to new folder
2023-03-06 10:32:01 +03:00
MX
f25af91d23 Fix issues with external module 5v power 2023-03-06 10:08:59 +03:00
MX
507c8582ca Merge pull request #375 from Willy-JL/fix-unirf-freeze
Fix unirf freeze (protocol deserialize status ok)
2023-03-05 23:49:11 +03:00
Willy-JL
d780752d9e Fix unirf freeze (protocol deserialize status ok) 2023-03-05 20:39:42 +00:00
MX
2f567f3c3f Merge pull request #374 from 403-Fruit/patch-1
Blackjack game: fix bug counting more than one ace
2023-03-05 23:26:16 +03:00
MX
f612357150 Exclude 464Mhz from freq analyzer 2023-03-05 23:09:54 +03:00
Kevin
f1f2718598 Blackjack game: fix bug counting more than one ace
Take into account how many aces there are before using 11 as the value for an ace
2023-03-04 19:46:14 -10:00
hedger
4ab832cc46 github: check API versions for all targets to match on gh build (#2459)
* github: check API versions for all targets to match on gh build
* typo fix
* gh: forcing target mismatch to test pipeline
* reverted API version change
2023-03-05 14:17:33 +09:00
MX
920bee0532 Update changelog 2023-03-05 02:27:06 +03:00
MX
1a9544778b Default layout for non standard remotes 2023-03-04 05:42:53 +03:00
MX
dbee87a6c6 Merge branch 'fz-dev' into dev 2023-03-04 01:05:16 +03:00
MX
7e80ed6693 Add forgotten check 2023-03-04 01:04:59 +03:00
MX
db0c34f63e Update pocsag pager app to new error system 2023-03-04 01:03:14 +03:00
MX
056f2eb7d5 Return frequency check 2023-03-04 00:24:56 +03:00
MX
fe84e9521c More subghz updates and fixes 2023-03-04 00:03:04 +03:00
MX
91e2b466d3 Fix and update subghz protocols to use new error system 2023-03-03 23:34:43 +03:00
MX
b90060e574 Merge branch 'fz-dev' into dev 2023-03-03 23:22:40 +03:00
Nikolay Minaylov
5d4057f722 Archive browser: update path on dir leave (#2455) 2023-03-04 03:07:41 +09:00
Ethanol0001
0b7d205253 Update clock_app.c (#2446)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-04 01:15:17 +09:00
Skorpionm
72ca6b25e9 [FL-3106] SubGhz: better and more verbose error handling in protocols, stricter CAME validation (#2443)
* SubGhz: add error protocol
* WS: add error protocol
* SubGhz: error processing
* SubGhz: more stringent CAME protocol restrictions
* SubGhz: fix header duration CAME protocol
* SubGhz: delete comments
* SubGhz: sync SubGhzProtocolStatus with FuriStatus
* SubGhz: update documentation and bump api_version

Co-authored-by: あく <alleteam@gmail.com>
2023-03-04 00:09:13 +09:00
MX
4be64b6206 Merge branch 'fz-dev' into dev 2023-03-03 16:36:37 +03:00
Georgii Surkov
6cc5119c64 [FL-3117] Infrared: Fix hangups on repeated button press (#2441)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-03 21:37:02 +09:00
Astra
42d27d04f6 [FL-3127] Fix navigation on unsupported card types (#2440)
Co-authored-by: あく <alleteam@gmail.com>
2023-03-03 19:55:51 +09:00
Milk-Cool
fed4c28925 Fixed typo in fbt.md (#2452)
Co-authored-by: hedger <hedger@users.noreply.github.com>
2023-03-03 13:01:05 +03:00
andr0423
24f084d282 Fixed music player path for dummy mode (#2454)
Music player path changed #2453
2023-03-03 12:50:15 +03:00
MX
12b760e2e3 Revert music player changes (see desc)
Many users have a big library of music files downloaded on their microSD, migration will stuck for unknown amount of times, so app will hang up for super long time, migration is acceptable for other apps, for this one it will be reverted and it will work as before the app data changes
2023-03-03 08:52:27 +03:00
MX
43ef3d9bff Fix ibutton app - add manually - duplicate names 2023-03-03 07:34:49 +03:00
MX
3bdd171ce2 Update ibutton fuzzer to new ibutton system 2023-03-03 07:23:48 +03:00
MX
6ff0a5f318 Update calls to new filesystem api 2023-03-02 21:36:33 +03:00
MX
f3ab4bc292 Merge branch 'fz-dev' into dev 2023-03-02 21:18:35 +03:00
Georgii Surkov
806428efeb [FL-3070] iButton system and app refactoring (#2388)
* 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
* Update CODEOWNERS
* Add furi_hal_gpio_get_ext_pin_number
* Create README.md
* Temporary get Metakom and Cyfral keys out of the way
* Better enum name
* Syncing work, does not compile
* Syncing work, now compiles
* Working read impl for DS1990 and DS1992
* Add the ability to display extended key data
* Get rid of DialogEx
* Add save and load API
* Better iButtonKey encapsulation
* Fix crash
* Load key code boilerplate
* More load key code boilerplate
* Minor code cleanup
* Implement loading and saving DS1990 keys
* Implement the Info scene
* Implement loading & saving for DS1992
* Implement read error scene stub
* Implement delete confirmation screen
* Better error messages (protocol-dependent)
* Minor old code cleanup
* Remove iButtonDevice, add command callback to iButtonSlave
* Implement draft emulation for DS1990
* Better emulation for DS1990
* Initial emulation implementation for DS1992
* Better common command definitions
* Use common submenu callback, add protocol list
* Improve ViewData screen
* Improve scene_add_type
* Add stubs for write functionality
* Improve naming consistency
* Implement writing a DS1992 onto another one
* Improve DS1992 write code
* Improve DS1992 write code once more
* Prepare write_blank for DS1990, delete ibutton_writer
* Implement writing DS1990 onto blanks
* Fix reading DS1990
* Partially implement writing DS1992 onto blanks
* Implement GUI for writing keys
* Implement GUI for emulating keys
* Reduce memory usage for pretty_format
* Automatically truncate data more than 256 bytes
* Initial implementation of DS1996 (not tested)
* Fix crash due to missing virtual function
* Improve emulation code
* Improve DS1992 emulation code
* Correct return value for onewire_slave_send
* Correct return value for onewire_slave_receive
* Implement emulation for DS1992 & DS1996
* Better constant names
* Simplify & optimise the emulation code
* Remove duplicate code
* Add skip rom command emulation
* Show loading animation for large keys
* Implement manual adding & editing of keys
* Use buffered file streams to speed up saving & loading
* Reset key name before adding a new one
* Sync a buffered file stream before saving
* Use the DSGeneric protocol as a fallback option
* Implement emulation via RPC
* Refactor iButton code in preparation for comparator keys
* Refactor iButton code in preparation for comparator keys once more
* Make some functions static
* Make protocols not rely on one_wire classes
* Improve ProtocolDict usage
* Improve ProtocolDict usage more
* Implement reading Metakom & Cyfral keys
* Rename some files
* Better file structure
* Implement a unified interface for misc protocols
* Implement a unified interface for dallas protocols
* Concrete types for Dallas protocols
* Implement a unified interface for all key types
* Improved type naming
* Improved private types
* Proper types in protocol definitions
* Implement emulation for Cyfral & Metakom keys
* Implement save&load for Metakom & Cyfral keys
* Better type names
* Rename files, better names
* Allocate iButtonProtocols like a normal class
* Reset the key each time the start scene is selected
* Improve comments and constants
* Add ibutton_protocols to SDK headers
* Add ibutton_key to SDK headers
* Add ibutton_key to SDK headers
* Implement reading via cli
* Implement emulation via cli
* Implement writing Dallas blanks via cli
* Correctly revert the editing if cancelled by the user
* Correct committing mishap
* Elide the long text on the info screen
* Change key name for data in Misc keys
* Update iButtonFileFormat.md
* Remember the key's folder
* Save menu position in ReadKeyMenu and SavedKeyMenu
* Correct use of preselected path in file browser

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-03-02 22:23:33 +09:00
Astra
4359e2eaa9 [FL-3103] New pin reset splashscreen (#2405)
* New pin reset splashscreen
* Recovery: optimize drawing routine
* Recovery: increase erase confirmation time
* Change the required button

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-03-02 20:56:23 +09:00
Sergey Gavrilov
777a4d109d [FL-3055] Getter for application data path (#2181)
* Threads: application id
* Unit tests: appsdata getter test
* Unit tests: moar test cases for appsdata getter
* Unit tests: remove folders after test
* Storage: dir_is_exist, migrate, + unit_tests
* Plugins: migration
* Storage: common_exists, moar unit_tests 4 "common_migrate", "common_migrate" and "common_merge" bugfixes
* Storage: use FuriString for path handling
* Storage API: send caller thread id with path
* Storage: remove StorageType field in storage file list
* Storage: simplify processing
* Storage API: send caller thread id with path everywhere
* Storage: /app alias, unit tests and path creation
* Storage, path helper: remove unused
* Examples: app data example
* App plugins: use new VFS path
* Storage: file_info_is_dir
* Services: handle alias if the service accepts a path.
* App plugins: fixes
* Make PVS happy
* Storage: fix storage_merge_recursive
* Storage: rename process_aliases to resolve_path. Rename APPS_DATA to APP_DATA.
* Apps: use predefined macro instead of raw paths. Example Apps Data: README fixes.
* Storage: rename storage_common_resolve_path to storage_common_resolve_path_and_ensure_app_directory
* Api: fix version
* Storage: rename alias message
* Storage: do not create app folders in path resolving process in certain cases.

---------

Co-authored-by: Astra <93453568+Astrrra@users.noreply.github.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-03-02 03:57:27 +10:00
MX
f8dc1939cd Return kostyli and velosipedy back, apply different fix 2023-03-01 12:02:53 +03:00
MX
1b8cf6a5b1 Fix default frequency being overwritten bug 2023-03-01 11:57:16 +03:00
MX
1b12526357 Merge branch 'dev' into release 2023-03-01 03:11:36 +03:00
MX
1f6382e93d Update changelog and readme 2023-03-01 02:57:06 +03:00
Georgii Surkov
ab6b3f8ed3 Fix hangups when the user mashes the transmit button 2023-03-01 02:15:13 +03:00
Astra
cc52253e22 Exit to the main menu on pressing BACK 2023-03-01 02:14:56 +03:00
MX
cf6dc9f895 Fix timings for CAME protocol, Fix #280 2023-03-01 00:25:11 +03:00
MX
8deb29a8ff Fix #370 and fix other protocol counter 2023-02-28 21:45:55 +03:00
MX
e0f9697750 Add a special message in changelog for novices 2023-02-28 07:25:28 +03:00
MX
c3a6ba3c02 Small fixes 2023-02-28 07:09:13 +03:00
MX
75a8f0a7b4 Update changelog 2023-02-28 07:05:55 +03:00
MX
caa4ba67d6 Merge pull request #367 from clashlab/improve_hc-sr
hc_sr04: Improve accuracy by measuring microseconds
2023-02-28 06:59:17 +03:00
MX
9f6f391354 Update changelog and docs 2023-02-28 06:56:54 +03:00
MX
24726ab8a3 More precise debug counter ++ 2023-02-28 06:19:21 +03:00
MX
6bd5e22872 Somfy Telis - add manually 2023-02-28 06:15:55 +03:00
MX
cbb09b6812 BFT Programming mode and Add manually 2023-02-28 06:02:22 +03:00
MX
9c9688dd5b Nice One manual adding support 2023-02-28 00:41:14 +03:00
MX
21c52df090 bft programming mode & run fbt format 2023-02-28 00:10:16 +03:00
MX
2c95a7cba4 Somfy Telis - Custom buttons + Prog mode 2023-02-28 00:02:30 +03:00
MX
568176d775 App categories 2023-02-27 23:13:52 +03:00
MX
04250632d7 Merge branch 'fz-dev' into dev 2023-02-27 21:34:30 +03:00
Nikolay Minaylov
9ae58f5462 [FL-3116, FL-3136] BadUSB UI fixes (#2439) 2023-02-27 23:04:14 +09:00
あく
e6d1bcc421 Plugins: move to designated categories (#2438) 2023-02-27 23:33:45 +10:00
Clashlab
4439a83733 hc_sr04: Improve accuracy by measuring micro-seconds 2023-02-27 13:38:43 +01:00
MX
0f8d7dd6db Merge pull request #366 from MatthisC/features-mousejacker
Features mousejacker
2023-02-27 03:27:50 +03:00
MX
182296d8af Nice flor s - custom buttons 2023-02-27 01:13:21 +03:00
matthisc
cd14380dba Correcting bug on DEL and DELETE 2023-02-26 20:09:05 +01:00
MX
5b0c5a82c0 Merge branch 'fz-dev' into dev 2023-02-26 21:24:38 +03:00
あく
478390de19 Drivers: remove excessive check in bq25896 and make PVS happy (#2436) 2023-02-27 04:06:19 +10:00
あく
b054912167 F8, F18: bump API symbols version (#2435) 2023-02-27 03:39:26 +10:00
Shane Synan
09edf66a2a FuriHal, Power, UnitTests: fix, rename battery charging voltage limit API (#2228)
* FuriHal, Power, UnitTests: rename battery charge voltage limit API
* FuriHal: bump API, power info major versions
* Power: fix battery charge voltage limit for > 7.935v

Co-authored-by: あく <alleteam@gmail.com>
2023-02-27 02:23:39 +09:00
あく
1d55aee39c Fix incorrect type choise condition in image compressor (#2434) 2023-02-27 02:29:42 +10:00
あく
3efb7d4050 Updater: handle storage errors when removing files, fix folder remove routine, prevent unused services from starting (#2432)
* Updater: handle storage errors when removing files
* Updater: properly handle folder removal in post update cleanup stage. Prevent power, desktop and dolphin services from starting on update.
* Desktop, Dolphin, Power: proper handling and message for special boot mode.
* Desktop, Power: add missing TAG
* Updater: unify start skip message and fix double delete in backup worker
* Cli: unify special boot mode message
2023-02-27 00:15:26 +09:00
Astra
0c06e54831 [FL-3105] Unify power info, power debug, and device_info into one info command (#2393)
* Unify power info, power debug, and device_info into one info command
* Fix the storage script
* Cli: return device_info command for compatibility, rollback storage script
* Cli: remove unused context in info_get calls
* Cli: cleanup device info callbacks, switch to new separator

Co-authored-by: あく <alleteam@gmail.com>
2023-02-26 21:28:52 +09:00
MX
a61286bd43 Merge branch 'fz-dev' into dev 2023-02-26 14:34:31 +03:00
Sergey Gavrilov
9bda3e62ee SD Cache: moved to diskio layer, invalidation in case of error (#2428)
Co-authored-by: あく <alleteam@gmail.com>
2023-02-26 20:28:51 +09:00
matthisc
905273e066 Adding function to detect end of altcode 2023-02-26 10:38:40 +01:00
matthisc
16fe62e98d Adding ALTSTRING feature for non-qwerty keyboards 2023-02-26 10:29:56 +01:00
matthisc
958797062d Improving logic of mod keys when releasing a key 2023-02-26 10:23:33 +01:00
matthisc
2bb76e09c6 Adding TAB command 2023-02-26 10:14:14 +01:00
matthisc
33dd256dfb Correcting bug on DEL and DELETE key 2023-02-26 10:10:00 +01:00
MX
295fd3d0c0 Merge branch 'fz-dev' into dev 2023-02-26 11:16:01 +03:00
MX
efdf24d711 Merge branch 'fz-dev' into dev 2023-02-26 11:11:00 +03:00
MX
12c1ec37a2 Fix PVS warnings (#2430)
Co-authored-by: あく <alleteam@gmail.com>
2023-02-26 17:08:05 +09:00
Eric Betts
03f889962b Picopass: factory key support, app rename and move to NFC category, minor code cleanup (#2417)
* message on successful card write
* auth using factory key
* auth using factory default
* factory default screen
* write standard iclass key
* pass block explicitly
* Fix array indexing, add empty detection
* PicoPass: rename app and move to NFC group, minor code cleanup

Co-authored-by: あく <alleteam@gmail.com>
2023-02-26 16:59:50 +09:00
MX
802035d92e Merge branch 'dev' into release 2023-02-26 06:51:31 +03:00
MX
0bc995bfab Update changelog 2023-02-26 06:41:50 +03:00
MX
a19768e376 Throw small delay 2023-02-26 06:39:42 +03:00
MX
0bf0267edd Fix pvs warnings from OFW 2023-02-26 06:07:31 +03:00
MX
b3559bf058 Update changelog 2023-02-26 05:56:31 +03:00
MX
2b8f55322e Merge branch 'fz-dev' into dev 2023-02-26 05:51:58 +03:00
MX
b15a15411f Revert "Fix BadUSB bug (#365)"
This reverts commit 543346f885.
2023-02-26 05:51:37 +03:00
MX
39329eb422 Update lightmeter plugin 2023-02-26 05:46:50 +03:00
MX
115257ea59 Update readme and changelog 2023-02-26 05:29:18 +03:00
MX
a71abedd25 Rename some vars 2023-02-26 05:25:22 +03:00
MX
b53924c27a Infrared debug settings - output pin 2023-02-26 05:23:26 +03:00
MX
543346f885 Fix BadUSB bug (#365) 2023-02-26 04:22:06 +03:00
MX
a435959ee3 Fix counter settings being reset w custom btns 2023-02-26 04:14:55 +03:00
MX
d33b092a9d Fix Subghz item removal bug 2023-02-26 04:13:28 +03:00
MX
f676072e15 Fix custom button counter bug 2023-02-26 01:09:08 +03:00
MX
098d6944c4 Update changelog 2023-02-26 00:38:11 +03:00
MX
172c0e077f Fix counter 2023-02-25 23:25:32 +03:00
MX
4dbb55d740 Beninca support 2023-02-25 23:10:59 +03:00
MX
ba09da107a Worst code ever
subghz imporvements

- hold right to delete signal in read
- extra buttons in saved signals
- ability to change counter increase value in debug
2023-02-25 22:28:35 +03:00
n30f0x
eaf965c66f BadUsb: STRINGDELAY feature, worker signal handling refactoring (#2269)
* BadUsb: Added stringdelay feature
* BadUsb: added stringdelay feature, fixed delay
* BadUsb: fix cursed delay structure
* BadUsb: long delay check added
* BadUsb: long delay distribution
* furi_delay_ms(0) edgecase fix, add documentation entry
* additional documentation entry
* BadUsb: get rid of bad logic, fixed documentation
* BadUSB script: fix events handling
* Delay value fix
* Script execution fix

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: nminaylov <nm29719@gmail.com>
2023-02-26 02:34:48 +09:00
Logandev_
e999c35749 Grammar fix in CLI (#2390)
* fixed grammar
* Update cli_commands.c: made it a little nicer

Co-authored-by: あく <alleteam@gmail.com>
2023-02-25 22:49:53 +09:00
Mathie
203adabc46 Update update.py (#2426)
Fixed grammar mistake

Co-authored-by: あく <alleteam@gmail.com>
2023-02-25 22:41:49 +09:00
Konstantin Volkov
82ad44a863 changed updater and unit benches (#2427)
* changed updater and unit benches
* switched flipper name from macos style to searching

Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
2023-02-25 21:05:02 +09:00
MX
a24d0f1958 Merge branch 'dev' into release 2023-02-24 06:12:29 +03:00
MX
86da6a7ffe Update changelog 2023-02-24 04:15:32 +03:00
MX
36e7b9185a Merge pull request #362 from Willy-JL/fix-keyboard-capitalization
Fix keyboard capitalization bug
2023-02-24 04:06:57 +03:00
Willy-JL
f8eda660d2 Keyboard long press first char for lowercase 2023-02-24 00:50:00 +00:00
Willy-JL
f3e3e828aa Fix keyboard capitalization bug 2023-02-24 00:22:43 +00:00
MX
c230d09dad Faster Turn OFF hold time 2023-02-24 03:04:36 +03:00
MX
72fd448541 replace paths 2023-02-24 03:04:12 +03:00
MX
07ff0c7d97 Add SWD Probe into main FW
Moved from extra pack to main FW

https://github.com/g3gg0/flipper-swd_probe
2023-02-24 02:43:42 +03:00
MX
76f84b50e6 Merge pull request #358 from amec0e/dev
Updated audio.ir
2023-02-22 04:50:23 +03:00
amec0e
1f3e937471 Updated audio.ir
Fixed rename of a power button
2023-02-21 23:35:00 +00:00
MX
32f11f59b0 Merge pull request #357 from amec0e/dev
Updated infrared assets
2023-02-21 23:57:58 +03:00
MX
202a97eb74 Merge pull request #352 from Round-Pi/dev2
typo combing
2023-02-21 23:56:59 +03:00
MX
f9db06b781 fbt format 2023-02-21 23:42:12 +03:00
MX
5132b16305 Merge branch 'dev' into dev2 2023-02-21 23:23:07 +03:00
MX
a0b02b0110 Merge branch 'fz-dev' into dev 2023-02-21 23:10:51 +03:00
amec0e
36debf25fb Updated tv.ir
Updated last checked
2023-02-21 15:27:01 +00:00
amec0e
d16d1f43fc Updated projectors.ir
New additions
2023-02-21 15:26:38 +00:00
amec0e
11b3484f4b Updated fans.ir
Updated last checked
2023-02-21 15:25:51 +00:00
amec0e
2bcb15b8bc Updated audio.ir
New additions
2023-02-21 15:25:20 +00:00
amec0e
9690dba7fe Updated ac.ir
New additions
2023-02-21 15:21:57 +00:00
Liam Hays
663eb6cd6d Display Mifare Classic data in NFC app (#2389)
* Add data display for Mifare Classic cards.
* Clean up log statements and data display.

Co-authored-by: あく <alleteam@gmail.com>
2023-02-21 16:15:48 +09:00
Round-Pi
e9aa2d3449 Merge branch 'DarkFlippers:dev' into dev2 2023-02-20 21:24:32 -05:00
MX
7d4bffb575 Merge branch 'fz-dev' into dev 2023-02-21 03:00:48 +03:00
Round-Pi
b89902942b typo combing 2023-02-20 10:55:53 -05:00
MX
0a3ff7f85a Show RSSI in Weather Station app (#2395)
* Show RSSI in weather station app: copy changes from main SubGHz app
* WeatherStation: remove dead code
* WeatherStation: sync naming schema with current code.

Co-authored-by: あく <alleteam@gmail.com>
2023-02-21 00:19:53 +09:00
Astra
b15c4afea1 [FL-3122] Re-init NFC when starting the worker (#2399)
* Re-init NFC when starting the worker
* FuriHal: cleanup nfc init/deinit sequence
* FuriHal: a little bit more defensive nfc init

Co-authored-by: あく <alleteam@gmail.com>
2023-02-20 23:44:03 +09:00
Igor Danilov
738e0df4f4 Delete rwfiletest.bin on exit SDcard benchmark (#2415)
* Update storage_settings_scene_benchmark.c: delete rwfiletest.bin on exit SDcard brencmark
* Settings: cleanup SD Benchmark temp file only if test successful


Co-authored-by: あく <alleteam@gmail.com>
2023-02-20 21:52:15 +09:00
Max Andreev
3de6ae07b7 [FL-2974] Up toolchain version to 21 (#2416)
Co-authored-by: あく <alleteam@gmail.com>
2023-02-20 21:21:29 +09:00
ComputerCarsten
78afaab7e8 IR Universal Audio Remote: Add Grundig CMS 5000 (#2414)
Add Grundig CMS 5000 to Infrared Universal Audio Remote.
The 'Play' button doubles as 'Pause' button.
The 'Pause' button is unused.
Issue:
'Prev' button rewinds to start of title, to skip to previous title two consecutive button presses in a short time are required, however the timing is not satisfied.
2023-02-20 12:24:51 +03:00
MX
80a64d8e1a Merge branch 'fz-dev' into dev 2023-02-17 21:55:32 +03:00
Max Andreev
c7fbc8323b Toolchain 20 rollback (#2410)
* Toolchain rollback
* Remove extra code
2023-02-18 01:06:48 +09:00
hedger
335f8b9aff fbt: FBT_QUIET option; docs on environment (#2403)
* fbt: added FBT_QUIET to suppress toolchain version output; docs: added info on fbt environment
* docs: typo fixes
* fbt: fix for FBT_QUIET handling on *nix
* Add FBT_VERBOSE flag
* Add export
* Fix export
* docs: updates for FBT_VERBOSE

Co-authored-by: DrunkBatya <drunkbatya.js@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-02-17 21:22:08 +09:00
Mathie
009c9b1b71 Update nfc_cli.c (#2402)
Modified the f to a capital F, looks cleaner.

Co-authored-by: あく <alleteam@gmail.com>
2023-02-17 20:43:06 +09:00
MX
ab515aeebb Merge branch 'fz-dev' into dev 2023-02-17 13:07:56 +03:00
Max Andreev
487d03eca4 Fix openssl path again (#2409)
* Temp fix openssl  cert path
* Moving fix from CI to fbtenv
* Fix openssl again
2023-02-17 18:59:08 +09:00
Max Andreev
32b74b968e Fix openssl cert path in fbtenv (#2408)
* Temp fix openssl  cert path
* Moving fix from CI to fbtenv
2023-02-17 18:16:53 +09:00
Ari Bytyqi
1e98361299 Fixed first start animation typo (#2384)
* fixed first start animation typo
* updated pixels. (bottom left corner was off by two pixels)

Co-authored-by: jbohack <joebohack@gmail.com>
2023-02-17 17:17:57 +09:00
MX
ee2f6581bb Merge remote-tracking branch 'origin/dev' into dev 2023-02-17 04:27:11 +03:00
MX
5b0f74bffa Add missing buttons into hid app, remove old app
Now its all in one app, compiles as two apps that will be placed in misc folder
2023-02-17 04:27:01 +03:00
MX
faac423772 Merge pull request #338 from Willy-JL/autolock-with-pin
Autolock with pin code
2023-02-17 03:40:15 +03:00
MX
aae37121d6 Bump Settings file version to 7, cuz struct is changed and requires upd
Settings are saved as binary struct dump, so if we make any change to struct, we need to bump a version since it will not be compatible with older file in any case
2023-02-17 03:36:34 +03:00
Willy-JL
660f97f241 Add desktop auto lock with pin setting 2023-02-16 23:21:35 +00:00
Willy-JL
387e9431f5 Merge branch 'dev' of https://github.com/DarkFlippers/unleashed-firmware into autolock-with-pin 2023-02-16 23:04:38 +00:00
MX
fd46bd1886 Update readme and docs 2023-02-17 00:14:16 +03:00
MX
883f67d6d1 Merge pull request #343 from p3ngu19z/dev
Improve Tetris fall speed algorithm
2023-02-17 00:00:13 +03:00
p3ngu19z
a52f64acfd Improve fall speed algorithm 2023-02-16 11:23:46 +02:00
MX
4f4ccaa727 Merge pull request #340 from amec0e/dev
Updated infrared assets
2023-02-15 23:36:19 +03:00
MX
85f6ee2870 Merge branch 'fz-dev' into dev 2023-02-15 23:33:35 +03:00
MX
d81653461c sync anims 2023-02-15 23:33:30 +03:00
amec0e
55cfccafaf Updated tv.ir
New additions
2023-02-15 19:34:42 +00:00
amec0e
58e9acc19e Updated projectors.ir
Updated last checked
2023-02-15 19:34:14 +00:00
amec0e
6bcb9a60f7 Updated fans.ir
New additions
2023-02-15 19:33:43 +00:00
amec0e
5a02a51bd9 Updated audio.ir
new additions
2023-02-15 19:33:17 +00:00
amec0e
4aae197cf7 Updated ac.ir
new additions
2023-02-15 19:32:40 +00:00
Max Andreev
2fdebb639b [FL-3098] Up toolchain to version 20 (#2397)
* Up toolchain to 20
* Python reformat, add version info into fbtenv

Co-authored-by: あく <alleteam@gmail.com>
2023-02-16 01:56:25 +09:00
あく
25e8947282 Dolphin: drop holiday animation (#2398) 2023-02-15 20:05:08 +10:00
Willy-JL
34f0aced2f Autolock with pin code 2023-02-15 02:04:16 +00:00
MX
da68f2e4ed Merge branch 'dev' into release 2023-02-13 22:07:34 +03:00
MX
8f16dbb8e7 Merge branch 'dev' into release 2023-02-13 01:18:46 +03:00
MX
49e458f1b5 Merge branch 'dev' into release 2023-02-12 05:07:09 +03:00
MX
5cf46d2aa9 Merge branch 'dev' into release 2023-02-11 04:56:15 +03:00
MX
beedf54e75 Merge branch 'dev' into release 2023-02-11 04:35:02 +03:00
MX
70ccb89c3d fix submodule update 2023-02-04 23:52:13 +03:00
MX
5ea43a2a4b Merge branch 'dev' into release 2023-02-04 23:50:09 +03:00
MX
41f60dbbf4 Merge branch 'dev' into release 2023-01-19 22:45:38 +03:00
MX
827341ec08 Merge branch 'dev' into release 2023-01-19 01:53:01 +03:00
MX
5c36043d03 Merge branch 'dev' into release 2022-12-31 03:21:55 +03:00
MX
cf5811f8d9 Merge branch 'dev' into release 2022-12-31 02:59:26 +03:00
MX
ec6a169bf8 Merge branch 'dev' into release 2022-12-19 21:57:35 +03:00
MX
f1dec87c1b Merge branch 'dev' into release 2022-12-19 20:52:17 +03:00
MX
ab29951a99 Merge branch 'dev' into release 2022-12-19 19:26:06 +03:00
MX
bbe9f88bbe Merge branch 'dev' into release 2022-12-11 01:34:50 +03:00
MX
9188bf0013 Merge branch 'dev' into release 2022-12-10 04:38:04 +03:00
MX
f33ed59567 Merge branch 'dev' into release 2022-12-03 01:04:48 +03:00
MX
3fd8c80861 Merge branch 'dev' into release 2022-12-03 00:59:18 +03:00
MX
7b8ac3a5a0 Merge branch 'dev' into release 2022-11-30 21:05:08 +03:00
MX
6fef957001 Merge branch 'dev' into release 2022-11-24 04:02:59 +03:00
MX
0de1c9df89 Merge branch 'dev' into release 2022-11-24 03:45:52 +03:00
MX
a0e8cfbe97 Merge branch 'dev' into release 2022-11-24 03:41:01 +03:00
2046 changed files with 54482 additions and 18496 deletions

View File

@@ -36,13 +36,6 @@ Min level: 1
Max level: 1
Weight: 3
Name: L1_Happy_holidays_128x64
Min butthurt: 0
Max butthurt: 14
Min level: 1
Max level: 3
Weight: 4
Name: L1_Read_books_128x64
Min butthurt: 0
Max butthurt: 8
@@ -141,9 +134,9 @@ Min level: 3
Max level: 3
Weight: 3
Name: L1_Sleigh_ride_128x64
Name: L1_Senpai_128x64
Min butthurt: 0
Max butthurt: 14
Max butthurt: 5
Min level: 1
Max level: 3
Weight: 4

View File

@@ -11,7 +11,7 @@ steps:
image: alpine/git
commands:
- git submodule sync
- git -c protocol.version=2 submodule update --init --force --recursive
- git -c protocol.version=2 submodule update --init --force --recursive --jobs 4
- git submodule foreach git config --local gc.auto 0
- git log -1 --format='%H'
@@ -40,9 +40,9 @@ steps:
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
- git clone https://github.com/xMasterX/all-the-plugins.git
- cp -R all-the-plugins/apps/* assets/resources/apps/
- rm -rf all-the-plugins
- export DIST_SUFFIX=${DRONE_TAG}e
- export WORKFLOW_BRANCH_OR_TAG=release-cfw
- export FORCE_NO_DIRTY=yes
@@ -192,13 +192,16 @@ steps:
Version: {{build.tag}}
[-> Sponsor our project](https://boosty.to/mmxdev)
[-Github - Changelog-](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/${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)
[-Download latest extra apps pack-](https://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)
[-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})
@@ -220,7 +223,7 @@ steps:
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)'
- ./discord.sh --text 'New Unleashed firmware released!\n\nVersion - '${DRONE_TAG}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\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://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)\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
@@ -255,7 +258,7 @@ steps:
image: alpine/git
commands:
- git submodule sync
- git -c protocol.version=2 submodule update --init --force --recursive
- git -c protocol.version=2 submodule update --init --force --recursive --jobs 4
- git submodule foreach git config --local gc.auto 0
- git log -1 --format='%H'
@@ -278,9 +281,9 @@ steps:
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
- git clone --branch dev https://github.com/xMasterX/all-the-plugins.git
- cp -R all-the-plugins/apps/* assets/resources/apps/
- rm -rf all-the-plugins
- export DIST_SUFFIX=${DRONE_BUILD_NUMBER}e
- export WORKFLOW_BRANCH_OR_TAG=dev-cfw
- export FORCE_NO_DIRTY=yes
@@ -366,7 +369,7 @@ steps:
commands:
- curl -X POST -F 'key='$UPD_KEY'' $UPD_URL
- name: "Send files to telegram"
- name: "Send message to telegram"
image: appleboy/drone-telegram
settings:
token:
@@ -379,16 +382,27 @@ steps:
Build: {{build.number}}
SHA: {{commit.sha}}
Commit: https://github.com/DarkFlippers/unleashed-firmware/commit/{{commit.sha}}
Commit: {{commit.message}}
[-> Sponsor our project](https://boosty.to/mmxdev)
[-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})
[-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})"
- name: "Send build to telegram"
image: appleboy/drone-telegram
settings:
token:
from_secret: tgtoken
to:
from_secret: tgid_dev
format: markdown
message: "Regular Build:"
document:
- dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz
@@ -413,7 +427,7 @@ steps:
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}')'
- ./discord.sh --text 'Unleashed firmware dev build successful!\n\nBuild - '${DRONE_BUILD_NUMBER}'\n\nCommit - https://github.com/DarkFlippers/unleashed-firmware/commit/'${DRONE_COMMIT_SHA}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\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:

1
.github/FUNDING.yml vendored
View File

@@ -1,4 +1,3 @@
ko_fi: masterx
custom:
[
"https://boosty.to/mmxdev",

5
.gitignore vendored
View File

@@ -1,6 +1,8 @@
*~
*.swp
*.swo
*.gdb_history
*.old
# LSP
@@ -29,7 +31,7 @@ bindings/
Brewfile.lock.json
# Visual Studio Code
.vscode/
/.vscode/
# Kate
.kateproject
@@ -60,5 +62,6 @@ openocd.log
# PVS Studio temporary files
.PVS-Studio/
PVS-Studio.log
*.PVS-Studio.*
.gdbinit

13
.gitmodules vendored
View File

@@ -28,9 +28,12 @@
[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
[submodule "applications/external/dap_link/lib/free-dap"]
path = applications/external/dap_link/lib/free-dap
url = https://github.com/ataradov/free-dap.git
[submodule "applications/external/subbrute"]
path = applications/external/subbrute
url = https://github.com/DarkFlippers/flipperzero-subbrute.git
[submodule "lib/heatshrink"]
path = lib/heatshrink
url = https://github.com/flipperdevices/heatshrink.git

View File

@@ -44,3 +44,6 @@
# Functions that always return the same error code
//-V:picopass_device_decrypt:1048
# Examples
//V_EXCLUDE_PATH applications/examples/

View File

@@ -1 +1 @@
--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
--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/external/dap_link/lib/free-dap

View File

@@ -11,9 +11,10 @@
"args": {
"useSingleResult": true,
"env": {
"PATH": "${workspaceFolder};${env:PATH}"
"PATH": "${workspaceFolder};${env:PATH}",
"FBT_QUIET": 1
},
"command": "./fbt get_blackmagic",
"command": "fbt get_blackmagic",
"description": "Get Blackmagic device",
}
}

View File

@@ -1,22 +1,28 @@
### New changes
* 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
### New changes
* If you have copied any apps manually into `apps` folder - remove `apps` folder or that specific apps you copied on your microSD before installing this release to avoid issues!
* Plugins: RFID and iButton Fuzzer remove excessive free's (thanks @Willy-JL)
* Plugins: Use COUNT_OF in mouse jiggler
* Plugins: Added Numpad keyboard to HID app (by @clipboard1 | PR #452)
* About: Don't show 00 on about screens
* SubGHz: Combine FuriString allocs and other small changes
* Infrared: Updated universal remote assets (by @amec0e | PR #454)
* Update slideshow: Replace QR code with good old link
* OFW: Various Furi/FuriHal bug fixes and improvements -> **Breaking API change, api was changed from 24.x to 26.x**
* OFW: Loader refactoring, part 1 -> **Breaking API change, api was changed from 23.x to 24.x** **(this will make your manually copied plugins not work, update them in same way you installed them, or delete `apps` folder and then install firmware, if you using extra pack builds (with `e` in version) all apps in _Extra will be updated automatically)**
* OFW: Dolphin builder in ufbt; minor ufbt/fbt improvements
* OFW: Added API version to device info
* OFW: Gui: relax some asserts in view
* OFW: Move gauge calibration to separate header, add f18 calibration
* OFW: Fix TERMINFO on Linux systems
#### [🎲 Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)
#### [🎲 Download latest extra apps pack](https://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)
[-> How to install firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
[-> 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
* **Boosty** (patreon alternative): https://boosty.to/mmxdev
* 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`

View File

@@ -10,9 +10,7 @@
<br>
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!
Most stable custom firmware focused on new features and improvements of original firmware components, with almost no UI changes
<br>
@@ -27,7 +25,7 @@ Our Discord Community:
<br>
<br>
## Dev builds
## Dev builds (unstable)
- https://dev.unleashedflip.com/
- https://t.me/kotnehleb
## Releases in Telegram
@@ -37,7 +35,7 @@ Our Discord Community:
* 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
* FAAC SLH (Spa) & BFT Mitto (keeloq secure with seed) manual creation
* Sub-GHz static code brute-force plugin
* LFRFID Fuzzer plugin
* Custom community plugins and games added + all known working apps can be downloaded in extra pack in every release
@@ -45,22 +43,38 @@ Our Discord Community:
* 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
* 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
- BadUSB -> Keyboard layouts [(by rien > dummy-decoy)](https://github.com/dummy-decoy/flipperzero-firmware/tree/dummy_decoy/bad_usb_keyboard_layout)
- Sub-GHz -> External CC1101 module support - [(by quen0n)](https://github.com/DarkFlippers/unleashed-firmware/pull/307)
- Sub-GHz -> `Add manually` menu extended with new protocols
- 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)
* Sub-GHz -> Short press OK in frequency analyzer to save detected frequency for usage in Read modes
* Sub-GHz -> Long press OK button in Sub-GHz Frequency analyzer to switch to Read menu and automatically use selected frequency
* SubGHz -> New option to use timestamps + protocol name when you saving file, instead of random name - Enable in `Radio Settings -> Time in names = ON`
* SubGHz -> Read mode UI improvements (scrolling text, + shows time when signal was received) (by @wosk)
* Sub-GHz -> External CC1101 module support (Hardware SPI used)
* SubGHz -> **Hold right in received signal list to delete selected signal**
* SubGHz -> **Custom buttons for Keeloq / Alutech AT4N / Nice Flor S / Somfy Telis / Security+ 2.0** - now you can use arrow buttons to send signal with different button code
* SubGHz -> BFT Mitto / Somfy Telis / Nice Flor S manual creation with programming new remote into receiver (use button 0xF for BFT Mitto, 0x8 (Prog) on Somfy Telis)
* SubGHz -> Debug mode counter increase settings (+1 -> +5, +10, default: +1)
* SubGHz -> Debug PIN output settings for protocol development
* Infrared -> Debug TX PIN output settings
* Other small fixes and changes throughout
* See other changes in changelog and in readme below
* See other changes in readme below
Also check the changelog in releases for latest updates!
### Current modified and new Sub-GHz protocols list:
Thanks to Official team (to thier SubGHz Developer, Skorp) for implementing decoders for these protocols.
Thanks to Official team (to their SubGHz Developer, Skorp) for implementing decoders for these protocols in OFW.
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 [Not ALL systems supported for decode or emulation yet!] - [Supported manufacturers list](https://0bin.net/paste/VwR2lNJY#WH9vnPgvcp7w6zVKucFCuNREKAcOij8KsJ6vqLfMn3b)
Encoders or sending made by @xMasterX:
- Nero Radio 57bit (+ 56bit encoder improvements)
- Keeloq: HCS101
- Keeloq: AN-Motors
- Keeloq: JCM Tech
@@ -70,12 +84,18 @@ Encoders/sending made by Eng1n33r & @xMasterX:
- Keeloq: FAAC RC,XT
- Keeloq: Mutancode
- Keeloq: Normstahl
- Keeloq: Beninca + Allmatic
- Keeloq: Stilmatic / Schellenberg
- Keeloq: CAME Space
- Keeloq: Aprimatic (model TR and similar)
Encoders/sending made by @Eng1n33r & @xMasterX:
- CAME Atomo
- 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
- Keeloq: BFT Mitto [External seed calculation required (For info contact me in Discord: Nano#8998)] -> Update! check out new [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md)
- Star Line
- Security+ v1 & v2
Encoders made by @assasinfil & @xMasterX:
- Somfy Telis
@@ -86,7 +106,7 @@ Encoders made by @assasinfil & @xMasterX:
## 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.
I'm unemployed, 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
@@ -97,8 +117,7 @@ Our team is small and the guys are working on this project as much as they can s
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
* **Boosty** (patreon alternative): https://boosty.to/mmxdev
* 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`
@@ -118,11 +137,10 @@ You can support us by using links or addresses below:
- 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)
- 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)
- 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) -> Also outputs audio on `PA6` - `3(A6)` pin
- 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)
- ESP32: WiFi Marauder companion plugin [(by 0xchocolate)](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion) - Saving .pcap on flipper microSD [by tcpassos](https://github.com/tcpassos/flipperzero-firmware-with-wifi-marauder-companion) -> Only with custom marauder build (It is necessary to uncomment "#define WRITE_PACKETS_SERIAL" in configs.h (in marauder fw) and compile the firmware for the wifi board.) Or download precompiled build -> [Download esp32_marauder_ver_flipper_sd_serial.bin](https://github.com/justcallmekoko/ESP32Marauder/releases/latest)
- NRF24: Sniffer & MouseJacker (with changes) [(by mothball187)](https://github.com/mothball187/flipperzero-nrf24/tree/main/mousejacker)
- 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)
@@ -142,6 +160,8 @@ You can support us by using links or addresses below:
- 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)
- **SWD Probe** [(by g3gg0)](https://github.com/g3gg0/flipper-swd_probe)
- IR Scope [(by kallanreed)](https://github.com/DarkFlippers/unleashed-firmware/pull/407)
Games:
- DOOM (fixed) [(by p4nic4ttack)](https://github.com/p4nic4ttack/doom-flipper-zero/)
@@ -156,16 +176,8 @@ Games:
- 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)
- Bomberduck [(by leo-need-more-coffee)](https://github.com/leo-need-more-coffee/flipperzero-bomberduck)
### Other changes
- BadUSB -> Keyboard layouts [(by rien > dummy-decoy)](https://github.com/dummy-decoy/flipperzero-firmware/tree/dummy_decoy/bad_usb_keyboard_layout)
- 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/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
@@ -178,12 +190,20 @@ Games:
## [- How to change Flipper name](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/CustomFlipperName.md)
### **Plugins**
### **Sub-GHz**
## [- 🎲 Download Extra plugins for Unleashed](https://github.com/xMasterX/unleashed-extra-pack)
## [- 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 Sub-GHz frequencies](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzSettings.md)
## [- How to use Flipper as new remote (Nice FlorS, BFT Mitto, Somfy Telis, Aprimatic, AN-Motors, etc..)](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md)
## [- Configure Sub-GHz Remote App](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemotePlugin.md)
### **Plugins**
## [- 🎲 Download Extra plugins for Unleashed](https://github.com/xMasterX/all-the-plugins)
## [- TOTP (Authenticator) config description](https://github.com/akopachov/flipper-zero_authenticator/blob/master/docs/conf-file_description.md)
## [- Barcode Generator](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/BarcodeGenerator.md)
@@ -198,9 +218,9 @@ Games:
## [- 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: [NMEA] GPS](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/applications/external/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: i2c Tools](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/applications/external/flipper_i2ctools/README.md)
## [- How to use: [NRF24] plugins](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/NRF24.md)
@@ -218,20 +238,12 @@ Games:
## [- How to use: [GPIO] SentrySafe plugin](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SentrySafe.md)
### **Sub-GHz**
## [- 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 Sub-GHz frequencies](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzSettings.md)
<br>
<br>
# 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 - 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>
@@ -239,6 +251,9 @@ Games:
# Links
* Unofficial Discord: [discord.unleashedflip.com](https://discord.unleashedflip.com)
* Hello world - plugin tutorial (English): [https://github.com/DroomOne/Flipper-Plugin-Tutorial](https://github.com/DroomOne/Flipper-Plugin-Tutorial)
* Hello world - plugin tutorial (in Russian): [https://yakovlev.me/hello-flipper-zero/](https://yakovlev.me/hello-flipper-zero/)
* CLion IDE - How to setup workspace for flipper firmware development: [https://krasovs.ky/2022/11/01/flipper-zero-clion.html](https://krasovs.ky/2022/11/01/flipper-zero-clion.html)
* 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)

View File

@@ -139,34 +139,33 @@ if GetOption("fullenv") or any(
basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
distenv.Default(basic_dist)
dist_dir = distenv.GetProjetDirName()
dist_dir_name = distenv.GetProjectDirName()
dist_dir = distenv.Dir(f"#/dist/{dist_dir_name}")
external_apps_artifacts = firmware_env["FW_EXTAPPS"]
external_app_list = external_apps_artifacts.application_map.values()
fap_dist = [
distenv.Install(
distenv.Dir(f"#/dist/{dist_dir}/apps/debug_elf"),
list(
app_artifact.debug
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
),
dist_dir.Dir("debug_elf"),
list(app_artifact.debug for app_artifact in external_app_list),
),
*(
distenv.Install(
f"#/dist/{dist_dir}/apps/{app_artifact.app.fap_category}",
app_artifact.compact[0],
dist_dir.File(dist_entry[1]).dir,
app_artifact.compact,
)
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
for app_artifact in external_app_list
for dist_entry in app_artifact.dist_entries
),
]
Depends(
fap_dist,
list(
app_artifact.validator
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
),
list(app_artifact.validator for app_artifact in external_app_list),
)
Alias("fap_dist", fap_dist)
# distenv.Default(fap_dist)
distenv.Depends(firmware_env["FW_RESOURCES"], firmware_env["FW_EXTAPPS"].resources_dist)
distenv.Depends(firmware_env["FW_RESOURCES"], external_apps_artifacts.resources_dist)
# Copy all faps to device

View File

@@ -36,15 +36,20 @@ Applications for main Flipper menu.
- `u2f` - U2F Application
## plugins
## External
Extra apps for Plugins & App Loader menus.
External applications deployed to SD Card
- `bt_hid_app` - BT Remote controller
- `clock` - Clock application
- `dap_link` - DAP Link OnChip debugger
- `hid_app` - USB/BT Remote controller
- `music_player` - Music player app (demo)
- `picopass` - Picopass tool
- `nfc_magic` - NFC MFC Magic card application
- `picopass` - Picopass reader / writer
- `signal_generator` - Signal generator app: PWM and clock generator
- `snake_game` - Snake game application
- `spi_mem_manager` - SPI Memory reader / flasher
- `weather_station` - SubGHz weather station
## services

View File

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

View File

@@ -11,6 +11,7 @@ typedef struct {
uint16_t left;
uint16_t right;
uint16_t ok;
FuriMutex* mutex;
} KeypadTestState;
static void keypad_test_reset_state(KeypadTestState* state) {
@@ -22,7 +23,8 @@ static void keypad_test_reset_state(KeypadTestState* state) {
}
static void keypad_test_render_callback(Canvas* canvas, void* ctx) {
KeypadTestState* state = (KeypadTestState*)acquire_mutex((ValueMutex*)ctx, 25);
KeypadTestState* state = ctx;
furi_mutex_acquire(state->mutex, FuriWaitForever);
canvas_clear(canvas);
char strings[5][20];
@@ -51,7 +53,7 @@ static void keypad_test_render_callback(Canvas* canvas, void* ctx) {
canvas_draw_str(canvas, 10, 63, "[back] - reset, hold to exit");
release_mutex((ValueMutex*)ctx, state);
furi_mutex_release(state->mutex);
}
static void keypad_test_input_callback(InputEvent* input_event, void* ctx) {
@@ -64,17 +66,17 @@ int32_t keypad_test_app(void* p) {
FuriMessageQueue* event_queue = furi_message_queue_alloc(32, sizeof(InputEvent));
furi_check(event_queue);
KeypadTestState _state = {{false, false, false, false, false}, 0, 0, 0, 0, 0};
KeypadTestState state = {{false, false, false, false, false}, 0, 0, 0, 0, 0, NULL};
state.mutex = furi_mutex_alloc(FuriMutexTypeNormal);
ValueMutex state_mutex;
if(!init_mutex(&state_mutex, &_state, sizeof(KeypadTestState))) {
if(!state.mutex) {
FURI_LOG_E(TAG, "cannot create mutex");
return 0;
}
ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, keypad_test_render_callback, &state_mutex);
view_port_draw_callback_set(view_port, keypad_test_render_callback, &state);
view_port_input_callback_set(view_port, keypad_test_input_callback, event_queue);
// Open GUI and register view_port
@@ -83,7 +85,7 @@ int32_t keypad_test_app(void* p) {
InputEvent event;
while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
KeypadTestState* state = (KeypadTestState*)acquire_mutex_block(&state_mutex);
furi_mutex_acquire(state.mutex, FuriWaitForever);
FURI_LOG_I(
TAG,
"key: %s type: %s",
@@ -92,54 +94,54 @@ int32_t keypad_test_app(void* p) {
if(event.key == InputKeyRight) {
if(event.type == InputTypePress) {
state->press[0] = true;
state.press[0] = true;
} else if(event.type == InputTypeRelease) {
state->press[0] = false;
state.press[0] = false;
} else if(event.type == InputTypeShort) {
++state->right;
++state.right;
}
} else if(event.key == InputKeyLeft) {
if(event.type == InputTypePress) {
state->press[1] = true;
state.press[1] = true;
} else if(event.type == InputTypeRelease) {
state->press[1] = false;
state.press[1] = false;
} else if(event.type == InputTypeShort) {
++state->left;
++state.left;
}
} else if(event.key == InputKeyUp) {
if(event.type == InputTypePress) {
state->press[2] = true;
state.press[2] = true;
} else if(event.type == InputTypeRelease) {
state->press[2] = false;
state.press[2] = false;
} else if(event.type == InputTypeShort) {
++state->up;
++state.up;
}
} else if(event.key == InputKeyDown) {
if(event.type == InputTypePress) {
state->press[3] = true;
state.press[3] = true;
} else if(event.type == InputTypeRelease) {
state->press[3] = false;
state.press[3] = false;
} else if(event.type == InputTypeShort) {
++state->down;
++state.down;
}
} else if(event.key == InputKeyOk) {
if(event.type == InputTypePress) {
state->press[4] = true;
state.press[4] = true;
} else if(event.type == InputTypeRelease) {
state->press[4] = false;
state.press[4] = false;
} else if(event.type == InputTypeShort) {
++state->ok;
++state.ok;
}
} else if(event.key == InputKeyBack) {
if(event.type == InputTypeLong) {
release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
break;
} else if(event.type == InputTypeShort) {
keypad_test_reset_state(state);
keypad_test_reset_state(&state);
}
}
release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
view_port_update(view_port);
}
@@ -147,7 +149,7 @@ int32_t keypad_test_app(void* p) {
gui_remove_view_port(gui, view_port);
view_port_free(view_port);
furi_message_queue_free(event_queue);
delete_mutex(&state_mutex);
furi_mutex_free(state.mutex);
furi_record_close(RECORD_GUI);

View File

@@ -53,15 +53,17 @@ static void (*text_box_test_render[])(Canvas* canvas) = {
typedef struct {
uint32_t idx;
FuriMutex* mutex;
} TextBoxTestState;
static void text_box_test_render_callback(Canvas* canvas, void* ctx) {
TextBoxTestState* state = acquire_mutex((ValueMutex*)ctx, 25);
TextBoxTestState* state = ctx;
furi_mutex_acquire(state->mutex, FuriWaitForever);
canvas_clear(canvas);
text_box_test_render[state->idx](canvas);
release_mutex((ValueMutex*)ctx, state);
furi_mutex_release(state->mutex);
}
static void text_box_test_input_callback(InputEvent* input_event, void* ctx) {
@@ -74,17 +76,17 @@ int32_t text_box_test_app(void* p) {
FuriMessageQueue* event_queue = furi_message_queue_alloc(32, sizeof(InputEvent));
furi_check(event_queue);
TextBoxTestState _state = {.idx = 0};
TextBoxTestState state = {.idx = 0, .mutex = NULL};
state.mutex = furi_mutex_alloc(FuriMutexTypeNormal);
ValueMutex state_mutex;
if(!init_mutex(&state_mutex, &_state, sizeof(TextBoxTestState))) {
if(!state.mutex) {
FURI_LOG_E(TAG, "Cannot create mutex");
return 0;
}
ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, text_box_test_render_callback, &state_mutex);
view_port_draw_callback_set(view_port, text_box_test_render_callback, &state);
view_port_input_callback_set(view_port, text_box_test_input_callback, event_queue);
// Open GUI and register view_port
@@ -94,24 +96,24 @@ int32_t text_box_test_app(void* p) {
uint32_t test_renders_num = COUNT_OF(text_box_test_render);
InputEvent event;
while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
TextBoxTestState* state = acquire_mutex_block(&state_mutex);
furi_mutex_acquire(state.mutex, FuriWaitForever);
if(event.type == InputTypeShort) {
if(event.key == InputKeyRight) {
if(state->idx < test_renders_num - 1) {
state->idx++;
if(state.idx < test_renders_num - 1) {
state.idx++;
}
} else if(event.key == InputKeyLeft) {
if(state->idx > 0) {
state->idx--;
if(state.idx > 0) {
state.idx--;
}
} else if(event.key == InputKeyBack) {
release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
break;
}
}
release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
view_port_update(view_port);
}
@@ -119,7 +121,7 @@ int32_t text_box_test_app(void* p) {
gui_remove_view_port(gui, view_port);
view_port_free(view_port);
furi_message_queue_free(event_queue);
delete_mutex(&state_mutex);
furi_mutex_free(state.mutex);
furi_record_close(RECORD_GUI);

View File

@@ -1,12 +1,12 @@
App(
appid="UART_Echo",
name="UART Echo",
apptype=FlipperAppType.PLUGIN,
apptype=FlipperAppType.DEBUG,
entry_point="uart_echo_app",
cdefines=["APP_UART_ECHO"],
requires=["gui"],
stack_size=2 * 1024,
order=70,
fap_icon="uart_10px.png",
fap_category="GPIO",
fap_category="Debug",
)

View File

@@ -5,7 +5,6 @@
// v2 tests
void test_furi_create_open();
void test_furi_valuemutex();
void test_furi_concurrent_access();
void test_furi_pubsub();
@@ -30,10 +29,6 @@ MU_TEST(mu_test_furi_create_open) {
test_furi_create_open();
}
MU_TEST(mu_test_furi_valuemutex) {
test_furi_valuemutex();
}
MU_TEST(mu_test_furi_pubsub) {
test_furi_pubsub();
}
@@ -51,7 +46,6 @@ MU_TEST_SUITE(test_suite) {
// v2 tests
MU_RUN_TEST(mu_test_furi_create_open);
MU_RUN_TEST(mu_test_furi_valuemutex);
MU_RUN_TEST(mu_test_furi_pubsub);
MU_RUN_TEST(mu_test_furi_memmgr);
}

View File

@@ -1,41 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <furi.h>
#include "../minunit.h"
void test_furi_valuemutex() {
const int init_value = 0xdeadbeef;
const int changed_value = 0x12345678;
int value = init_value;
bool result;
ValueMutex valuemutex;
// init mutex case
result = init_mutex(&valuemutex, &value, sizeof(value));
mu_assert(result, "init mutex failed");
// acquire mutex case
int* value_pointer = acquire_mutex(&valuemutex, 100);
mu_assert_pointers_eq(value_pointer, &value);
// second acquire mutex case
int* value_pointer_second = acquire_mutex(&valuemutex, 100);
mu_assert_pointers_eq(value_pointer_second, NULL);
// change value case
*value_pointer = changed_value;
mu_assert_int_eq(value, changed_value);
// release mutex case
result = release_mutex(&valuemutex, &value);
mu_assert(result, "release mutex failed");
// TODO
//acquire mutex blocking case
//write mutex blocking case
//read mutex blocking case
mu_check(delete_mutex(&valuemutex));
}

View File

@@ -3,56 +3,63 @@
#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);
// Try to reset to default charge voltage limit
furi_hal_power_set_battery_charge_voltage_limit(4.208f);
}
MU_TEST(test_power_charge_voltage_exact) {
// Power of 16mV charge voltages get applied exactly
MU_TEST(test_power_charge_voltage_limit_exact) {
// Power of 16mV charge voltage limits 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());
furi_hal_power_set_battery_charge_voltage_limit(charge_volt);
mu_assert_double_eq(charge_volt, furi_hal_power_get_battery_charge_voltage_limit());
}
}
MU_TEST(test_power_charge_voltage_floating_imprecision) {
MU_TEST(test_power_charge_voltage_limit_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());
furi_hal_power_set_battery_charge_voltage_limit(4.016f);
mu_assert_double_eq(4.016f, furi_hal_power_get_battery_charge_voltage_limit());
}
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());
MU_TEST(test_power_charge_voltage_limit_inexact) {
// Charge voltage limits that are not power of 16mV get truncated down
furi_hal_power_set_battery_charge_voltage_limit(3.841f);
mu_assert_double_eq(3.840, furi_hal_power_get_battery_charge_voltage_limit());
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_charge_voltage_limit(3.900f);
mu_assert_double_eq(3.888, furi_hal_power_get_battery_charge_voltage_limit());
furi_hal_power_set_battery_charging_voltage(4.200f);
mu_assert_double_eq(4.192, furi_hal_power_get_battery_charging_voltage());
furi_hal_power_set_battery_charge_voltage_limit(4.200f);
mu_assert_double_eq(4.192, furi_hal_power_get_battery_charge_voltage_limit());
}
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());
MU_TEST(test_power_charge_voltage_limit_invalid_clamped) {
// Out-of-range charge voltage limits get clamped to 3.840 V and 4.208 V
furi_hal_power_set_battery_charge_voltage_limit(3.808f);
mu_assert_double_eq(3.840, furi_hal_power_get_battery_charge_voltage_limit());
furi_hal_power_set_battery_charge_voltage_limit(1.0f);
mu_assert_double_eq(3.840, furi_hal_power_get_battery_charge_voltage_limit());
// 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());
furi_hal_power_set_battery_charge_voltage_limit(4.240f);
mu_assert_double_eq(4.208, furi_hal_power_get_battery_charge_voltage_limit());
// Likewise, picking a number that the uint8_t wraparound in the driver would result in a
// VREG value under 23 if this test fails.
// E.g. (uint8_t)((8105-3840)/16) -> 10
furi_hal_power_set_battery_charge_voltage_limit(8.105f);
mu_assert_double_eq(4.208, furi_hal_power_get_battery_charge_voltage_limit());
}
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);
MU_RUN_TEST(test_power_charge_voltage_limit_exact);
MU_RUN_TEST(test_power_charge_voltage_limit_floating_imprecision);
MU_RUN_TEST(test_power_charge_voltage_limit_inexact);
MU_RUN_TEST(test_power_charge_voltage_limit_invalid_clamped);
power_test_deinit();
}

View File

@@ -84,7 +84,7 @@ static void test_rpc_setup(void) {
rpc = furi_record_open(RECORD_RPC);
for(int i = 0; !(rpc_session[0].session) && (i < 10000); ++i) {
rpc_session[0].session = rpc_session_open(rpc);
rpc_session[0].session = rpc_session_open(rpc, RpcOwnerUnknown);
furi_delay_tick(1);
}
furi_check(rpc_session[0].session);
@@ -104,7 +104,7 @@ static void test_rpc_setup_second_session(void) {
furi_check(!(rpc_session[1].session));
for(int i = 0; !(rpc_session[1].session) && (i < 10000); ++i) {
rpc_session[1].session = rpc_session_open(rpc);
rpc_session[1].session = rpc_session_open(rpc, RpcOwnerUnknown);
furi_delay_tick(1);
}
furi_check(rpc_session[1].session);
@@ -191,7 +191,7 @@ static void clean_directory(Storage* fs_api, const char* clean_dir) {
size_t size = strlen(clean_dir) + strlen(name) + 1 + 1;
char* fullname = malloc(size);
snprintf(fullname, size, "%s/%s", clean_dir, name);
if(fileinfo.flags & FSF_DIRECTORY) {
if(file_info_is_dir(&fileinfo)) {
clean_directory(fs_api, fullname);
}
FS_Error error = storage_common_remove(fs_api, fullname);
@@ -608,9 +608,8 @@ static void test_rpc_storage_list_create_expected_list(
}
if(path_contains_only_ascii(name)) {
list->file[i].type = (fileinfo.flags & FSF_DIRECTORY) ?
PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
list->file[i].type = file_info_is_dir(&fileinfo) ? PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
list->file[i].size = fileinfo.size;
list->file[i].data = NULL;
/* memory free inside rpc_encode_and_send() -> pb_release() */
@@ -873,7 +872,7 @@ static void test_rpc_storage_stat_run(const char* path, uint32_t command_id) {
if(error == FSE_OK) {
response->which_content = PB_Main_storage_stat_response_tag;
response->content.storage_stat_response.has_file = true;
response->content.storage_stat_response.file.type = (fileinfo.flags & FSF_DIRECTORY) ?
response->content.storage_stat_response.file.type = file_info_is_dir(&fileinfo) ?
PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
response->content.storage_stat_response.file.size = fileinfo.size;

View File

@@ -179,7 +179,7 @@ MU_TEST_1(test_dirwalk_full, Storage* storage) {
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
mu_check(storage_test_paths_mark(paths, path, file_info_is_dir(&fileinfo)));
}
dir_walk_free(dir_walk);
@@ -204,7 +204,7 @@ MU_TEST_1(test_dirwalk_no_recursive, Storage* storage) {
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
mu_check(storage_test_paths_mark(paths, path, file_info_is_dir(&fileinfo)));
}
dir_walk_free(dir_walk);
@@ -219,7 +219,7 @@ static bool test_dirwalk_filter_no_folder_ext(const char* name, FileInfo* filein
UNUSED(ctx);
// only files
if(!(fileinfo->flags & FSF_DIRECTORY)) {
if(!file_info_is_dir(fileinfo)) {
// with ".test" in name
if(strstr(name, ".test") != NULL) {
return true;
@@ -243,7 +243,7 @@ MU_TEST_1(test_dirwalk_filter, Storage* storage) {
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
mu_check(storage_test_paths_mark(paths, path, file_info_is_dir(&fileinfo)));
}
dir_walk_free(dir_walk);

View File

@@ -2,9 +2,40 @@
#include <furi.h>
#include <storage/storage.h>
// DO NOT USE THIS IN PRODUCTION CODE
// This is a hack to access internal storage functions and definitions
#include <storage/storage_i.h>
#define UNIT_TESTS_PATH(path) EXT_PATH("unit_tests/" path)
#define STORAGE_LOCKED_FILE EXT_PATH("locked_file.test")
#define STORAGE_LOCKED_DIR STORAGE_INT_PATH_PREFIX
#define STORAGE_TEST_DIR UNIT_TESTS_PATH("test_dir")
static bool storage_file_create(Storage* storage, const char* path, const char* data) {
File* file = storage_file_alloc(storage);
bool result = false;
do {
if(!storage_file_open(file, path, FSAM_WRITE, FSOM_CREATE_NEW)) {
break;
}
if(storage_file_write(file, data, strlen(data)) != strlen(data)) {
break;
}
if(!storage_file_close(file)) {
break;
}
result = true;
} while(0);
storage_file_free(file);
return result;
}
static void storage_file_open_lock_setup() {
Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage);
@@ -115,7 +146,7 @@ static int32_t storage_dir_locker(void* ctx) {
File* file = storage_file_alloc(storage);
furi_check(storage_dir_open(file, STORAGE_LOCKED_DIR));
furi_semaphore_release(semaphore);
furi_delay_ms(1000);
furi_delay_ms(100);
furi_check(storage_dir_close(file));
furi_record_close(RECORD_STORAGE);
@@ -152,9 +183,21 @@ MU_TEST(storage_dir_open_lock) {
mu_assert(result, "cannot open locked dir");
}
MU_TEST(storage_dir_exists_test) {
Storage* storage = furi_record_open(RECORD_STORAGE);
mu_check(!storage_dir_exists(storage, STORAGE_TEST_DIR));
mu_assert_int_eq(FSE_OK, storage_common_mkdir(storage, STORAGE_TEST_DIR));
mu_check(storage_dir_exists(storage, STORAGE_TEST_DIR));
mu_assert_int_eq(FSE_OK, storage_common_remove(storage, STORAGE_TEST_DIR));
furi_record_close(RECORD_STORAGE);
}
MU_TEST_SUITE(storage_dir) {
MU_RUN_TEST(storage_dir_open_close);
MU_RUN_TEST(storage_dir_open_lock);
MU_RUN_TEST(storage_dir_exists_test);
}
static const char* const storage_copy_test_paths[] = {
@@ -303,9 +346,256 @@ MU_TEST_SUITE(storage_rename) {
furi_record_close(RECORD_STORAGE);
}
#define APPSDATA_APP_PATH(path) APPS_DATA_PATH "/" path
static const char* storage_test_apps[] = {
"-_twilight_-",
"-_rainbow_-",
"-_pinkie_-",
"-_apple_-",
"-_flutter_-",
"-_rare_-",
};
static size_t storage_test_apps_count = COUNT_OF(storage_test_apps);
static int32_t storage_test_app(void* arg) {
UNUSED(arg);
Storage* storage = furi_record_open(RECORD_STORAGE);
storage_common_remove(storage, "/data/test");
int32_t ret = storage_file_create(storage, "/data/test", "test");
furi_record_close(RECORD_STORAGE);
return ret;
}
MU_TEST(test_storage_data_path_apps) {
for(size_t i = 0; i < storage_test_apps_count; i++) {
FuriThread* thread =
furi_thread_alloc_ex(storage_test_apps[i], 1024, storage_test_app, NULL);
furi_thread_set_appid(thread, storage_test_apps[i]);
furi_thread_start(thread);
furi_thread_join(thread);
mu_assert_int_eq(true, furi_thread_get_return_code(thread));
// Check if app data dir and file exists
Storage* storage = furi_record_open(RECORD_STORAGE);
FuriString* expected = furi_string_alloc();
furi_string_printf(expected, APPSDATA_APP_PATH("%s"), storage_test_apps[i]);
mu_check(storage_dir_exists(storage, furi_string_get_cstr(expected)));
furi_string_cat(expected, "/test");
mu_check(storage_file_exists(storage, furi_string_get_cstr(expected)));
furi_string_printf(expected, APPSDATA_APP_PATH("%s"), storage_test_apps[i]);
storage_simply_remove_recursive(storage, furi_string_get_cstr(expected));
furi_record_close(RECORD_STORAGE);
furi_string_free(expected);
furi_thread_free(thread);
}
}
MU_TEST(test_storage_data_path) {
Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage);
mu_check(storage_dir_open(file, "/data"));
mu_check(storage_dir_close(file));
storage_file_free(file);
// check that appsdata folder exists
mu_check(storage_dir_exists(storage, APPS_DATA_PATH));
// check that cli folder exists
mu_check(storage_dir_exists(storage, APPSDATA_APP_PATH("cli")));
storage_simply_remove(storage, APPSDATA_APP_PATH("cli"));
furi_record_close(RECORD_STORAGE);
}
MU_TEST(test_storage_common_migrate) {
Storage* storage = furi_record_open(RECORD_STORAGE);
// Setup test folders
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new"));
// Test migration from non existing
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
// Test migration from existing folder to non existing
mu_assert_int_eq(FSE_OK, storage_common_mkdir(storage, UNIT_TESTS_PATH("migrate_old")));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old/file1"), "test1"));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old/file2.ext"), "test2"));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old/file3.ext.ext"), "test3"));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file1")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file2.ext")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file3.ext.ext")));
mu_check(storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_new")));
mu_check(!storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_old")));
// Test migration from existing folder to existing folder
mu_assert_int_eq(FSE_OK, storage_common_mkdir(storage, UNIT_TESTS_PATH("migrate_old")));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old/file1"), "test1"));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old/file2.ext"), "test2"));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old/file3.ext.ext"), "test3"));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file1")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file2.ext")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file3.ext.ext")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file11")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file21.ext")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new/file3.ext1.ext")));
mu_check(storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_new")));
mu_check(!storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_old")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new"));
// Test migration from empty folder to existing file
// Expected result: FSE_OK, folder removed, file untouched
mu_assert_int_eq(FSE_OK, storage_common_mkdir(storage, UNIT_TESTS_PATH("migrate_old")));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_new"), "test1"));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new")));
mu_check(!storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_old")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new"));
// Test migration from empty folder to existing folder
// Expected result: FSE_OK, old folder removed, new folder untouched
mu_assert_int_eq(FSE_OK, storage_common_mkdir(storage, UNIT_TESTS_PATH("migrate_old")));
mu_assert_int_eq(FSE_OK, storage_common_mkdir(storage, UNIT_TESTS_PATH("migrate_new")));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
mu_check(storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_new")));
mu_check(!storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_old")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new"));
// Test migration from existing file to non existing, no extension
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old"), "test1"));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new")));
mu_check(!storage_file_exists(storage, UNIT_TESTS_PATH("migrate_old")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new"));
// Test migration from existing file to non existing, with extension
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old.file"), "test1"));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old.file"), UNIT_TESTS_PATH("migrate_new.file")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new.file")));
mu_check(!storage_file_exists(storage, UNIT_TESTS_PATH("migrate_old.file")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old.file"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new.file"));
// Test migration from existing file to existing file, no extension
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old"), "test1"));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_new"), "test2"));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new")));
mu_check(!storage_file_exists(storage, UNIT_TESTS_PATH("migrate_old")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new1")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new1"));
// Test migration from existing file to existing file, with extension
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old.file"), "test1"));
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_new.file"), "test2"));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old.file"), UNIT_TESTS_PATH("migrate_new.file")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new.file")));
mu_check(!storage_file_exists(storage, UNIT_TESTS_PATH("migrate_old.file")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new1.file")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old.file"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new.file"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new1.file"));
// Test migration from existing file to existing folder
mu_check(storage_file_create(storage, UNIT_TESTS_PATH("migrate_old"), "test1"));
mu_assert_int_eq(FSE_OK, storage_common_mkdir(storage, UNIT_TESTS_PATH("migrate_new")));
mu_assert_int_eq(
FSE_OK,
storage_common_migrate(
storage, UNIT_TESTS_PATH("migrate_old"), UNIT_TESTS_PATH("migrate_new")));
mu_check(storage_dir_exists(storage, UNIT_TESTS_PATH("migrate_new")));
mu_check(!storage_file_exists(storage, UNIT_TESTS_PATH("migrate_old")));
mu_check(storage_file_exists(storage, UNIT_TESTS_PATH("migrate_new1")));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_old"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new"));
storage_simply_remove_recursive(storage, UNIT_TESTS_PATH("migrate_new1"));
furi_record_close(RECORD_STORAGE);
}
MU_TEST_SUITE(test_data_path) {
MU_RUN_TEST(test_storage_data_path);
MU_RUN_TEST(test_storage_data_path_apps);
}
MU_TEST_SUITE(test_storage_common) {
MU_RUN_TEST(test_storage_common_migrate);
}
int run_minunit_test_storage() {
MU_RUN_SUITE(storage_file);
MU_RUN_SUITE(storage_dir);
MU_RUN_SUITE(storage_rename);
MU_RUN_SUITE(test_data_path);
MU_RUN_SUITE(test_storage_common);
return MU_EXIT_CODE;
}

View File

@@ -7,6 +7,6 @@ App(
requires=["gui"],
stack_size=1 * 1024,
order=60,
fap_icon="../../plugins/mousejacker/mouse_10px.png",
fap_icon="../../external/mousejacker/mouse_10px.png",
fap_category="Debug",
)

View File

@@ -1,3 +1,4 @@
# Placeholder
App(
appid="example_apps",
name="Example apps bundle",

View File

@@ -0,0 +1,58 @@
# Apps Assets folder Example
This example shows how to use the Apps Assets folder to store data that is not part of the application itself, but is required for its operation, and that data is provided with the application.
## What is the Apps Assets Folder?
The **Apps Assets** folder is a folder where external applications unpack their assets.
The path to the current application folder is related to the `appid` of the app. The `appid` is used to identify the app in the app store and is stored in the `application.fam` file.
The Apps Assets folder is located only on the external storage, the SD card.
For example, if the `appid` of the app is `snake_game`, the path to the Apps Assets folder will be `/ext/apps_assets/snake_game`. But using raw paths is not recommended, because the path to the Apps Assets folder can change in the future. Use the `/assets` alias instead.
## How to get the path to the Apps Assets folder?
You can use `/assets` alias to get the path to the current application data folder. For example, if you want to open a file `database.txt` in the Apps Assets folder, you can use the next path: `/data/database.txt`. But this way is not recommended, because even the `/assets` alias can change in the future.
We recommend to use the `APP_ASSETS_PATH` macro to get the path to the Apps Assets folder. For example, if you want to open a file `database.txt` in the Apps Assets folder, you can use the next path: `APP_ASSETS_PATH("database.txt")`.
## What is the difference between the Apps Assets folder and the Apps Data folder?
The Apps Assets folder is used to store the data <u>provided</u> with the application. For example, if you want to create a game, you can store game levels (contant data) in the Apps Assets folder.
The Apps Data folder is used to store data <u>generated</u> by the application. For example, if you want to create a game, you can save the progress of the game (user-generated data) in the Apps Data folder.
## How to provide the data with the app?
To provide data with an application, you need to create a folder inside your application folder (eg "files") and place the data in it. After that, you need to add `fap_file_assets="files"` to your application.fam file.
For example, if you want to provide game levels with the application, you need to create a "levels" folder inside the "files" folder and put the game levels in it. After that, you need to add `fap_file_assets="files"` to your application.fam file. The final application folder structure will look like this:
```
snake_game
├── application.fam
├── snake_game.c
└── files
└── levels
├── level1.txt
├── level2.txt
└── level3.txt
```
When app is launched, the `files` folder will be unpacked to the Apps Assets folder. The final structure of the Apps Assets folder will look like this:
```
/assets
├── .assets.signature
└── levels
├── level1.txt
├── level2.txt
└── level3.txt
```
## When will the data be unpacked?
The data is unpacked when the application starts, if the application is launched for the first time, or if the data within the application is updated.
When an application is compiled, the contents of the "files" folder are hashed and stored within the application itself. When the application starts, this hash is compared to the hash stored in the `.assets.signature` file. If the hashes differ or the `.assets.signature` file does not exist, the application folder is deleted and the new data is unpacked.

View File

@@ -0,0 +1,10 @@
App(
appid="example_apps_assets",
name="Example: Apps Assets",
apptype=FlipperAppType.EXTERNAL,
entry_point="example_apps_assets_main",
requires=["gui"],
stack_size=4 * 1024,
fap_category="Examples",
fap_file_assets="files",
)

View File

@@ -0,0 +1,48 @@
#include <furi.h>
#include <storage/storage.h>
#include <toolbox/stream/stream.h>
#include <toolbox/stream/file_stream.h>
// Define log tag
#define TAG "example_apps_assets"
static void example_apps_data_print_file_content(Storage* storage, const char* path) {
Stream* stream = file_stream_alloc(storage);
FuriString* line = furi_string_alloc();
FURI_LOG_I(TAG, "----------------------------------------");
FURI_LOG_I(TAG, "File \"%s\" content:", path);
if(file_stream_open(stream, path, FSAM_READ, FSOM_OPEN_EXISTING)) {
while(stream_read_line(stream, line)) {
furi_string_replace_all(line, "\r", "");
furi_string_replace_all(line, "\n", "");
FURI_LOG_I(TAG, "%s", furi_string_get_cstr(line));
}
} else {
FURI_LOG_E(TAG, "Failed to open file");
}
FURI_LOG_I(TAG, "----------------------------------------");
furi_string_free(line);
file_stream_close(stream);
stream_free(stream);
}
// Application entry point
int32_t example_apps_assets_main(void* p) {
// Mark argument as unused
UNUSED(p);
// Open storage
Storage* storage = furi_record_open(RECORD_STORAGE);
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("test_asset.txt"));
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("poems/a jelly-fish.txt"));
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("poems/theme in yellow.txt"));
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("poems/my shadow.txt"));
// Close storage
furi_record_close(RECORD_STORAGE);
return 0;
}

View File

@@ -0,0 +1,24 @@
A Jelly-Fish by Marianne Moore
Visible, invisible,
A fluctuating charm,
An amber-colored amethyst
Inhabits it; your arm
Approaches, and
It opens and
It closes;
You have meant
To catch it,
And it shrivels;
You abandon
Your intent—
It opens, and it
Closes and you
Reach for it—
The blue
Surrounding it
Grows cloudy, and
It floats away
From you.
source: "https://poets.org/anthology/poems-your-poetry-project-public-domain"

View File

@@ -0,0 +1,23 @@
My Shadow by Robert Louis Stevenson
I have a little shadow that goes in and out with me,
And what can be the use of him is more than I can see.
He is very, very like me from the heels up to the head;
And I see him jump before me, when I jump into my bed.
The funniest thing about him is the way he likes to grow—
Not at all like proper children, which is always very slow;
For he sometimes shoots up taller like an India-rubber ball,
And he sometimes gets so little that theres none of him at all.
He hasnt got a notion of how children ought to play,
And can only make a fool of me in every sort of way.
He stays so close beside me, hes a coward you can see;
Id think shame to stick to nursie as that shadow sticks to me!
One morning, very early, before the sun was up,
I rose and found the shining dew on every buttercup;
But my lazy little shadow, like an arrant sleepy-head,
Had stayed at home behind me and was fast asleep in bed.
source: "https://poets.org/anthology/poems-your-poetry-project-public-domain"

View File

@@ -0,0 +1,19 @@
Theme in Yellow by Carl Sandburg
I spot the hills
With yellow balls in autumn.
I light the prairie cornfields
Orange and tawny gold clusters
And I am called pumpkins.
On the last of October
When dusk is fallen
Children join hands
And circle round me
Singing ghost songs
And love to the harvest moon;
I am a jack-o'-lantern
With terrible teeth
And the children know
I am fooling.
source: "https://poets.org/anthology/poems-your-poetry-project-public-domain"

View File

@@ -0,0 +1 @@
## This is test file content

View File

@@ -0,0 +1,24 @@
# Apps Data folder Example
This example demonstrates how to utilize the Apps Data folder to store data that is not part of the app itself, such as user data, configuration files, and so forth.
## What is the Apps Data Folder?
The **Apps Data** folder is a folder used to store data for external apps that are not part of the main firmware.
The path to the current application folder is related to the `appid` of the app. The `appid` is used to identify the app in the app store and is stored in the `application.fam` file.
The Apps Data folder is located only on the external storage, the SD card.
For example, if the `appid` of the app is `snake_game`, the path to the Apps Data folder will be `/ext/apps_data/snake_game`. But using raw paths is not recommended, because the path to the Apps Data folder can change in the future. Use the `/data` alias instead.
## How to get the path to the Apps Data folder?
You can use `/data` alias to get the path to the current application data folder. For example, if you want to open a file `config.txt` in the Apps Data folder, you can use the next path: `/data/config.txt`. But this way is not recommended, because even the `/data` alias can change in the future.
We recommend to use the `APP_DATA_PATH` macro to get the path to the Apps Data folder. For example, if you want to open a file `config.txt` in the Apps Data folder, you can use the next path: `APP_DATA_PATH("config.txt")`.
## What is the difference between the Apps Assets folder and the Apps Data folder?
The Apps Assets folder is used to store the data <u>provided</u> with the application. For example, if you want to create a game, you can store game levels (contant data) in the Apps Assets folder.
The Apps Data folder is used to store data <u>generated</u> by the application. For example, if you want to create a game, you can save the progress of the game (user-generated data) in the Apps Data folder.

View File

@@ -0,0 +1,9 @@
App(
appid="example_apps_data",
name="Example: Apps Data",
apptype=FlipperAppType.EXTERNAL,
entry_point="example_apps_data_main",
requires=["gui"],
stack_size=1 * 1024,
fap_category="Examples",
)

View File

@@ -0,0 +1,40 @@
#include <furi.h>
#include <storage/storage.h>
// Define log tag
#define TAG "example_apps_data"
// Application entry point
int32_t example_apps_data_main(void* p) {
// Mark argument as unused
UNUSED(p);
// Open storage
Storage* storage = furi_record_open(RECORD_STORAGE);
// Allocate file
File* file = storage_file_alloc(storage);
// Get the path to the current application data folder
// That is: /ext/apps_data/<app_name>
// And it will create folders in the path if they don't exist
// In this example it will create /ext/apps_data/example_apps_data
// And file will be /ext/apps_data/example_apps_data/test.txt
// Open file, write data and close it
if(!storage_file_open(file, APP_DATA_PATH("test.txt"), FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
FURI_LOG_E(TAG, "Failed to open file");
}
if(!storage_file_write(file, "Hello World!", strlen("Hello World!"))) {
FURI_LOG_E(TAG, "Failed to write to file");
}
storage_file_close(file);
// Deallocate file
storage_file_free(file);
// Close storage
furi_record_close(RECORD_STORAGE);
return 0;
}

View File

@@ -0,0 +1,31 @@
App(
appid="example_plugins",
name="Example: App w/plugin",
apptype=FlipperAppType.EXTERNAL,
entry_point="example_plugins_app",
stack_size=2 * 1024,
fap_category="Examples",
)
App(
appid="example_plugins_multi",
name="Example: App w/plugins",
apptype=FlipperAppType.EXTERNAL,
entry_point="example_plugins_multi_app",
stack_size=2 * 1024,
fap_category="Examples",
)
App(
appid="example_plugin1",
apptype=FlipperAppType.PLUGIN,
entry_point="example_plugin1_ep",
requires=["example_plugins", "example_plugins_multi"],
)
App(
appid="example_plugin2",
apptype=FlipperAppType.PLUGIN,
entry_point="example_plugin2_ep",
requires=["example_plugins_multi"],
)

View File

@@ -0,0 +1,70 @@
/*
* An example of a plugin host application.
* Loads a single plugin and calls its methods.
*/
#include "plugin_interface.h"
#include <furi.h>
#include <flipper_application/flipper_application.h>
#include <loader/firmware_api/firmware_api.h>
#include <storage/storage.h>
#define TAG "example_plugins"
int32_t example_plugins_app(void* p) {
UNUSED(p);
FURI_LOG_I(TAG, "Starting");
Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperApplication* app = flipper_application_alloc(storage, firmware_api_interface);
do {
FlipperApplicationPreloadStatus preload_res =
flipper_application_preload(app, APP_DATA_PATH("plugins/example_plugin1.fal"));
if(preload_res != FlipperApplicationPreloadStatusSuccess) {
FURI_LOG_E(TAG, "Failed to preload plugin");
break;
}
if(!flipper_application_is_plugin(app)) {
FURI_LOG_E(TAG, "Plugin file is not a library");
break;
}
FlipperApplicationLoadStatus load_status = flipper_application_map_to_memory(app);
if(load_status != FlipperApplicationLoadStatusSuccess) {
FURI_LOG_E(TAG, "Failed to load plugin file");
break;
}
const FlipperAppPluginDescriptor* app_descriptor =
flipper_application_plugin_get_descriptor(app);
FURI_LOG_I(
TAG,
"Loaded plugin for appid '%s', API %lu",
app_descriptor->appid,
app_descriptor->ep_api_version);
furi_check(app_descriptor->ep_api_version == PLUGIN_API_VERSION);
furi_check(strcmp(app_descriptor->appid, PLUGIN_APP_ID) == 0);
const ExamplePlugin* plugin = app_descriptor->entry_point;
FURI_LOG_I(TAG, "Plugin name: %s", plugin->name);
FURI_LOG_I(TAG, "Plugin method1: %d", plugin->method1());
FURI_LOG_I(TAG, "Plugin method2(7,8): %d", plugin->method2(7, 8));
FURI_LOG_I(TAG, "Plugin method2(1337,228): %d", plugin->method2(1337, 228));
} while(false);
flipper_application_free(app);
furi_record_close(RECORD_STORAGE);
FURI_LOG_I(TAG, "Goodbye!");
return 0;
}

View File

@@ -0,0 +1,43 @@
/*
* An example of an advanced plugin host application.
* It uses PluginManager to load all plugins from a directory
*/
#include "plugin_interface.h"
#include <flipper_application/flipper_application.h>
#include <flipper_application/plugins/plugin_manager.h>
#include <loader/firmware_api/firmware_api.h>
#include <furi.h>
#define TAG "example_plugins"
int32_t example_plugins_multi_app(void* p) {
UNUSED(p);
FURI_LOG_I(TAG, "Starting");
PluginManager* manager =
plugin_manager_alloc(PLUGIN_APP_ID, PLUGIN_API_VERSION, firmware_api_interface);
if(plugin_manager_load_all(manager, APP_DATA_PATH("plugins")) != PluginManagerErrorNone) {
FURI_LOG_E(TAG, "Failed to load all libs");
return 0;
}
uint32_t plugin_count = plugin_manager_get_count(manager);
FURI_LOG_I(TAG, "Loaded %lu plugin(s)", plugin_count);
for(uint32_t i = 0; i < plugin_count; i++) {
const ExamplePlugin* plugin = plugin_manager_get_ep(manager, i);
FURI_LOG_I(TAG, "plugin name: %s", plugin->name);
FURI_LOG_I(TAG, "plugin method1: %d", plugin->method1());
FURI_LOG_I(TAG, "plugin method2(7,8): %d", plugin->method2(7, 8));
}
plugin_manager_free(manager);
FURI_LOG_I(TAG, "Goodbye!");
return 0;
}

View File

@@ -0,0 +1,32 @@
/* A simple plugin implementing example_plugins application's plugin interface */
#include "plugin_interface.h"
#include <flipper_application/flipper_application.h>
static int example_plugin1_method1() {
return 42;
}
static int example_plugin1_method2(int arg1, int arg2) {
return arg1 + arg2;
}
/* Actual implementation of app<>plugin interface */
static const ExamplePlugin example_plugin1 = {
.name = "Demo App Plugin 1",
.method1 = &example_plugin1_method1,
.method2 = &example_plugin1_method2,
};
/* Plugin descriptor to comply with basic plugin specification */
static const FlipperAppPluginDescriptor example_plugin1_descriptor = {
.appid = PLUGIN_APP_ID,
.ep_api_version = PLUGIN_API_VERSION,
.entry_point = &example_plugin1,
};
/* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* example_plugin1_ep() {
return &example_plugin1_descriptor;
}

View File

@@ -0,0 +1,32 @@
/* Second plugin implementing example_plugins application's plugin interface */
#include "plugin_interface.h"
#include <flipper_application/flipper_application.h>
static int example_plugin2_method1() {
return 1337;
}
static int example_plugin2_method2(int arg1, int arg2) {
return arg1 - arg2;
}
/* Actual implementation of app<>plugin interface */
static const ExamplePlugin example_plugin2 = {
.name = "Demo App Plugin 2",
.method1 = &example_plugin2_method1,
.method2 = &example_plugin2_method2,
};
/* Plugin descriptor to comply with basic plugin specification */
static const FlipperAppPluginDescriptor example_plugin2_descriptor = {
.appid = PLUGIN_APP_ID,
.ep_api_version = PLUGIN_API_VERSION,
.entry_point = &example_plugin2,
};
/* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* example_plugin2_ep() {
return &example_plugin2_descriptor;
}

View File

@@ -0,0 +1,12 @@
#pragma once
/* Common interface between a plugin and host applicaion */
#define PLUGIN_APP_ID "example_plugins"
#define PLUGIN_API_VERSION 1
typedef struct {
const char* name;
int (*method1)();
int (*method2)(int, int);
} ExamplePlugin;

View File

@@ -0,0 +1,25 @@
#include "app_api.h"
/* Actual implementation of app's API and its private state */
static uint32_t accumulator = 0;
void app_api_accumulator_set(uint32_t value) {
accumulator = value;
}
uint32_t app_api_accumulator_get() {
return accumulator;
}
void app_api_accumulator_add(uint32_t value) {
accumulator += value;
}
void app_api_accumulator_sub(uint32_t value) {
accumulator -= value;
}
void app_api_accumulator_mul(uint32_t value) {
accumulator *= value;
}

View File

@@ -0,0 +1,25 @@
#pragma once
/*
* This file contains an API that is internally implemented by the application
* It is also exposed to plugins to allow them to use the application's API.
*/
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
void app_api_accumulator_set(uint32_t value);
uint32_t app_api_accumulator_get();
void app_api_accumulator_add(uint32_t value);
void app_api_accumulator_sub(uint32_t value);
void app_api_accumulator_mul(uint32_t value);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,9 @@
#pragma once
#include <flipper_application/api_hashtable/api_hashtable.h>
/*
* Resolver interface with private application's symbols.
* Implementation is contained in app_api_table.c
*/
extern const ElfApiInterface* const application_api_interface;

View File

@@ -0,0 +1,27 @@
#include <flipper_application/api_hashtable/api_hashtable.h>
#include <flipper_application/api_hashtable/compilesort.hpp>
/*
* This file contains an implementation of a symbol table
* with private app's symbols. It is used by composite API resolver
* to load plugins that use internal application's APIs.
*/
#include "app_api_table_i.h"
static_assert(!has_hash_collisions(app_api_table), "Detected API method hash collision!");
constexpr HashtableApiInterface applicaton_hashtable_api_interface{
{
.api_version_major = 0,
.api_version_minor = 0,
/* generic resolver using pre-sorted array */
.resolver_callback = &elf_resolve_from_hashtable,
},
/* pointers to application's API table boundaries */
.table_cbegin = app_api_table.cbegin(),
.table_cend = app_api_table.cend(),
};
/* Casting to generic resolver to use in Composite API resolver */
extern "C" const ElfApiInterface* const application_api_interface =
&applicaton_hashtable_api_interface;

View File

@@ -0,0 +1,13 @@
#include "app_api.h"
/*
* A list of app's private functions and objects to expose for plugins.
* It is used to generate a table of symbols for import resolver to use.
* TBD: automatically generate this table from app's header files
*/
static constexpr auto app_api_table = sort(create_array_t<sym_entry>(
API_METHOD(app_api_accumulator_set, void, (uint32_t)),
API_METHOD(app_api_accumulator_get, uint32_t, ()),
API_METHOD(app_api_accumulator_add, void, (uint32_t)),
API_METHOD(app_api_accumulator_sub, void, (uint32_t)),
API_METHOD(app_api_accumulator_mul, void, (uint32_t))));

View File

@@ -0,0 +1,24 @@
App(
appid="example_advanced_plugins",
name="Example: advanced plugins",
apptype=FlipperAppType.EXTERNAL,
entry_point="example_advanced_plugins_app",
stack_size=2 * 1024,
fap_category="Examples",
)
App(
appid="advanced_plugin1",
apptype=FlipperAppType.PLUGIN,
entry_point="advanced_plugin1_ep",
requires=["example_advanced_plugins"],
sources=["plugin1.c"],
)
App(
appid="advanced_plugin2",
apptype=FlipperAppType.PLUGIN,
entry_point="advanced_plugin2_ep",
requires=["example_advanced_plugins"],
sources=["plugin2.c"],
)

View File

@@ -0,0 +1,48 @@
#include "app_api.h"
#include "plugin_interface.h"
#include "app_api_interface.h"
#include <flipper_application/flipper_application.h>
#include <flipper_application/plugins/plugin_manager.h>
#include <flipper_application/plugins/composite_resolver.h>
#include <loader/firmware_api/firmware_api.h>
#define TAG "example_advanced_plugins"
int32_t example_advanced_plugins_app(void* p) {
UNUSED(p);
FURI_LOG_I(TAG, "Starting");
CompositeApiResolver* resolver = composite_api_resolver_alloc();
composite_api_resolver_add(resolver, firmware_api_interface);
composite_api_resolver_add(resolver, application_api_interface);
PluginManager* manager = plugin_manager_alloc(
PLUGIN_APP_ID, PLUGIN_API_VERSION, composite_api_resolver_get(resolver));
do {
if(plugin_manager_load_all(manager, APP_DATA_PATH("plugins")) != PluginManagerErrorNone) {
FURI_LOG_E(TAG, "Failed to load all libs");
break;
}
uint32_t plugin_count = plugin_manager_get_count(manager);
FURI_LOG_I(TAG, "Loaded libs: %lu", plugin_count);
for(uint32_t i = 0; i < plugin_count; i++) {
const AdvancedPlugin* plugin = plugin_manager_get_ep(manager, i);
FURI_LOG_I(TAG, "plugin name: %s. Calling methods", plugin->name);
plugin->method1(228);
plugin->method2();
FURI_LOG_I(TAG, "Accumulator: %lu", app_api_accumulator_get());
}
} while(0);
plugin_manager_free(manager);
composite_api_resolver_free(resolver);
FURI_LOG_I(TAG, "Goodbye!");
return 0;
}

View File

@@ -0,0 +1,40 @@
/*
* This plugin uses both firmware's API interface and private application headers.
* It can be loaded by a plugin manager that uses CompoundApiInterface,
* which combines both interfaces.
*/
#include "app_api.h"
#include "plugin_interface.h"
#include <flipper_application/flipper_application.h>
#include <furi.h>
static void advanced_plugin1_method1(int arg1) {
/* This function is implemented inside host application */
app_api_accumulator_add(arg1);
}
static void advanced_plugin1_method2() {
/* Accumulator value is stored inside host application */
FURI_LOG_I("TEST", "Plugin 1, accumulator: %lu", app_api_accumulator_get());
}
/* Actual implementation of app<>plugin interface */
static const AdvancedPlugin advanced_plugin1 = {
.name = "Advanced Plugin 1",
.method1 = &advanced_plugin1_method1,
.method2 = &advanced_plugin1_method2,
};
/* Plugin descriptor to comply with basic plugin specification */
static const FlipperAppPluginDescriptor advanced_plugin1_descriptor = {
.appid = PLUGIN_APP_ID,
.ep_api_version = PLUGIN_API_VERSION,
.entry_point = &advanced_plugin1,
};
/* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* advanced_plugin1_ep() {
return &advanced_plugin1_descriptor;
}

View File

@@ -0,0 +1,40 @@
/*
* This plugin uses both firmware's API interface and private application headers.
* It can be loaded by a plugin manager that uses CompoundApiInterface,
* which combines both interfaces.
*/
#include "app_api.h"
#include "plugin_interface.h"
#include <flipper_application/flipper_application.h>
#include <furi.h>
static void advanced_plugin2_method1(int arg1) {
/* This function is implemented inside host application */
app_api_accumulator_mul(arg1);
}
static void advanced_plugin2_method2() {
/* Accumulator value is stored inside host application */
FURI_LOG_I("TEST", "Plugin 2, accumulator: %lu", app_api_accumulator_get());
}
/* Actual implementation of app<>plugin interface */
static const AdvancedPlugin advanced_plugin2 = {
.name = "Advanced Plugin 2",
.method1 = &advanced_plugin2_method1,
.method2 = &advanced_plugin2_method2,
};
/* Plugin descriptor to comply with basic plugin specification */
static const FlipperAppPluginDescriptor advanced_plugin2_descriptor = {
.appid = PLUGIN_APP_ID,
.ep_api_version = PLUGIN_API_VERSION,
.entry_point = &advanced_plugin2,
};
/* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* advanced_plugin2_ep() {
return &advanced_plugin2_descriptor;
}

View File

@@ -0,0 +1,12 @@
#pragma once
/* Common interface between a plugin and host applicaion */
#define PLUGIN_APP_ID "example_plugins_advanced"
#define PLUGIN_API_VERSION 1
typedef struct {
const char* name;
void (*method1)(int);
void (*method2)();
} AdvancedPlugin;

View File

@@ -33,10 +33,10 @@ It is possible to use other GPIO pin as a 1-Wire data pin. In order to change it
- gpio_ext_pa4
- gpio_ext_pa6
- gpio_ext_pa7
- ibutton_gpio
- gpio_ibutton
*/
#define THERMO_GPIO_PIN (ibutton_gpio)
#define THERMO_GPIO_PIN (gpio_ibutton)
```
Do not forget about the external pull-up resistor as these pins do not have one built-in.

View File

@@ -19,9 +19,12 @@
#include <one_wire/maxim_crc.h>
#include <one_wire/one_wire_host.h>
#include <furi_hal_power.h>
#define UPDATE_PERIOD_MS 1000UL
#define TEXT_STORE_SIZE 64U
#define DS18B20_CMD_SKIP_ROM 0xccU
#define DS18B20_CMD_CONVERT 0x44U
#define DS18B20_CMD_READ_SCRATCHPAD 0xbeU
@@ -40,10 +43,10 @@
- gpio_ext_pa4
- gpio_ext_pa6
- gpio_ext_pa7
- ibutton_gpio
- gpio_ibutton
*/
#define THERMO_GPIO_PIN (ibutton_gpio)
#define THERMO_GPIO_PIN (gpio_ibutton)
/* Flags which the reader thread responds to */
typedef enum {
@@ -92,7 +95,7 @@ static void example_thermo_request_temperature(ExampleThermoContext* context) {
/* 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);
onewire_host_write(onewire, DS18B20_CMD_SKIP_ROM);
/* 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);
@@ -133,7 +136,7 @@ static void example_thermo_read_temperature(ExampleThermoContext* context) {
/* 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);
onewire_host_write(onewire, DS18B20_CMD_SKIP_ROM);
/* After the ROM operation, a device-specific command is issued.
This time, it will be the "Read Scratchpad" command which will
@@ -267,6 +270,9 @@ static void example_thermo_input_callback(InputEvent* event, void* ctx) {
/* Starts the reader thread and handles the input */
static void example_thermo_run(ExampleThermoContext* context) {
/* Enable power on external pins */
furi_hal_power_enable_otg();
/* Configure the hardware in host mode */
onewire_host_start(context->onewire);
@@ -299,6 +305,9 @@ static void example_thermo_run(ExampleThermoContext* context) {
/* Reset the hardware */
onewire_host_stop(context->onewire);
/* Disable power on external pins */
furi_hal_power_disable_otg();
}
/******************** Initialisation & startup *****************************/

6
applications/external/application.fam vendored Normal file
View File

@@ -0,0 +1,6 @@
# Placeholder
App(
appid="external_apps",
name="External apps bundle",
apptype=FlipperAppType.METAPACKAGE,
)

View File

@@ -3,7 +3,6 @@ App(
name="Arkanoid",
apptype=FlipperAppType.EXTERNAL,
entry_point="arkanoid_game_app",
cdefines=["APP_ARKANOID_GAME"],
requires=["gui"],
stack_size=1 * 1024,
order=30,

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -38,6 +38,7 @@ typedef struct {
} BallState;
typedef struct {
FuriMutex* mutex;
BallState ball_state;
BrickState brick_state;
NotificationApp* notify;
@@ -310,10 +311,9 @@ static void arkanoid_state_init(ArkanoidState* arkanoid_state) {
}
static void arkanoid_draw_callback(Canvas* const canvas, void* ctx) {
ArkanoidState* arkanoid_state = acquire_mutex((ValueMutex*)ctx, 25);
if(arkanoid_state == NULL) {
return;
}
furi_assert(ctx);
ArkanoidState* arkanoid_state = ctx;
furi_mutex_acquire(arkanoid_state->mutex, FuriWaitForever);
//Initial level draw
if(!arkanoid_state->initialDraw) {
@@ -352,7 +352,7 @@ static void arkanoid_draw_callback(Canvas* const canvas, void* ctx) {
arkanoid_state->score = 0;
}
release_mutex((ValueMutex*)ctx, arkanoid_state);
furi_mutex_release(arkanoid_state->mutex);
}
static void arkanoid_input_callback(InputEvent* input_event, FuriMessageQueue* event_queue) {
@@ -378,8 +378,8 @@ int32_t arkanoid_game_app(void* p) {
ArkanoidState* arkanoid_state = malloc(sizeof(ArkanoidState));
arkanoid_state_init(arkanoid_state);
ValueMutex state_mutex;
if(!init_mutex(&state_mutex, arkanoid_state, sizeof(ArkanoidState))) {
arkanoid_state->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
if(!arkanoid_state->mutex) {
FURI_LOG_E(TAG, "Cannot create mutex\r\n");
return_code = 255;
goto free_and_exit;
@@ -387,7 +387,7 @@ int32_t arkanoid_game_app(void* p) {
// Set system callbacks
ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, arkanoid_draw_callback, &state_mutex);
view_port_draw_callback_set(view_port, arkanoid_draw_callback, arkanoid_state);
view_port_input_callback_set(view_port, arkanoid_input_callback, event_queue);
FuriTimer* timer =
@@ -404,7 +404,7 @@ int32_t arkanoid_game_app(void* p) {
GameEvent event;
for(bool processing = true; processing;) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
ArkanoidState* arkanoid_state = (ArkanoidState*)acquire_mutex_block(&state_mutex);
furi_mutex_acquire(arkanoid_state->mutex, FuriWaitForever);
if(event_status == FuriStatusOk) {
// Key events
@@ -461,7 +461,7 @@ int32_t arkanoid_game_app(void* p) {
}
view_port_update(view_port);
release_mutex(&state_mutex, arkanoid_state);
furi_mutex_release(arkanoid_state->mutex);
}
furi_timer_free(timer);
view_port_enabled_set(view_port, false);
@@ -469,7 +469,7 @@ int32_t arkanoid_game_app(void* p) {
furi_record_close(RECORD_GUI);
furi_record_close(RECORD_NOTIFICATION);
view_port_free(view_port);
delete_mutex(&state_mutex);
furi_mutex_free(arkanoid_state->mutex);
free_and_exit:
free(arkanoid_state);

View File

@@ -0,0 +1,17 @@
App(
appid="avr_isp",
name="AVR Flasher",
apptype=FlipperAppType.EXTERNAL,
entry_point="avr_isp_app",
requires=["gui"],
stack_size=4 * 1024,
order=20,
fap_icon="avr_app_icon_10x10.png",
fap_category="GPIO",
fap_icon_assets="images",
fap_private_libs=[
Lib(
name="driver",
),
],
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,179 @@
#include "avr_isp_app_i.h"
static bool avr_isp_app_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
AvrIspApp* app = context;
return scene_manager_handle_custom_event(app->scene_manager, event);
}
static bool avr_isp_app_back_event_callback(void* context) {
furi_assert(context);
AvrIspApp* app = context;
return scene_manager_handle_back_event(app->scene_manager);
}
static void avr_isp_app_tick_event_callback(void* context) {
furi_assert(context);
AvrIspApp* app = context;
scene_manager_handle_tick_event(app->scene_manager);
}
AvrIspApp* avr_isp_app_alloc() {
AvrIspApp* app = malloc(sizeof(AvrIspApp));
app->file_path = furi_string_alloc();
furi_string_set(app->file_path, STORAGE_APP_DATA_PATH_PREFIX);
app->error = AvrIspErrorNoError;
// GUI
app->gui = furi_record_open(RECORD_GUI);
// View Dispatcher
app->view_dispatcher = view_dispatcher_alloc();
app->scene_manager = scene_manager_alloc(&avr_isp_scene_handlers, app);
view_dispatcher_enable_queue(app->view_dispatcher);
view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
view_dispatcher_set_custom_event_callback(
app->view_dispatcher, avr_isp_app_custom_event_callback);
view_dispatcher_set_navigation_event_callback(
app->view_dispatcher, avr_isp_app_back_event_callback);
view_dispatcher_set_tick_event_callback(
app->view_dispatcher, avr_isp_app_tick_event_callback, 100);
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
// Open Notification record
app->notifications = furi_record_open(RECORD_NOTIFICATION);
// SubMenu
app->submenu = submenu_alloc();
view_dispatcher_add_view(
app->view_dispatcher, AvrIspViewSubmenu, submenu_get_view(app->submenu));
// Widget
app->widget = widget_alloc();
view_dispatcher_add_view(app->view_dispatcher, AvrIspViewWidget, widget_get_view(app->widget));
// Text Input
app->text_input = text_input_alloc();
view_dispatcher_add_view(
app->view_dispatcher, AvrIspViewTextInput, text_input_get_view(app->text_input));
// Popup
app->popup = popup_alloc();
view_dispatcher_add_view(app->view_dispatcher, AvrIspViewPopup, popup_get_view(app->popup));
//Dialog
app->dialogs = furi_record_open(RECORD_DIALOGS);
// Programmer view
app->avr_isp_programmer_view = avr_isp_programmer_view_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
AvrIspViewProgrammer,
avr_isp_programmer_view_get_view(app->avr_isp_programmer_view));
// Reader view
app->avr_isp_reader_view = avr_isp_reader_view_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
AvrIspViewReader,
avr_isp_reader_view_get_view(app->avr_isp_reader_view));
// Writer view
app->avr_isp_writer_view = avr_isp_writer_view_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
AvrIspViewWriter,
avr_isp_writer_view_get_view(app->avr_isp_writer_view));
// Chip detect view
app->avr_isp_chip_detect_view = avr_isp_chip_detect_view_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
AvrIspViewChipDetect,
avr_isp_chip_detect_view_get_view(app->avr_isp_chip_detect_view));
// Enable 5v power, multiple attempts to avoid issues with power chip protection false triggering
uint8_t attempts = 0;
while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
furi_hal_power_enable_otg();
furi_delay_ms(10);
}
scene_manager_next_scene(app->scene_manager, AvrIspSceneStart);
return app;
} //-V773
void avr_isp_app_free(AvrIspApp* app) {
furi_assert(app);
// Disable 5v power
if(furi_hal_power_is_otg_enabled()) {
furi_hal_power_disable_otg();
}
// Submenu
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewSubmenu);
submenu_free(app->submenu);
// Widget
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewWidget);
widget_free(app->widget);
// TextInput
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewTextInput);
text_input_free(app->text_input);
// Popup
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewPopup);
popup_free(app->popup);
//Dialog
furi_record_close(RECORD_DIALOGS);
// Programmer view
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewProgrammer);
avr_isp_programmer_view_free(app->avr_isp_programmer_view);
// Reader view
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewReader);
avr_isp_reader_view_free(app->avr_isp_reader_view);
// Writer view
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewWriter);
avr_isp_writer_view_free(app->avr_isp_writer_view);
// Chip detect view
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewChipDetect);
avr_isp_chip_detect_view_free(app->avr_isp_chip_detect_view);
// View dispatcher
view_dispatcher_free(app->view_dispatcher);
scene_manager_free(app->scene_manager);
// Notifications
furi_record_close(RECORD_NOTIFICATION);
app->notifications = NULL;
// Close records
furi_record_close(RECORD_GUI);
// Path strings
furi_string_free(app->file_path);
free(app);
}
int32_t avr_isp_app(void* p) {
UNUSED(p);
AvrIspApp* avr_isp_app = avr_isp_app_alloc();
view_dispatcher_run(avr_isp_app->view_dispatcher);
avr_isp_app_free(avr_isp_app);
return 0;
}

View File

@@ -0,0 +1,31 @@
#include "avr_isp_app_i.h"
#include <lib/toolbox/path.h>
#include <flipper_format/flipper_format_i.h>
#define TAG "AvrIsp"
bool avr_isp_load_from_file(AvrIspApp* app) {
furi_assert(app);
FuriString* file_path = furi_string_alloc();
FuriString* file_name = furi_string_alloc();
DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_options(
&browser_options, AVR_ISP_APP_EXTENSION, &I_avr_app_icon_10x10);
browser_options.base_path = STORAGE_APP_DATA_PATH_PREFIX;
// Input events and views are managed by file_select
bool res = dialog_file_browser_show(app->dialogs, file_path, app->file_path, &browser_options);
if(res) {
path_extract_dirname(furi_string_get_cstr(file_path), app->file_path);
path_extract_filename(file_path, file_name, true);
strncpy(app->file_name_tmp, furi_string_get_cstr(file_name), AVR_ISP_MAX_LEN_NAME);
}
furi_string_free(file_name);
furi_string_free(file_path);
return res;
}

View File

@@ -0,0 +1,44 @@
#pragma once
#include "helpers/avr_isp_types.h"
#include <avr_isp_icons.h>
#include "scenes/avr_isp_scene.h"
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/scene_manager.h>
#include <gui/modules/submenu.h>
#include <gui/modules/widget.h>
#include <notification/notification_messages.h>
#include <gui/modules/text_input.h>
#include <dialogs/dialogs.h>
#include <storage/storage.h>
#include <gui/modules/popup.h>
#include "views/avr_isp_view_programmer.h"
#include "views/avr_isp_view_reader.h"
#include "views/avr_isp_view_writer.h"
#include "views/avr_isp_view_chip_detect.h"
#define AVR_ISP_MAX_LEN_NAME 64
typedef struct {
Gui* gui;
ViewDispatcher* view_dispatcher;
SceneManager* scene_manager;
NotificationApp* notifications;
DialogsApp* dialogs;
Popup* popup;
Submenu* submenu;
Widget* widget;
TextInput* text_input;
FuriString* file_path;
char file_name_tmp[AVR_ISP_MAX_LEN_NAME];
AvrIspProgrammerView* avr_isp_programmer_view;
AvrIspReaderView* avr_isp_reader_view;
AvrIspWriterView* avr_isp_writer_view;
AvrIspChipDetectView* avr_isp_chip_detect_view;
AvrIspError error;
} AvrIspApp;
bool avr_isp_load_from_file(AvrIspApp* app);

View File

@@ -0,0 +1,496 @@
#include "avr_isp.h"
#include "../lib/driver/avr_isp_prog_cmd.h"
#include "../lib/driver/avr_isp_spi_sw.h"
#include <furi.h>
#define AVR_ISP_PROG_TX_RX_BUF_SIZE 320
#define TAG "AvrIsp"
struct AvrIsp {
AvrIspSpiSw* spi;
bool pmode;
AvrIspCallback callback;
void* context;
};
AvrIsp* avr_isp_alloc(void) {
AvrIsp* instance = malloc(sizeof(AvrIsp));
return instance;
}
void avr_isp_free(AvrIsp* instance) {
furi_assert(instance);
if(instance->spi) avr_isp_end_pmode(instance);
free(instance);
}
void avr_isp_set_tx_callback(AvrIsp* instance, AvrIspCallback callback, void* context) {
furi_assert(instance);
furi_assert(context);
instance->callback = callback;
instance->context = context;
}
uint8_t avr_isp_spi_transaction(
AvrIsp* instance,
uint8_t cmd,
uint8_t addr_hi,
uint8_t addr_lo,
uint8_t data) {
furi_assert(instance);
avr_isp_spi_sw_txrx(instance->spi, cmd);
avr_isp_spi_sw_txrx(instance->spi, addr_hi);
avr_isp_spi_sw_txrx(instance->spi, addr_lo);
return avr_isp_spi_sw_txrx(instance->spi, data);
}
static bool avr_isp_set_pmode(AvrIsp* instance, uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
furi_assert(instance);
uint8_t res = 0;
avr_isp_spi_sw_txrx(instance->spi, a);
avr_isp_spi_sw_txrx(instance->spi, b);
res = avr_isp_spi_sw_txrx(instance->spi, c);
avr_isp_spi_sw_txrx(instance->spi, d);
return res == 0x53;
}
void avr_isp_end_pmode(AvrIsp* instance) {
furi_assert(instance);
if(instance->pmode) {
avr_isp_spi_sw_res_set(instance->spi, true);
// We're about to take the target out of reset
// so configure SPI pins as input
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
instance->spi = NULL;
}
instance->pmode = false;
}
static bool avr_isp_start_pmode(AvrIsp* instance, AvrIspSpiSwSpeed spi_speed) {
furi_assert(instance);
// Reset target before driving PIN_SCK or PIN_MOSI
// SPI.begin() will configure SS as output,
// so SPI master mode is selected.
// We have defined RESET as pin 10,
// which for many arduino's is not the SS pin.
// So we have to configure RESET as output here,
// (reset_target() first sets the correct level)
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
instance->spi = avr_isp_spi_sw_init(spi_speed);
avr_isp_spi_sw_res_set(instance->spi, false);
// See avr datasheets, chapter "SERIAL_PRG Programming Algorithm":
// Pulse RESET after PIN_SCK is low:
avr_isp_spi_sw_sck_set(instance->spi, false);
// discharge PIN_SCK, value arbitrally chosen
furi_delay_ms(20);
avr_isp_spi_sw_res_set(instance->spi, true);
// Pulse must be minimum 2 target CPU speed cycles
// so 100 usec is ok for CPU speeds above 20KHz
furi_delay_ms(1);
avr_isp_spi_sw_res_set(instance->spi, false);
// Send the enable programming command:
// datasheet: must be > 20 msec
furi_delay_ms(50);
if(avr_isp_set_pmode(instance, AVR_ISP_SET_PMODE)) {
instance->pmode = true;
return true;
}
return false;
}
bool avr_isp_auto_set_spi_speed_start_pmode(AvrIsp* instance) {
furi_assert(instance);
AvrIspSpiSwSpeed spi_speed[] = {
AvrIspSpiSwSpeed1Mhz,
AvrIspSpiSwSpeed400Khz,
AvrIspSpiSwSpeed250Khz,
AvrIspSpiSwSpeed125Khz,
AvrIspSpiSwSpeed60Khz,
AvrIspSpiSwSpeed40Khz,
AvrIspSpiSwSpeed20Khz,
AvrIspSpiSwSpeed10Khz,
AvrIspSpiSwSpeed5Khz,
AvrIspSpiSwSpeed1Khz,
};
for(uint8_t i = 0; i < COUNT_OF(spi_speed); i++) {
if(avr_isp_start_pmode(instance, spi_speed[i])) {
AvrIspSignature sig = avr_isp_read_signature(instance);
AvrIspSignature sig_examination = avr_isp_read_signature(instance); //-V656
uint8_t y = 0;
while(y < 8) {
if(memcmp((uint8_t*)&sig, (uint8_t*)&sig_examination, sizeof(AvrIspSignature)) !=
0)
break;
sig_examination = avr_isp_read_signature(instance);
y++;
}
if(y == 8) {
if(spi_speed[i] > AvrIspSpiSwSpeed1Mhz) {
if(i < (COUNT_OF(spi_speed) - 1)) {
avr_isp_end_pmode(instance);
i++;
return avr_isp_start_pmode(instance, spi_speed[i]);
}
}
return true;
}
}
}
if(instance->spi) {
avr_isp_spi_sw_free(instance->spi);
instance->spi = NULL;
}
return false;
}
static void avr_isp_commit(AvrIsp* instance, uint16_t addr, uint8_t data) {
furi_assert(instance);
avr_isp_spi_transaction(instance, AVR_ISP_COMMIT(addr));
/* polling flash */
if(data == 0xFF) {
furi_delay_ms(5);
} else {
/* polling flash */
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 30) {
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_FLASH_HI(addr)) != 0xFF) {
break;
};
}
}
}
static uint16_t avr_isp_current_page(AvrIsp* instance, uint32_t addr, uint16_t page_size) {
furi_assert(instance);
uint16_t page = 0;
switch(page_size) {
case 32:
page = addr & 0xFFFFFFF0;
break;
case 64:
page = addr & 0xFFFFFFE0;
break;
case 128:
page = addr & 0xFFFFFFC0;
break;
case 256:
page = addr & 0xFFFFFF80;
break;
default:
page = addr;
break;
}
return page;
}
static bool avr_isp_flash_write_pages(
AvrIsp* instance,
uint16_t addr,
uint16_t page_size,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
size_t x = 0;
uint16_t page = avr_isp_current_page(instance, addr, page_size);
while(x < data_size) {
if(page != avr_isp_current_page(instance, addr, page_size)) {
avr_isp_commit(instance, page, data[x - 1]);
page = avr_isp_current_page(instance, addr, page_size);
}
avr_isp_spi_transaction(instance, AVR_ISP_WRITE_FLASH_LO(addr, data[x++]));
avr_isp_spi_transaction(instance, AVR_ISP_WRITE_FLASH_HI(addr, data[x++]));
addr++;
}
avr_isp_commit(instance, page, data[x - 1]);
return true;
}
bool avr_isp_erase_chip(AvrIsp* instance) {
furi_assert(instance);
bool ret = false;
if(!instance->pmode) avr_isp_auto_set_spi_speed_start_pmode(instance);
if(instance->pmode) {
avr_isp_spi_transaction(instance, AVR_ISP_ERASE_CHIP);
furi_delay_ms(100);
avr_isp_end_pmode(instance);
ret = true;
}
return ret;
}
static bool
avr_isp_eeprom_write(AvrIsp* instance, uint16_t addr, uint8_t* data, uint32_t data_size) {
furi_assert(instance);
for(uint16_t i = 0; i < data_size; i++) {
avr_isp_spi_transaction(instance, AVR_ISP_WRITE_EEPROM(addr, data[i]));
furi_delay_ms(10);
addr++;
}
return true;
}
bool avr_isp_write_page(
AvrIsp* instance,
uint32_t mem_type,
uint32_t mem_size,
uint16_t addr,
uint16_t page_size,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
bool ret = false;
switch(mem_type) {
case STK_SET_FLASH_TYPE:
if((addr + data_size / 2) <= mem_size) {
ret = avr_isp_flash_write_pages(instance, addr, page_size, data, data_size);
}
break;
case STK_SET_EEPROM_TYPE:
if((addr + data_size) <= mem_size) {
ret = avr_isp_eeprom_write(instance, addr, data, data_size);
}
break;
default:
furi_crash(TAG " Incorrect mem type.");
break;
}
return ret;
}
static bool avr_isp_flash_read_page(
AvrIsp* instance,
uint16_t addr,
uint16_t page_size,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
if(page_size > data_size) return false;
for(uint16_t i = 0; i < page_size; i += 2) {
data[i] = avr_isp_spi_transaction(instance, AVR_ISP_READ_FLASH_LO(addr));
data[i + 1] = avr_isp_spi_transaction(instance, AVR_ISP_READ_FLASH_HI(addr));
addr++;
}
return true;
}
static bool avr_isp_eeprom_read_page(
AvrIsp* instance,
uint16_t addr,
uint16_t page_size,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
if(page_size > data_size) return false;
for(uint16_t i = 0; i < page_size; i++) {
data[i] = avr_isp_spi_transaction(instance, AVR_ISP_READ_EEPROM(addr));
addr++;
}
return true;
}
bool avr_isp_read_page(
AvrIsp* instance,
uint32_t mem_type,
uint16_t addr,
uint16_t page_size,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
bool res = false;
if(mem_type == STK_SET_FLASH_TYPE)
res = avr_isp_flash_read_page(instance, addr, page_size, data, data_size);
if(mem_type == STK_SET_EEPROM_TYPE)
res = avr_isp_eeprom_read_page(instance, addr, page_size, data, data_size);
return res;
}
AvrIspSignature avr_isp_read_signature(AvrIsp* instance) {
furi_assert(instance);
AvrIspSignature signature;
signature.vendor = avr_isp_spi_transaction(instance, AVR_ISP_READ_VENDOR);
signature.part_family = avr_isp_spi_transaction(instance, AVR_ISP_READ_PART_FAMILY);
signature.part_number = avr_isp_spi_transaction(instance, AVR_ISP_READ_PART_NUMBER);
return signature;
}
uint8_t avr_isp_read_lock_byte(AvrIsp* instance) {
furi_assert(instance);
uint8_t data = 0;
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 300) {
data = avr_isp_spi_transaction(instance, AVR_ISP_READ_LOCK_BYTE);
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_LOCK_BYTE) == data) {
break;
};
data = 0x00;
}
return data;
}
bool avr_isp_write_lock_byte(AvrIsp* instance, uint8_t lock) {
furi_assert(instance);
bool ret = false;
if(avr_isp_read_lock_byte(instance) == lock) {
ret = true;
} else {
avr_isp_spi_transaction(instance, AVR_ISP_WRITE_LOCK_BYTE(lock));
/* polling lock byte */
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 30) {
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_LOCK_BYTE) == lock) {
ret = true;
break;
};
}
}
return ret;
}
uint8_t avr_isp_read_fuse_low(AvrIsp* instance) {
furi_assert(instance);
uint8_t data = 0;
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 300) {
data = avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_LOW);
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_LOW) == data) {
break;
};
data = 0x00;
}
return data;
}
bool avr_isp_write_fuse_low(AvrIsp* instance, uint8_t lfuse) {
furi_assert(instance);
bool ret = false;
if(avr_isp_read_fuse_low(instance) == lfuse) {
ret = true;
} else {
avr_isp_spi_transaction(instance, AVR_ISP_WRITE_FUSE_LOW(lfuse));
/* polling fuse */
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 30) {
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_LOW) == lfuse) {
ret = true;
break;
};
}
}
return ret;
}
uint8_t avr_isp_read_fuse_high(AvrIsp* instance) {
furi_assert(instance);
uint8_t data = 0;
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 300) {
data = avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_HIGH);
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_HIGH) == data) {
break;
};
data = 0x00;
}
return data;
}
bool avr_isp_write_fuse_high(AvrIsp* instance, uint8_t hfuse) {
furi_assert(instance);
bool ret = false;
if(avr_isp_read_fuse_high(instance) == hfuse) {
ret = true;
} else {
avr_isp_spi_transaction(instance, AVR_ISP_WRITE_FUSE_HIGH(hfuse));
/* polling fuse */
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 30) {
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_HIGH) == hfuse) {
ret = true;
break;
};
}
}
return ret;
}
uint8_t avr_isp_read_fuse_extended(AvrIsp* instance) {
furi_assert(instance);
uint8_t data = 0;
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 300) {
data = avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_EXTENDED);
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_EXTENDED) == data) {
break;
};
data = 0x00;
}
return data;
}
bool avr_isp_write_fuse_extended(AvrIsp* instance, uint8_t efuse) {
furi_assert(instance);
bool ret = false;
if(avr_isp_read_fuse_extended(instance) == efuse) {
ret = true;
} else {
avr_isp_spi_transaction(instance, AVR_ISP_WRITE_FUSE_EXTENDED(efuse));
/* polling fuse */
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 30) {
if(avr_isp_spi_transaction(instance, AVR_ISP_READ_FUSE_EXTENDED) == efuse) {
ret = true;
break;
};
}
}
return ret;
}
void avr_isp_write_extended_addr(AvrIsp* instance, uint8_t extended_addr) {
furi_assert(instance);
avr_isp_spi_transaction(instance, AVR_ISP_EXTENDED_ADDR(extended_addr));
furi_delay_ms(10);
}

View File

@@ -0,0 +1,70 @@
#pragma once
#include <furi_hal.h>
typedef struct AvrIsp AvrIsp;
typedef void (*AvrIspCallback)(void* context);
struct AvrIspSignature {
uint8_t vendor;
uint8_t part_family;
uint8_t part_number;
};
typedef struct AvrIspSignature AvrIspSignature;
AvrIsp* avr_isp_alloc(void);
void avr_isp_free(AvrIsp* instance);
void avr_isp_set_tx_callback(AvrIsp* instance, AvrIspCallback callback, void* context);
bool avr_isp_auto_set_spi_speed_start_pmode(AvrIsp* instance);
AvrIspSignature avr_isp_read_signature(AvrIsp* instance);
void avr_isp_end_pmode(AvrIsp* instance);
bool avr_isp_erase_chip(AvrIsp* instance);
uint8_t avr_isp_spi_transaction(
AvrIsp* instance,
uint8_t cmd,
uint8_t addr_hi,
uint8_t addr_lo,
uint8_t data);
bool avr_isp_read_page(
AvrIsp* instance,
uint32_t memtype,
uint16_t addr,
uint16_t page_size,
uint8_t* data,
uint32_t data_size);
bool avr_isp_write_page(
AvrIsp* instance,
uint32_t mem_type,
uint32_t mem_size,
uint16_t addr,
uint16_t page_size,
uint8_t* data,
uint32_t data_size);
uint8_t avr_isp_read_lock_byte(AvrIsp* instance);
bool avr_isp_write_lock_byte(AvrIsp* instance, uint8_t lock);
uint8_t avr_isp_read_fuse_low(AvrIsp* instance);
bool avr_isp_write_fuse_low(AvrIsp* instance, uint8_t lfuse);
uint8_t avr_isp_read_fuse_high(AvrIsp* instance);
bool avr_isp_write_fuse_high(AvrIsp* instance, uint8_t hfuse);
uint8_t avr_isp_read_fuse_extended(AvrIsp* instance);
bool avr_isp_write_fuse_extended(AvrIsp* instance, uint8_t efuse);
void avr_isp_write_extended_addr(AvrIsp* instance, uint8_t extended_addr);

View File

@@ -0,0 +1,23 @@
#pragma once
typedef enum {
//SubmenuIndex
SubmenuIndexAvrIspProgrammer = 10,
SubmenuIndexAvrIspReader,
SubmenuIndexAvrIspWriter,
SubmenuIndexAvrIsWiring,
SubmenuIndexAvrIspAbout,
//AvrIspCustomEvent
AvrIspCustomEventSceneChipDetectOk = 100,
AvrIspCustomEventSceneReadingOk,
AvrIspCustomEventSceneWritingOk,
AvrIspCustomEventSceneErrorVerification,
AvrIspCustomEventSceneErrorReading,
AvrIspCustomEventSceneErrorWriting,
AvrIspCustomEventSceneErrorWritingFuse,
AvrIspCustomEventSceneInputName,
AvrIspCustomEventSceneSuccess,
AvrIspCustomEventSceneExit,
AvrIspCustomEventSceneExitStartMenu,
} AvrIspCustomEvent;

View File

@@ -0,0 +1,32 @@
#pragma once
#include <furi.h>
#include <furi_hal.h>
#define AVR_ISP_VERSION_APP "0.1"
#define AVR_ISP_DEVELOPED "SkorP"
#define AVR_ISP_GITHUB "https://github.com/flipperdevices/flipperzero-firmware"
#define AVR_ISP_APP_FILE_VERSION 1
#define AVR_ISP_APP_FILE_TYPE "Flipper Dump AVR"
#define AVR_ISP_APP_EXTENSION ".avr"
typedef enum {
//AvrIspViewVariableItemList,
AvrIspViewSubmenu,
AvrIspViewProgrammer,
AvrIspViewReader,
AvrIspViewWriter,
AvrIspViewWidget,
AvrIspViewPopup,
AvrIspViewTextInput,
AvrIspViewChipDetect,
} AvrIspView;
typedef enum {
AvrIspErrorNoError,
AvrIspErrorReading,
AvrIspErrorWriting,
AvrIspErrorVerification,
AvrIspErrorWritingFuse,
} AvrIspError;

View File

@@ -0,0 +1,266 @@
#include "avr_isp_worker.h"
#include <furi_hal_pwm.h>
#include "../lib/driver/avr_isp_prog.h"
#include "../lib/driver/avr_isp_prog_cmd.h"
#include "../lib/driver/avr_isp_chip_arr.h"
#include <furi.h>
#define TAG "AvrIspWorker"
typedef enum {
AvrIspWorkerEvtStop = (1 << 0),
AvrIspWorkerEvtRx = (1 << 1),
AvrIspWorkerEvtTxCoplete = (1 << 2),
AvrIspWorkerEvtTx = (1 << 3),
AvrIspWorkerEvtState = (1 << 4),
//AvrIspWorkerEvtCfg = (1 << 5),
} AvrIspWorkerEvt;
struct AvrIspWorker {
FuriThread* thread;
volatile bool worker_running;
uint8_t connect_usb;
AvrIspWorkerCallback callback;
void* context;
};
#define AVR_ISP_WORKER_PROG_ALL_EVENTS (AvrIspWorkerEvtStop)
#define AVR_ISP_WORKER_ALL_EVENTS \
(AvrIspWorkerEvtTx | AvrIspWorkerEvtTxCoplete | AvrIspWorkerEvtRx | AvrIspWorkerEvtStop | \
AvrIspWorkerEvtState)
//########################/* VCP CDC */#############################################
#include "usb_cdc.h"
#include <cli/cli_vcp.h>
#include <cli/cli.h>
#include <furi_hal_usb_cdc.h>
#define AVR_ISP_VCP_CDC_CH 1
#define AVR_ISP_VCP_CDC_PKT_LEN CDC_DATA_SZ
#define AVR_ISP_VCP_UART_RX_BUF_SIZE (AVR_ISP_VCP_CDC_PKT_LEN * 5)
static void vcp_on_cdc_tx_complete(void* context);
static void vcp_on_cdc_rx(void* context);
static void vcp_state_callback(void* context, uint8_t state);
static void vcp_on_cdc_control_line(void* context, uint8_t state);
static void vcp_on_line_config(void* context, struct usb_cdc_line_coding* config);
static const CdcCallbacks cdc_cb = {
vcp_on_cdc_tx_complete,
vcp_on_cdc_rx,
vcp_state_callback,
vcp_on_cdc_control_line,
vcp_on_line_config,
};
/* VCP callbacks */
static void vcp_on_cdc_tx_complete(void* context) {
furi_assert(context);
AvrIspWorker* instance = context;
furi_thread_flags_set(furi_thread_get_id(instance->thread), AvrIspWorkerEvtTxCoplete);
}
static void vcp_on_cdc_rx(void* context) {
furi_assert(context);
AvrIspWorker* instance = context;
furi_thread_flags_set(furi_thread_get_id(instance->thread), AvrIspWorkerEvtRx);
}
static void vcp_state_callback(void* context, uint8_t state) {
UNUSED(context);
AvrIspWorker* instance = context;
instance->connect_usb = state;
furi_thread_flags_set(furi_thread_get_id(instance->thread), AvrIspWorkerEvtState);
}
static void vcp_on_cdc_control_line(void* context, uint8_t state) {
UNUSED(context);
UNUSED(state);
}
static void vcp_on_line_config(void* context, struct usb_cdc_line_coding* config) {
UNUSED(context);
UNUSED(config);
}
static void avr_isp_worker_vcp_cdc_init(void* context) {
furi_hal_usb_unlock();
Cli* cli = furi_record_open(RECORD_CLI);
//close cli
cli_session_close(cli);
//disable callbacks VCP_CDC=0
furi_hal_cdc_set_callbacks(0, NULL, NULL);
//set 2 cdc
furi_check(furi_hal_usb_set_config(&usb_cdc_dual, NULL) == true);
//open cli VCP_CDC=0
cli_session_open(cli, &cli_vcp);
furi_record_close(RECORD_CLI);
furi_hal_cdc_set_callbacks(AVR_ISP_VCP_CDC_CH, (CdcCallbacks*)&cdc_cb, context);
}
static void avr_isp_worker_vcp_cdc_deinit(void) {
//disable callbacks AVR_ISP_VCP_CDC_CH
furi_hal_cdc_set_callbacks(AVR_ISP_VCP_CDC_CH, NULL, NULL);
Cli* cli = furi_record_open(RECORD_CLI);
//close cli
cli_session_close(cli);
furi_hal_usb_unlock();
//set 1 cdc
furi_check(furi_hal_usb_set_config(&usb_cdc_single, NULL) == true);
//open cli VCP_CDC=0
cli_session_open(cli, &cli_vcp);
furi_record_close(RECORD_CLI);
}
//#################################################################################
static int32_t avr_isp_worker_prog_thread(void* context) {
AvrIspProg* prog = context;
FURI_LOG_D(TAG, "AvrIspProgWorker Start");
while(1) {
if(furi_thread_flags_get() & AvrIspWorkerEvtStop) break;
avr_isp_prog_avrisp(prog);
}
FURI_LOG_D(TAG, "AvrIspProgWorker Stop");
return 0;
}
static void avr_isp_worker_prog_tx_data(void* context) {
furi_assert(context);
AvrIspWorker* instance = context;
furi_thread_flags_set(furi_thread_get_id(instance->thread), AvrIspWorkerEvtTx);
}
/** Worker thread
*
* @param context
* @return exit code
*/
static int32_t avr_isp_worker_thread(void* context) {
AvrIspWorker* instance = context;
avr_isp_worker_vcp_cdc_init(instance);
/* start PWM on &gpio_ext_pa4 */
furi_hal_pwm_start(FuriHalPwmOutputIdLptim2PA4, 4000000, 50);
AvrIspProg* prog = avr_isp_prog_init();
avr_isp_prog_set_tx_callback(prog, avr_isp_worker_prog_tx_data, instance);
uint8_t buf[AVR_ISP_VCP_UART_RX_BUF_SIZE];
size_t len = 0;
FuriThread* prog_thread =
furi_thread_alloc_ex("AvrIspProgWorker", 1024, avr_isp_worker_prog_thread, prog);
furi_thread_start(prog_thread);
FURI_LOG_D(TAG, "Start");
while(instance->worker_running) {
uint32_t events =
furi_thread_flags_wait(AVR_ISP_WORKER_ALL_EVENTS, FuriFlagWaitAny, FuriWaitForever);
if(events & AvrIspWorkerEvtRx) {
if(avr_isp_prog_spaces_rx(prog) >= AVR_ISP_VCP_CDC_PKT_LEN) {
len = furi_hal_cdc_receive(AVR_ISP_VCP_CDC_CH, buf, AVR_ISP_VCP_CDC_PKT_LEN);
// for(uint8_t i = 0; i < len; i++) {
// FURI_LOG_I(TAG, "--> %X", buf[i]);
// }
avr_isp_prog_rx(prog, buf, len);
} else {
furi_thread_flags_set(furi_thread_get_id(instance->thread), AvrIspWorkerEvtRx);
}
}
if((events & AvrIspWorkerEvtTxCoplete) || (events & AvrIspWorkerEvtTx)) {
len = avr_isp_prog_tx(prog, buf, AVR_ISP_VCP_CDC_PKT_LEN);
// for(uint8_t i = 0; i < len; i++) {
// FURI_LOG_I(TAG, "<-- %X", buf[i]);
// }
if(len > 0) furi_hal_cdc_send(AVR_ISP_VCP_CDC_CH, buf, len);
}
if(events & AvrIspWorkerEvtStop) {
break;
}
if(events & AvrIspWorkerEvtState) {
if(instance->callback)
instance->callback(instance->context, (bool)instance->connect_usb);
}
}
FURI_LOG_D(TAG, "Stop");
furi_thread_flags_set(furi_thread_get_id(prog_thread), AvrIspWorkerEvtStop);
avr_isp_prog_exit(prog);
furi_delay_ms(10);
furi_thread_join(prog_thread);
furi_thread_free(prog_thread);
avr_isp_prog_free(prog);
furi_hal_pwm_stop(FuriHalPwmOutputIdLptim2PA4);
avr_isp_worker_vcp_cdc_deinit();
return 0;
}
AvrIspWorker* avr_isp_worker_alloc(void* context) {
furi_assert(context);
UNUSED(context);
AvrIspWorker* instance = malloc(sizeof(AvrIspWorker));
instance->thread = furi_thread_alloc_ex("AvrIspWorker", 2048, avr_isp_worker_thread, instance);
return instance;
}
void avr_isp_worker_free(AvrIspWorker* instance) {
furi_assert(instance);
furi_check(!instance->worker_running);
furi_thread_free(instance->thread);
free(instance);
}
void avr_isp_worker_set_callback(
AvrIspWorker* instance,
AvrIspWorkerCallback callback,
void* context) {
furi_assert(instance);
instance->callback = callback;
instance->context = context;
}
void avr_isp_worker_start(AvrIspWorker* instance) {
furi_assert(instance);
furi_assert(!instance->worker_running);
instance->worker_running = true;
furi_thread_start(instance->thread);
}
void avr_isp_worker_stop(AvrIspWorker* instance) {
furi_assert(instance);
furi_assert(instance->worker_running);
instance->worker_running = false;
furi_thread_flags_set(furi_thread_get_id(instance->thread), AvrIspWorkerEvtStop);
furi_thread_join(instance->thread);
}
bool avr_isp_worker_is_running(AvrIspWorker* instance) {
furi_assert(instance);
return instance->worker_running;
}

View File

@@ -0,0 +1,49 @@
#pragma once
#include <furi_hal.h>
typedef struct AvrIspWorker AvrIspWorker;
typedef void (*AvrIspWorkerCallback)(void* context, bool connect_usb);
/** Allocate AvrIspWorker
*
* @param context AvrIsp* context
* @return AvrIspWorker*
*/
AvrIspWorker* avr_isp_worker_alloc(void* context);
/** Free AvrIspWorker
*
* @param instance AvrIspWorker instance
*/
void avr_isp_worker_free(AvrIspWorker* instance);
/** Callback AvrIspWorker
*
* @param instance AvrIspWorker instance
* @param callback AvrIspWorkerOverrunCallback callback
* @param context
*/
void avr_isp_worker_set_callback(
AvrIspWorker* instance,
AvrIspWorkerCallback callback,
void* context);
/** Start AvrIspWorker
*
* @param instance AvrIspWorker instance
*/
void avr_isp_worker_start(AvrIspWorker* instance);
/** Stop AvrIspWorker
*
* @param instance AvrIspWorker instance
*/
void avr_isp_worker_stop(AvrIspWorker* instance);
/** Check if worker is running
* @param instance AvrIspWorker instance
* @return bool - true if running
*/
bool avr_isp_worker_is_running(AvrIspWorker* instance);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,99 @@
#pragma once
#include <furi_hal.h>
typedef struct AvrIspWorkerRW AvrIspWorkerRW;
typedef void (*AvrIspWorkerRWCallback)(
void* context,
const char* name,
bool detect_chip,
uint32_t flash_size);
typedef enum {
AvrIspWorkerRWStatusILDE = 0,
AvrIspWorkerRWStatusEndReading = 1,
AvrIspWorkerRWStatusEndVerification = 2,
AvrIspWorkerRWStatusEndWriting = 3,
AvrIspWorkerRWStatusEndWritingFuse = 4,
AvrIspWorkerRWStatusErrorReading = (-1),
AvrIspWorkerRWStatusErrorVerification = (-2),
AvrIspWorkerRWStatusErrorWriting = (-3),
AvrIspWorkerRWStatusErrorWritingFuse = (-4),
AvrIspWorkerRWStatusReserved = 0x7FFFFFFF, ///< Prevents enum down-size compiler optimization.
} AvrIspWorkerRWStatus;
typedef void (*AvrIspWorkerRWStatusCallback)(void* context, AvrIspWorkerRWStatus status);
AvrIspWorkerRW* avr_isp_worker_rw_alloc(void* context);
void avr_isp_worker_rw_free(AvrIspWorkerRW* instance);
void avr_isp_worker_rw_start(AvrIspWorkerRW* instance);
void avr_isp_worker_rw_stop(AvrIspWorkerRW* instance);
bool avr_isp_worker_rw_is_running(AvrIspWorkerRW* instance);
void avr_isp_worker_rw_set_callback(
AvrIspWorkerRW* instance,
AvrIspWorkerRWCallback callback,
void* context);
void avr_isp_worker_rw_set_callback_status(
AvrIspWorkerRW* instance,
AvrIspWorkerRWStatusCallback callback_status,
void* context_status);
bool avr_isp_worker_rw_detect_chip(AvrIspWorkerRW* instance);
float avr_isp_worker_rw_get_progress_flash(AvrIspWorkerRW* instance);
float avr_isp_worker_rw_get_progress_eeprom(AvrIspWorkerRW* instance);
bool avr_isp_worker_rw_read_dump(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
void avr_isp_worker_rw_read_dump_start(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
bool avr_isp_worker_rw_verification(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
void avr_isp_worker_rw_verification_start(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
bool avr_isp_worker_rw_check_hex(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
bool avr_isp_worker_rw_write_dump(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
void avr_isp_worker_rw_write_dump_start(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
bool avr_isp_worker_rw_write_fuse(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);
void avr_isp_worker_rw_write_fuse_start(
AvrIspWorkerRW* instance,
const char* file_path,
const char* file_name);

View File

@@ -0,0 +1,321 @@
#include "flipper_i32hex_file.h"
#include <string.h>
#include <storage/storage.h>
#include <toolbox/stream/stream.h>
#include <toolbox/stream/file_stream.h>
#include <toolbox/hex.h>
//https://en.wikipedia.org/wiki/Intel_HEX
#define TAG "FlipperI32HexFile"
#define COUNT_BYTE_PAYLOAD 32 //how much payload will be used
#define I32HEX_TYPE_DATA 0x00
#define I32HEX_TYPE_END_OF_FILE 0x01
#define I32HEX_TYPE_EXT_LINEAR_ADDR 0x04
#define I32HEX_TYPE_START_LINEAR_ADDR 0x05
struct FlipperI32HexFile {
uint32_t addr;
uint32_t addr_last;
Storage* storage;
Stream* stream;
FuriString* str_data;
FlipperI32HexFileStatus file_open;
};
FlipperI32HexFile* flipper_i32hex_file_open_write(const char* name, uint32_t start_addr) {
furi_assert(name);
FlipperI32HexFile* instance = malloc(sizeof(FlipperI32HexFile));
instance->addr = start_addr;
instance->addr_last = 0;
instance->storage = furi_record_open(RECORD_STORAGE);
instance->stream = file_stream_alloc(instance->storage);
if(file_stream_open(instance->stream, name, FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
instance->file_open = FlipperI32HexFileStatusOpenFileWrite;
FURI_LOG_D(TAG, "Open write file %s", name);
} else {
FURI_LOG_E(TAG, "Failed to open file %s", name);
instance->file_open = FlipperI32HexFileStatusErrorNoOpenFile;
}
instance->str_data = furi_string_alloc(instance->storage);
return instance;
}
FlipperI32HexFile* flipper_i32hex_file_open_read(const char* name) {
furi_assert(name);
FlipperI32HexFile* instance = malloc(sizeof(FlipperI32HexFile));
instance->addr = 0;
instance->addr_last = 0;
instance->storage = furi_record_open(RECORD_STORAGE);
instance->stream = file_stream_alloc(instance->storage);
if(file_stream_open(instance->stream, name, FSAM_READ, FSOM_OPEN_EXISTING)) {
instance->file_open = FlipperI32HexFileStatusOpenFileRead;
FURI_LOG_D(TAG, "Open read file %s", name);
} else {
FURI_LOG_E(TAG, "Failed to open file %s", name);
instance->file_open = FlipperI32HexFileStatusErrorNoOpenFile;
}
instance->str_data = furi_string_alloc(instance->storage);
return instance;
}
void flipper_i32hex_file_close(FlipperI32HexFile* instance) {
furi_assert(instance);
furi_string_free(instance->str_data);
file_stream_close(instance->stream);
stream_free(instance->stream);
furi_record_close(RECORD_STORAGE);
}
FlipperI32HexFileRet flipper_i32hex_file_bin_to_i32hex_set_data(
FlipperI32HexFile* instance,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
furi_assert(data);
FlipperI32HexFileRet ret = {.status = FlipperI32HexFileStatusOK, .data_size = 0};
if(instance->file_open != FlipperI32HexFileStatusOpenFileWrite) {
ret.status = FlipperI32HexFileStatusErrorFileWrite;
}
uint8_t count_byte = 0;
uint32_t ind = 0;
uint8_t crc = 0;
furi_string_reset(instance->str_data);
if((instance->addr_last & 0xFF0000) < (instance->addr & 0xFF0000)) {
crc = 0x02 + 0x04 + ((instance->addr >> 24) & 0xFF) + ((instance->addr >> 16) & 0xFF);
crc = 0x01 + ~crc;
//I32HEX_TYPE_EXT_LINEAR_ADDR
furi_string_cat_printf(
instance->str_data, ":02000004%04lX%02X\r\n", (instance->addr >> 16), crc);
instance->addr_last = instance->addr;
}
while(ind < data_size) {
if((ind + COUNT_BYTE_PAYLOAD) > data_size) {
count_byte = data_size - ind;
} else {
count_byte = COUNT_BYTE_PAYLOAD;
}
//I32HEX_TYPE_DATA
furi_string_cat_printf(
instance->str_data, ":%02X%04lX00", count_byte, (instance->addr & 0xFFFF));
crc = count_byte + ((instance->addr >> 8) & 0xFF) + (instance->addr & 0xFF);
for(uint32_t i = 0; i < count_byte; i++) {
furi_string_cat_printf(instance->str_data, "%02X", *data);
crc += *data++;
}
crc = 0x01 + ~crc;
furi_string_cat_printf(instance->str_data, "%02X\r\n", crc);
ind += count_byte;
instance->addr += count_byte;
}
if(instance->file_open) stream_write_string(instance->stream, instance->str_data);
return ret;
}
FlipperI32HexFileRet flipper_i32hex_file_bin_to_i32hex_set_end_line(FlipperI32HexFile* instance) {
furi_assert(instance);
FlipperI32HexFileRet ret = {.status = FlipperI32HexFileStatusOK, .data_size = 0};
if(instance->file_open != FlipperI32HexFileStatusOpenFileWrite) {
ret.status = FlipperI32HexFileStatusErrorFileWrite;
}
furi_string_reset(instance->str_data);
//I32HEX_TYPE_END_OF_FILE
furi_string_cat_printf(instance->str_data, ":00000001FF\r\n");
if(instance->file_open) stream_write_string(instance->stream, instance->str_data);
return ret;
}
void flipper_i32hex_file_bin_to_i32hex_set_addr(FlipperI32HexFile* instance, uint32_t addr) {
furi_assert(instance);
instance->addr = addr;
}
const char* flipper_i32hex_file_get_string(FlipperI32HexFile* instance) {
furi_assert(instance);
return furi_string_get_cstr(instance->str_data);
}
static FlipperI32HexFileRet flipper_i32hex_file_parse_line(
FlipperI32HexFile* instance,
const char* str,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
furi_assert(data);
char* str1;
uint32_t data_wrire_ind = 0;
uint32_t data_len = 0;
FlipperI32HexFileRet ret = {.status = FlipperI32HexFileStatusErrorData, .data_size = 0};
//Search for start of data I32HEX
str1 = strstr(str, ":");
do {
if(str1 == NULL) {
ret.status = FlipperI32HexFileStatusErrorData;
break;
}
str1++;
if(!hex_char_to_uint8(*str1, str1[1], data + data_wrire_ind)) {
ret.status = FlipperI32HexFileStatusErrorData;
break;
}
str1++;
if(++data_wrire_ind > data_size) {
ret.status = FlipperI32HexFileStatusErrorOverflow;
break;
}
data_len = 5 + data[0]; // +5 bytes per header and crc
while(data_len > data_wrire_ind) {
str1++;
if(!hex_char_to_uint8(*str1, str1[1], data + data_wrire_ind)) {
ret.status = FlipperI32HexFileStatusErrorData;
break;
}
str1++;
if(++data_wrire_ind > data_size) {
ret.status = FlipperI32HexFileStatusErrorOverflow;
break;
}
}
ret.status = FlipperI32HexFileStatusOK;
ret.data_size = data_wrire_ind;
} while(0);
return ret;
}
static bool flipper_i32hex_file_check_data(uint8_t* data, uint32_t data_size) {
furi_assert(data);
uint8_t crc = 0;
uint32_t data_read_ind = 0;
if(data[0] > data_size) return false;
while(data_read_ind < data_size - 1) {
crc += data[data_read_ind++];
}
return data[data_size - 1] == ((1 + ~crc) & 0xFF);
}
static FlipperI32HexFileRet flipper_i32hex_file_parse(
FlipperI32HexFile* instance,
const char* str,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
furi_assert(data);
FlipperI32HexFileRet ret = flipper_i32hex_file_parse_line(instance, str, data, data_size);
if((ret.status == FlipperI32HexFileStatusOK) && (ret.data_size > 4)) {
switch(data[3]) {
case I32HEX_TYPE_DATA:
if(flipper_i32hex_file_check_data(data, ret.data_size)) {
ret.data_size -= 5;
memcpy(data, data + 4, ret.data_size);
ret.status = FlipperI32HexFileStatusData;
} else {
ret.status = FlipperI32HexFileStatusErrorCrc;
ret.data_size = 0;
}
break;
case I32HEX_TYPE_END_OF_FILE:
if(flipper_i32hex_file_check_data(data, ret.data_size)) {
ret.status = FlipperI32HexFileStatusEofFile;
ret.data_size = 0;
} else {
ret.status = FlipperI32HexFileStatusErrorCrc;
ret.data_size = 0;
}
break;
case I32HEX_TYPE_EXT_LINEAR_ADDR:
if(flipper_i32hex_file_check_data(data, ret.data_size)) {
data[0] = data[4];
data[1] = data[5];
data[3] = 0;
data[4] = 0;
ret.status = FlipperI32HexFileStatusUdateAddr;
ret.data_size = 4;
} else {
ret.status = FlipperI32HexFileStatusErrorCrc;
ret.data_size = 0;
}
break;
case I32HEX_TYPE_START_LINEAR_ADDR:
ret.status = FlipperI32HexFileStatusErrorUnsupportedCommand;
ret.data_size = 0;
break;
default:
ret.status = FlipperI32HexFileStatusErrorUnsupportedCommand;
ret.data_size = 0;
break;
}
} else {
ret.status = FlipperI32HexFileStatusErrorData;
ret.data_size = 0;
}
return ret;
}
bool flipper_i32hex_file_check(FlipperI32HexFile* instance) {
furi_assert(instance);
uint32_t data_size = 280;
uint8_t data[280] = {0};
bool ret = true;
if(instance->file_open != FlipperI32HexFileStatusOpenFileRead) {
FURI_LOG_E(TAG, "File is not open");
ret = false;
} else {
stream_rewind(instance->stream);
while(stream_read_line(instance->stream, instance->str_data)) {
FlipperI32HexFileRet parse_ret = flipper_i32hex_file_parse(
instance, furi_string_get_cstr(instance->str_data), data, data_size);
if(parse_ret.status < 0) {
ret = false;
}
}
stream_rewind(instance->stream);
}
return ret;
}
FlipperI32HexFileRet flipper_i32hex_file_i32hex_to_bin_get_data(
FlipperI32HexFile* instance,
uint8_t* data,
uint32_t data_size) {
furi_assert(instance);
furi_assert(data);
FlipperI32HexFileRet ret = {.status = FlipperI32HexFileStatusOK, .data_size = 0};
if(instance->file_open != FlipperI32HexFileStatusOpenFileRead) {
ret.status = FlipperI32HexFileStatusErrorFileRead;
} else {
stream_read_line(instance->stream, instance->str_data);
ret = flipper_i32hex_file_parse(
instance, furi_string_get_cstr(instance->str_data), data, data_size);
}
return ret;
}

View File

@@ -0,0 +1,55 @@
#pragma once
#include <furi_hal.h>
typedef struct FlipperI32HexFile FlipperI32HexFile;
typedef enum {
FlipperI32HexFileStatusOK = 0,
FlipperI32HexFileStatusData = 2,
FlipperI32HexFileStatusUdateAddr = 3,
FlipperI32HexFileStatusEofFile = 4,
FlipperI32HexFileStatusOpenFileWrite = 5,
FlipperI32HexFileStatusOpenFileRead = 6,
// Errors
FlipperI32HexFileStatusErrorCrc = (-1),
FlipperI32HexFileStatusErrorOverflow = (-2),
FlipperI32HexFileStatusErrorData = (-3),
FlipperI32HexFileStatusErrorUnsupportedCommand = (-4),
FlipperI32HexFileStatusErrorNoOpenFile = (-5),
FlipperI32HexFileStatusErrorFileWrite = (-6),
FlipperI32HexFileStatusErrorFileRead = (-7),
FlipperI32HexFileStatusReserved =
0x7FFFFFFF, ///< Prevents enum down-size compiler optimization.
} FlipperI32HexFileStatus;
typedef struct {
FlipperI32HexFileStatus status;
uint32_t data_size;
} FlipperI32HexFileRet;
FlipperI32HexFile* flipper_i32hex_file_open_write(const char* name, uint32_t start_addr);
FlipperI32HexFile* flipper_i32hex_file_open_read(const char* name);
void flipper_i32hex_file_close(FlipperI32HexFile* instance);
FlipperI32HexFileRet flipper_i32hex_file_bin_to_i32hex_set_data(
FlipperI32HexFile* instance,
uint8_t* data,
uint32_t data_size);
FlipperI32HexFileRet flipper_i32hex_file_bin_to_i32hex_set_end_line(FlipperI32HexFile* instance);
const char* flipper_i32hex_file_get_string(FlipperI32HexFile* instance);
void flipper_i32hex_file_bin_to_i32hex_set_addr(FlipperI32HexFile* instance, uint32_t addr);
bool flipper_i32hex_file_check(FlipperI32HexFile* instance);
FlipperI32HexFileRet flipper_i32hex_file_i32hex_to_bin_get_data(
FlipperI32HexFile* instance,
uint8_t* data,
uint32_t data_size);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,386 @@
#include "avr_isp_chip_arr.h"
#include <furi.h>
//https://github.com/avrdudes/avrdude/blob/master/src/avrintel.c
const AvrIspChipArr avr_isp_chip_arr[] = { // Value of -1 typically means unknown
//{mcu_name, mcuid, family, {sig, na, ture}, flstart, flsize, pgsiz, nb, bootsz, eestart, eesize, ep, rambeg, ramsiz, nf, nl, ni}, // Source
{"ATtiny4", 0, F_AVR8L, {0x1E, 0x8F, 0x0A}, 0, 0x00200, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 10}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATtiny5", 1, F_AVR8L, {0x1E, 0x8F, 0x09}, 0, 0x00200, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 11}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATtiny9", 2, F_AVR8L, {0x1E, 0x90, 0x08}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 10}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATtiny10", 3, F_AVR8L, {0x1E, 0x90, 0x03}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 11}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATtiny20", 4, F_AVR8L, {0x1E, 0x91, 0x0F}, 0, 0x00800, 0x020, 0, 0, 0, 0, 0, 0x0040, 0x0080, 1, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATtiny40", 5, F_AVR8L, {0x1E, 0x92, 0x0E}, 0, 0x01000, 0x040, 0, 0, 0, 0, 0, 0x0040, 0x0100, 1, 1, 18}, // atdf, avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATtiny102", 6, F_AVR8L, {0x1E, 0x90, 0x0C}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 16}, // atdf, avrdude, boot size (manual)
{"ATtiny104", 7, F_AVR8L, {0x1E, 0x90, 0x0B}, 0, 0x00400, 0x010, 0, 0, 0, 0, 0, 0x0040, 0x0020, 1, 1, 16}, // atdf, avrdude, boot size (manual)
{"ATtiny11", 8, F_AVR8, {0x1E, 0x90, 0x04}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 1, 0x0060, 0x0020, 1, 1, 5}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny12", 9, F_AVR8, {0x1E, 0x90, 0x05}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 2, 0x0060, 0x0020, 1, 1, 6}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny13", 10, F_AVR8, {0x1E, 0x90, 0x07}, 0, 0x00400, 0x020, 0, 0, 0, 0x0040, 4, 0x0060, 0x0040, 2, 1, 10}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny13A", 11, F_AVR8, {0x1E, 0x90, 0x07}, 0, 0x00400, 0x020, 0, 0, 0, 0x0040, 4, 0x0060, 0x0040, 2, 1, 10}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny15", 12, F_AVR8, {0x1E, 0x90, 0x06}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 2, 0x0060, 0x0020, 1, 1, 9}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny22", 13, F_AVR8, {0x1E, 0x91, 0x06}, 0, 0x00800, -1, 0, 0, -1, -1, -1, 0x0060, 0x0080, 1, 1, 3}, // avr-gcc 12.2.0, boot size (manual)
{"ATtiny24", 14, F_AVR8, {0x1E, 0x91, 0x0B}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny24A", 15, F_AVR8, {0x1E, 0x91, 0x0B}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny25", 16, F_AVR8, {0x1E, 0x91, 0x08}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 15}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny26", 17, F_AVR8, {0x1E, 0x91, 0x09}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 2, 1, 12}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny28", 18, F_AVR8, {0x1E, 0x91, 0x07}, 0, 0x00800, 0x002, 0, 0, 0, 0, 0, 0x0060, 0x0020, 1, 1, 6}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny43U", 19, F_AVR8, {0x1E, 0x92, 0x0C}, 0, 0x01000, 0x040, 0, 0, 0, 0x0040, 4, 0x0060, 0x0100, 3, 1, 16}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny44", 20, F_AVR8, {0x1E, 0x92, 0x07}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny44A", 21, F_AVR8, {0x1E, 0x92, 0x07}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny45", 22, F_AVR8, {0x1E, 0x92, 0x06}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 15}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny48", 23, F_AVR8, {0x1E, 0x92, 0x09}, 0, 0x01000, 0x040, 0, 0, 0, 0x0040, 4, 0x0100, 0x0100, 3, 1, 20}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny84", 24, F_AVR8, {0x1E, 0x93, 0x0C}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny84A", 25, F_AVR8, {0x1E, 0x93, 0x0C}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny85", 26, F_AVR8, {0x1E, 0x93, 0x0B}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 15}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny87", 27, F_AVR8, {0x1E, 0x93, 0x87}, 0, 0x02000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny88", 28, F_AVR8, {0x1E, 0x93, 0x11}, 0, 0x02000, 0x040, 0, 0, 0, 0x0040, 4, 0x0100, 0x0200, 3, 1, 20}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny167", 29, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny261", 30, F_AVR8, {0x1E, 0x91, 0x0C}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny261A", 31, F_AVR8, {0x1E, 0x91, 0x0C}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny441", 32, F_AVR8, {0x1E, 0x92, 0x15}, 0, 0x01000, 0x010, 0, 0, 0, 0x0100, 4, 0x0100, 0x0100, 3, 1, 30}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny461", 33, F_AVR8, {0x1E, 0x92, 0x08}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny461A", 34, F_AVR8, {0x1E, 0x92, 0x08}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny828", 35, F_AVR8, {0x1E, 0x93, 0x14}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny828R", 36, F_AVR8, {0x1E, 0x93, 0x14}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26}, // avrdude, from ATtiny828
{"ATtiny841", 37, F_AVR8, {0x1E, 0x93, 0x15}, 0, 0x02000, 0x010, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 30}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny861", 38, F_AVR8, {0x1E, 0x93, 0x0D}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny861A", 39, F_AVR8, {0x1E, 0x93, 0x0D}, 0, 0x02000, 0x040, 0, 0, 0, 0x0200, 4, 0x0060, 0x0200, 3, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1634", 40, F_AVR8, {0x1E, 0x94, 0x12}, 0, 0x04000, 0x020, 0, 0, 0, 0x0100, 4, 0x0100, 0x0400, 3, 1, 28}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1634R", 41, F_AVR8, {0x1E, 0x94, 0x12}, 0, 0x04000, 0x020, 0, 0, 0, 0x0100, 4, 0x0100, 0x0400, 3, 1, 28}, // avrdude, from ATtiny1634
{"ATtiny2313", 42, F_AVR8, {0x1E, 0x91, 0x0A}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny2313A", 43, F_AVR8, {0x1E, 0x91, 0x0A}, 0, 0x00800, 0x020, 0, 0, 0, 0x0080, 4, 0x0060, 0x0080, 3, 1, 21}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny4313", 44, F_AVR8, {0x1E, 0x92, 0x0D}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0060, 0x0100, 3, 1, 21}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega8", 45, F_AVR8, {0x1E, 0x93, 0x07}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega8A", 46, F_AVR8, {0x1E, 0x93, 0x07}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 19}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega8HVA", 47, F_AVR8, {0x1E, 0x93, 0x10}, 0, 0x02000, 0x080, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 1, 1, 21}, // atdf, avr-gcc 12.2.0
{"ATmega8U2", 48, F_AVR8, {0x1E, 0x93, 0x89}, 0, 0x02000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega16", 49, F_AVR8, {0x1E, 0x94, 0x03}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 21}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega16A", 50, F_AVR8, {0x1E, 0x94, 0x03}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0400, 2, 1, 21}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega16HVA", 51, F_AVR8, {0x1E, 0x94, 0x0C}, 0, 0x04000, 0x080, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 1, 1, 21}, // atdf, avr-gcc 12.2.0
{"ATmega16HVB", 52, F_AVR8, {0x1E, 0x94, 0x0D}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 2, 1, 29}, // atdf, avr-gcc 12.2.0
{"ATmega16HVBrevB", 53, F_AVR8, {0x1E, 0x94, 0x0D}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 2, 1, 29}, // atdf, avr-gcc 12.2.0
{"ATmega16M1", 54, F_AVR8, {0x1E, 0x94, 0x84}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31}, // atdf, avr-gcc 12.2.0
{"ATmega16HVA2", 55, F_AVR8, {0x1E, 0x94, 0x0E}, 0, 0x04000, 0x080, -1, -1, -1, -1, -1, 0x0100, 0x0400, 2, 1, 22}, // avr-gcc 12.2.0
{"ATmega16U2", 56, F_AVR8, {0x1E, 0x94, 0x89}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega16U4", 57, F_AVR8, {0x1E, 0x94, 0x88}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0500, 3, 1, 43}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega32", 58, F_AVR8, {0x1E, 0x95, 0x02}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0060, 0x0800, 2, 1, 21}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega32A", 59, F_AVR8, {0x1E, 0x95, 0x02}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0060, 0x0800, 2, 1, 21}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega32HVB", 60, F_AVR8, {0x1E, 0x95, 0x10}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 2, 1, 29}, // atdf, avr-gcc 12.2.0
{"ATmega32HVBrevB", 61, F_AVR8, {0x1E, 0x95, 0x10}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 2, 1, 29}, // atdf, avr-gcc 12.2.0
{"ATmega32C1", 62, F_AVR8, {0x1E, 0x95, 0x86}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31}, // atdf, avr-gcc 12.2.0
{"ATmega32M1", 63, F_AVR8, {0x1E, 0x95, 0x84}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega32U2", 64, F_AVR8, {0x1E, 0x95, 0x8A}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0400, 3, 1, 29}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega32U4", 65, F_AVR8, {0x1E, 0x95, 0x87}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0a00, 3, 1, 43}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega32U6", 66, F_AVR8, {0x1E, 0x95, 0x88}, 0, 0x08000, 0x080, 4, 0x0200, -1, -1, -1, 0x0100, 0x0a00, 3, 1, 38}, // avr-gcc 12.2.0, boot size (manual)
{"ATmega48", 67, F_AVR8, {0x1E, 0x92, 0x05}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega48A", 68, F_AVR8, {0x1E, 0x92, 0x05}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega48P", 69, F_AVR8, {0x1E, 0x92, 0x0A}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega48PA", 70, F_AVR8, {0x1E, 0x92, 0x0A}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega48PB", 71, F_AVR8, {0x1E, 0x92, 0x10}, 0, 0x01000, 0x040, 0, 0, 0, 0x0100, 4, 0x0100, 0x0200, 3, 1, 27}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega64", 72, F_AVR8, {0x1E, 0x96, 0x02}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 35}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega64A", 73, F_AVR8, {0x1E, 0x96, 0x02}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 35}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega64HVE", 74, F_AVR8, {0x1E, 0x96, 0x10}, 0, 0x10000, 0x080, 4, 0x0400, -1, -1, -1, 0x0100, 0x1000, 2, 1, 25}, // avr-gcc 12.2.0, boot size (manual)
{"ATmega64C1", 75, F_AVR8, {0x1E, 0x96, 0x86}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31}, // atdf, avr-gcc 12.2.0
{"ATmega64M1", 76, F_AVR8, {0x1E, 0x96, 0x84}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega64HVE2", 77, F_AVR8, {0x1E, 0x96, 0x10}, 0, 0x10000, 0x080, 4, 0x0400, 0, 0x0400, 4, 0x0100, 0x1000, 2, 1, 25}, // atdf, avr-gcc 12.2.0
{"ATmega64RFR2", 78, F_AVR8, {0x1E, 0xA6, 0x02}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0200, 0x2000, 3, 1, 77}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega88", 79, F_AVR8, {0x1E, 0x93, 0x0A}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega88A", 80, F_AVR8, {0x1E, 0x93, 0x0A}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega88P", 81, F_AVR8, {0x1E, 0x93, 0x0F}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega88PA", 82, F_AVR8, {0x1E, 0x93, 0x0F}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega88PB", 83, F_AVR8, {0x1E, 0x93, 0x16}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 27}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega103", 84, F_AVR8, {0x1E, 0x97, 0x01}, 0, 0x20000, 0x100, 0, 0, 0, 0x1000, 1, 0x0060, 0x0fa0, 1, 1, 24}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATmega128", 85, F_AVR8, {0x1E, 0x97, 0x02}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x1000, 3, 1, 35}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega128A", 86, F_AVR8, {0x1E, 0x97, 0x02}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x1000, 3, 1, 35}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega128RFA1", 87, F_AVR8, {0x1E, 0xA7, 0x01}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x4000, 3, 1, 72}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega128RFR2", 88, F_AVR8, {0x1E, 0xA7, 0x02}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x4000, 3, 1, 77}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega161", 89, F_AVR8, {0x1E, 0x94, 0x01}, 0, 0x04000, 0x080, 1, 0x0400, 0, 0x0200, 1, 0x0060, 0x0400, 1, 1, 21}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATmega162", 90, F_AVR8, {0x1E, 0x94, 0x04}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 28}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega163", 91, F_AVR8, {0x1E, 0x94, 0x02}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 1, 0x0060, 0x0400, 2, 1, 18}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATmega164A", 92, F_AVR8, {0x1E, 0x94, 0x0F}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega164P", 93, F_AVR8, {0x1E, 0x94, 0x0A}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega164PA", 94, F_AVR8, {0x1E, 0x94, 0x0A}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega165", 95, F_AVR8, {0x1E, 0x94, 0x10}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATmega165A", 96, F_AVR8, {0x1E, 0x94, 0x10}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega165P", 97, F_AVR8, {0x1E, 0x94, 0x07}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega165PA", 98, F_AVR8, {0x1E, 0x94, 0x07}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega168", 99, F_AVR8, {0x1E, 0x94, 0x06}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega168A", 100, F_AVR8, {0x1E, 0x94, 0x06}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega168P", 101, F_AVR8, {0x1E, 0x94, 0x0B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega168PA", 102, F_AVR8, {0x1E, 0x94, 0x0B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega168PB", 103, F_AVR8, {0x1E, 0x94, 0x15}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 27}, // atdf, avr-gcc 7.3.0, avrdude
{"ATmega169", 104, F_AVR8, {0x1E, 0x94, 0x05}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"ATmega169A", 105, F_AVR8, {0x1E, 0x94, 0x11}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega169P", 106, F_AVR8, {0x1E, 0x94, 0x05}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega169PA", 107, F_AVR8, {0x1E, 0x94, 0x05}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega256RFR2", 108, F_AVR8, {0x1E, 0xA8, 0x02}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x2000, 8, 0x0200, 0x8000, 3, 1, 77}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega323", 109, F_AVR8, {0x1E, 0x95, 0x01}, 0, 0x08000, 0x080, 4, 0x0200, -1, -1, -1, 0x0060, 0x0800, 2, 1, 21}, // avr-gcc 12.2.0, boot size (manual)
{"ATmega324A", 110, F_AVR8, {0x1E, 0x95, 0x15}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega324P", 111, F_AVR8, {0x1E, 0x95, 0x08}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega324PA", 112, F_AVR8, {0x1E, 0x95, 0x11}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega324PB", 113, F_AVR8, {0x1E, 0x95, 0x17}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 51}, // atdf, avrdude
{"ATmega325", 114, F_AVR8, {0x1E, 0x95, 0x05}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega325A", 115, F_AVR8, {0x1E, 0x95, 0x05}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega325P", 116, F_AVR8, {0x1E, 0x95, 0x0D}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega325PA", 117, F_AVR8, {0x1E, 0x95, 0x0D}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega328", 118, F_AVR8, {0x1E, 0x95, 0x14}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega328P", 119, F_AVR8, {0x1E, 0x95, 0x0F}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega328PB", 120, F_AVR8, {0x1E, 0x95, 0x16}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 45}, // atdf, avr-gcc 7.3.0, avrdude
{"ATmega329", 121, F_AVR8, {0x1E, 0x95, 0x03}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega329A", 122, F_AVR8, {0x1E, 0x95, 0x03}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega329P", 123, F_AVR8, {0x1E, 0x95, 0x0B}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega329PA", 124, F_AVR8, {0x1E, 0x95, 0x0B}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega406", 125, F_AVR8, {0x1E, 0x95, 0x07}, 0, 0x0a000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0800, 2, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega640", 126, F_AVR8, {0x1E, 0x96, 0x08}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega644", 127, F_AVR8, {0x1E, 0x96, 0x09}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 28}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega644A", 128, F_AVR8, {0x1E, 0x96, 0x09}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega644P", 129, F_AVR8, {0x1E, 0x96, 0x0A}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega644PA", 130, F_AVR8, {0x1E, 0x96, 0x0A}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega644RFR2", 131, F_AVR8, {0x1E, 0xA6, 0x03}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0200, 0x2000, 3, 1, 77}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega645", 132, F_AVR8, {0x1E, 0x96, 0x05}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega645A", 133, F_AVR8, {0x1E, 0x96, 0x05}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega645P", 134, F_AVR8, {0x1E, 0x96, 0x0D}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 22}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega649", 135, F_AVR8, {0x1E, 0x96, 0x03}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega649A", 136, F_AVR8, {0x1E, 0x96, 0x03}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega649P", 137, F_AVR8, {0x1E, 0x96, 0x0B}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 23}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega1280", 138, F_AVR8, {0x1E, 0x97, 0x03}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega1281", 139, F_AVR8, {0x1E, 0x97, 0x04}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega1284", 140, F_AVR8, {0x1E, 0x97, 0x06}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x4000, 3, 1, 35}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega1284P", 141, F_AVR8, {0x1E, 0x97, 0x05}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x4000, 3, 1, 35}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega1284RFR2", 142, F_AVR8, {0x1E, 0xA7, 0x03}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x4000, 3, 1, 77}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega2560", 143, F_AVR8, {0x1E, 0x98, 0x01}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega2561", 144, F_AVR8, {0x1E, 0x98, 0x02}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0200, 0x2000, 3, 1, 57}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega2564RFR2", 145, F_AVR8, {0x1E, 0xA8, 0x03}, 0, 0x40000, 0x100, 4, 0x0400, 0, 0x2000, 8, 0x0200, 0x8000, 3, 1, 77}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3250", 146, F_AVR8, {0x1E, 0x95, 0x06}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3250A", 147, F_AVR8, {0x1E, 0x95, 0x06}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3250P", 148, F_AVR8, {0x1E, 0x95, 0x0E}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3250PA", 149, F_AVR8, {0x1E, 0x95, 0x0E}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3290", 150, F_AVR8, {0x1E, 0x95, 0x04}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3290A", 151, F_AVR8, {0x1E, 0x95, 0x04}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3290P", 152, F_AVR8, {0x1E, 0x95, 0x0C}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3290PA", 153, F_AVR8, {0x1E, 0x95, 0x0C}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega6450", 154, F_AVR8, {0x1E, 0x96, 0x06}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega6450A", 155, F_AVR8, {0x1E, 0x96, 0x06}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega6450P", 156, F_AVR8, {0x1E, 0x96, 0x0E}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega6490", 157, F_AVR8, {0x1E, 0x96, 0x04}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega6490A", 158, F_AVR8, {0x1E, 0x96, 0x04}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega6490P", 159, F_AVR8, {0x1E, 0x96, 0x0C}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 25}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega8515", 160, F_AVR8, {0x1E, 0x93, 0x06}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0200, 2, 1, 17}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega8535", 161, F_AVR8, {0x1E, 0x93, 0x08}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0060, 0x0200, 2, 1, 21}, // atdf, avr-gcc 12.2.0, avrdude
{"AT43USB320", 162, F_AVR8, {0xff, -1, -1}, 0, 0x10000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0200, -1, -1, 0}, // avr-gcc 12.2.0
{"AT43USB355", 163, F_AVR8, {0xff, -1, -1}, 0, 0x06000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0400, -1, -1, 0}, // avr-gcc 12.2.0
{"AT76C711", 164, F_AVR8, {0xff, -1, -1}, 0, 0x04000, -1, -1, -1, -1, -1, -1, 0x0060, 0x07a0, -1, -1, 0}, // avr-gcc 12.2.0
{"AT86RF401", 165, F_AVR8, {0x1E, 0x91, 0x81}, 0, 0x00800, -1, -1, -1, -1, -1, -1, 0x0060, 0x0080, 0, 1, 3}, // avr-gcc 12.2.0
{"AT90PWM1", 166, F_AVR8, {0x1E, 0x93, 0x83}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32}, // atdf, avr-gcc 12.2.0
{"AT90PWM2", 167, F_AVR8, {0x1E, 0x93, 0x81}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90PWM2B", 168, F_AVR8, {0x1E, 0x93, 0x83}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90PWM3", 169, F_AVR8, {0x1E, 0x93, 0x81}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90PWM3B", 170, F_AVR8, {0x1E, 0x93, 0x83}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 32}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90CAN32", 171, F_AVR8, {0x1E, 0x95, 0x81}, 0, 0x08000, 0x100, 4, 0x0400, 0, 0x0400, 8, 0x0100, 0x0800, 3, 1, 37}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90CAN64", 172, F_AVR8, {0x1E, 0x96, 0x81}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 37}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90PWM81", 173, F_AVR8, {0x1E, 0x93, 0x88}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0100, 3, 1, 20}, // atdf, avr-gcc 12.2.0
{"AT90USB82", 174, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90SCR100", 175, F_AVR8, {0x1E, 0x96, 0xC1}, 0, 0x10000, 0x100, 4, 0x0200, -1, -1, -1, 0x0100, 0x1000, 3, 1, 38}, // avr-gcc 12.2.0, boot size (manual)
{"AT90CAN128", 176, F_AVR8, {0x1E, 0x97, 0x81}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x1000, 3, 1, 37}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90PWM161", 177, F_AVR8, {0x1E, 0x94, 0x8B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 20}, // atdf, avr-gcc 12.2.0
{"AT90USB162", 178, F_AVR8, {0x1E, 0x94, 0x82}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 29}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90PWM216", 179, F_AVR8, {0x1E, 0x94, 0x83}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 32}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90PWM316", 180, F_AVR8, {0x1E, 0x94, 0x83}, 0, 0x04000, 0x080, 4, 0x0200, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 32}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90USB646", 181, F_AVR8, {0x1E, 0x96, 0x82}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 38}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90USB647", 182, F_AVR8, {0x1E, 0x96, 0x82}, 0, 0x10000, 0x100, 4, 0x0400, 0, 0x0800, 8, 0x0100, 0x1000, 3, 1, 38}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90S1200", 183, F_AVR8, {0x1E, 0x90, 0x01}, 0, 0x00400, 0x001, 0, 0, 0, 0x0040, 1, 0x0060, 0x0020, 1, 1, 4}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90USB1286", 184, F_AVR8, {0x1E, 0x97, 0x82}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x2000, 3, 1, 38}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90USB1287", 185, F_AVR8, {0x1E, 0x97, 0x82}, 0, 0x20000, 0x100, 4, 0x0400, 0, 0x1000, 8, 0x0100, 0x2000, 3, 1, 38}, // atdf, avr-gcc 12.2.0, avrdude
{"AT90S2313", 186, F_AVR8, {0x1E, 0x91, 0x01}, 0, 0x00800, 0x001, 0, 0, 0, 0x0080, 1, 0x0060, 0x0080, 1, 1, 11}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90S2323", 187, F_AVR8, {0x1E, 0x91, 0x02}, 0, 0x00800, -1, 0, 0, -1, -1, -1, 0x0060, 0x0080, 1, 1, 3}, // avr-gcc 12.2.0, boot size (manual)
{"AT90S2333", 188, F_AVR8, {0x1E, 0x91, 0x05}, 0, 0x00800, 0x001, 0, 0, 0, 0x0080, 1, 0x0060, 0x0080, -1, -1, 14}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90S2343", 189, F_AVR8, {0x1E, 0x91, 0x03}, 0, 0x00800, 0x001, 0, 0, 0, 0x0080, 1, 0x0060, 0x0080, 1, 1, 3}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90S4414", 190, F_AVR8, {0x1E, 0x92, 0x01}, 0, 0x01000, 0x001, 0, 0, 0, 0x0100, 1, 0x0060, 0x0100, 1, 1, 13}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90S4433", 191, F_AVR8, {0x1E, 0x92, 0x03}, 0, 0x01000, 0x001, 0, 0, 0, 0x0100, 1, 0x0060, 0x0080, 1, 1, 14}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90S4434", 192, F_AVR8, {0x1E, 0x92, 0x02}, 0, 0x01000, 0x001, 0, 0, 0, 0x0100, 1, 0x0060, 0x0100, 1, 1, 17}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90S8515", 193, F_AVR8, {0x1E, 0x93, 0x01}, 0, 0x02000, 0x001, 0, 0, 0, 0x0200, 1, 0x0060, 0x0200, 1, 1, 13}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT90C8534", 194, F_AVR8, {0xff, -1, -1}, 0, 0x02000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0100, -1, -1, 0}, // avr-gcc 12.2.0
{"AT90S8535", 195, F_AVR8, {0x1E, 0x93, 0x03}, 0, 0x02000, 0x001, 0, 0, 0, 0x0200, 1, 0x0060, 0x0200, 1, 1, 17}, // avr-gcc 12.2.0, avrdude, boot size (manual)
{"AT94K", 196, F_AVR8, {0xff, -1, -1}, 0, 0x08000, -1, -1, -1, -1, -1, -1, 0x0060, 0x0fa0, -1, -1, 0}, // avr-gcc 12.2.0
{"ATA5272", 197, F_AVR8, {0x1E, 0x93, 0x87}, 0, 0x02000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 37}, // atdf, avr-gcc 12.2.0
{"ATA5505", 198, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20}, // atdf, avr-gcc 12.2.0
{"ATA5700M322", 199, F_AVR8, {0x1E, 0x95, 0x67}, 0x08000, 0x08000, 0x040, 0, 0, 0, 0x0880, 16, 0x0200, 0x0400, 1, 1, 51}, // atdf
{"ATA5702M322", 200, F_AVR8, {0x1E, 0x95, 0x69}, 0x08000, 0x08000, 0x040, 0, 0, 0, 0x0880, 16, 0x0200, 0x0400, 1, 1, 51}, // atdf, avr-gcc 12.2.0
{"ATA5781", 201, F_AVR8, {0x1E, 0x95, 0x64}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf
{"ATA5782", 202, F_AVR8, {0x1E, 0x95, 0x65}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf, avr-gcc 12.2.0
{"ATA5783", 203, F_AVR8, {0x1E, 0x95, 0x66}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf
{"ATA5787", 204, F_AVR8, {0x1E, 0x94, 0x6C}, 0x08000, 0x05200, 0x040, 0, 0, 0, 0x0400, 16, 0x0200, 0x0800, 1, 1, 44}, // atdf
{"ATA5790", 205, F_AVR8, {0x1E, 0x94, 0x61}, 0, 0x04000, 0x080, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 30}, // atdf, avr-gcc 12.2.0
{"ATA5790N", 206, F_AVR8, {0x1E, 0x94, 0x62}, 0, 0x04000, 0x080, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 31}, // atdf, avr-gcc 12.2.0
{"ATA5791", 207, F_AVR8, {0x1E, 0x94, 0x62}, 0, 0x04000, 0x080, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 31}, // atdf, avr-gcc 7.3.0
{"ATA5795", 208, F_AVR8, {0x1E, 0x93, 0x61}, 0, 0x02000, 0x040, 1, 0x0800, 0, 0x0800, 16, 0x0100, 0x0200, 1, 1, 23}, // atdf, avr-gcc 12.2.0
{"ATA5831", 209, F_AVR8, {0x1E, 0x95, 0x61}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf, avr-gcc 12.2.0
{"ATA5832", 210, F_AVR8, {0x1E, 0x95, 0x62}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf
{"ATA5833", 211, F_AVR8, {0x1E, 0x95, 0x63}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf
{"ATA5835", 212, F_AVR8, {0x1E, 0x94, 0x6B}, 0x08000, 0x05200, 0x040, 0, 0, 0, 0x0400, 16, 0x0200, 0x0800, 1, 1, 44}, // atdf
{"ATA6285", 213, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0140, 4, 0x0100, 0x0200, 2, 1, 27}, // atdf, avr-gcc 12.2.0
{"ATA6286", 214, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0140, 4, 0x0100, 0x0200, 2, 1, 27}, // atdf, avr-gcc 12.2.0
{"ATA6289", 215, F_AVR8, {0x1E, 0x93, 0x82}, 0, 0x02000, 0x040, 4, 0x0100, -1, -1, -1, 0x0100, 0x0200, 2, 1, 27}, // avr-gcc 12.2.0, boot size (manual)
{"ATA6612C", 216, F_AVR8, {0x1E, 0x93, 0x0A}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0
{"ATA6613C", 217, F_AVR8, {0x1E, 0x94, 0x06}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // atdf, avr-gcc 12.2.0
{"ATA6614Q", 218, F_AVR8, {0x1E, 0x95, 0x0F}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26}, // atdf, avr-gcc 12.2.0
{"ATA6616C", 219, F_AVR8, {0x1E, 0x93, 0x87}, 0, 0x02000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20}, // atdf, avr-gcc 12.2.0
{"ATA6617C", 220, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20}, // atdf, avr-gcc 12.2.0
{"ATA8210", 221, F_AVR8, {0x1E, 0x95, 0x65}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf, avr-gcc 7.3.0
{"ATA8215", 222, F_AVR8, {0x1E, 0x95, 0x64}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf
{"ATA8510", 223, F_AVR8, {0x1E, 0x95, 0x61}, 0x08000, 0x05000, 0x040, 1, 0x5000, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf, avr-gcc 7.3.0
{"ATA8515", 224, F_AVR8, {0x1E, 0x95, 0x63}, -1, -1, -1, 0, 0, 0, 0x0400, 16, 0x0200, 0x0400, 1, 1, 42}, // atdf
{"ATA664251", 225, F_AVR8, {0x1E, 0x94, 0x87}, 0, 0x04000, 0x080, 0, 0, 0, 0x0200, 4, 0x0100, 0x0200, 3, 1, 20}, // atdf, avr-gcc 12.2.0
{"M3000", 226, F_AVR8, {0xff, -1, -1}, 0, 0x10000, -1, -1, -1, -1, -1, -1, 0x1000, 0x1000, -1, -1, 0}, // avr-gcc 12.2.0
{"LGT8F88P", 227, F_AVR8, {0x1E, 0x93, 0x0F}, 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // avrdude, from ATmega88
{"LGT8F168P", 228, F_AVR8, {0x1E, 0x94, 0x0B}, 0, 0x04000, 0x080, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0400, 3, 1, 26}, // avrdude, from ATmega168P
{"LGT8F328P", 229, F_AVR8, {0x1E, 0x95, 0x0F}, 0, 0x08000, 0x080, 4, 0x0200, 0, 0x0400, 4, 0x0100, 0x0800, 3, 1, 26}, // avrdude, from ATmega328P
{"ATxmega8E5", 230, F_XMEGA, {0x1E, 0x93, 0x41}, 0, 0x02800, 0x080, 1, 0x0800, 0, 0x0200, 32, 0x2000, 0x0400, 7, 1, 43}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega16A4", 231, F_XMEGA, {0x1E, 0x94, 0x41}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 94}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega16A4U", 232, F_XMEGA, {0x1E, 0x94, 0x41}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega16C4", 233, F_XMEGA, {0x1E, 0x94, 0x43}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega16D4", 234, F_XMEGA, {0x1E, 0x94, 0x42}, 0, 0x05000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x0800, 6, 1, 91}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega16E5", 235, F_XMEGA, {0x1E, 0x94, 0x45}, 0, 0x05000, 0x080, 1, 0x1000, 0, 0x0200, 32, 0x2000, 0x0800, 7, 1, 43}, // atdf, avr-gcc 7.3.0, avrdude
{"ATxmega32C3", 236, F_XMEGA, {0x1E, 0x95, 0x49}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 127}, // atdf, avr-gcc 12.2.0
{"ATxmega32D3", 237, F_XMEGA, {0x1E, 0x95, 0x4A}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 114}, // atdf, avr-gcc 12.2.0
{"ATxmega32A4", 238, F_XMEGA, {0x1E, 0x95, 0x41}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 94}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega32A4U", 239, F_XMEGA, {0x1E, 0x95, 0x41}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega32C4", 240, F_XMEGA, {0x1E, 0x95, 0x44}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega32D4", 241, F_XMEGA, {0x1E, 0x95, 0x42}, 0, 0x09000, 0x100, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 6, 1, 91}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega32E5", 242, F_XMEGA, {0x1E, 0x95, 0x4C}, 0, 0x09000, 0x080, 1, 0x1000, 0, 0x0400, 32, 0x2000, 0x1000, 7, 1, 43}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64A1", 243, F_XMEGA, {0x1E, 0x96, 0x4E}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 125}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64A1U", 244, F_XMEGA, {0x1E, 0x96, 0x4E}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64B1", 245, F_XMEGA, {0x1E, 0x96, 0x52}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 81}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64A3", 246, F_XMEGA, {0x1E, 0x96, 0x42}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 122}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64A3U", 247, F_XMEGA, {0x1E, 0x96, 0x42}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64B3", 248, F_XMEGA, {0x1E, 0x96, 0x51}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 54}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64C3", 249, F_XMEGA, {0x1E, 0x96, 0x49}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64D3", 250, F_XMEGA, {0x1E, 0x96, 0x4A}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 114}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64A4", 251, F_XMEGA, {0x1E, 0x96, 0x46}, 0, 0x11000, 0x100, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0}, // avrdude
{"ATxmega64A4U", 252, F_XMEGA, {0x1E, 0x96, 0x46}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega64D4", 253, F_XMEGA, {0x1E, 0x96, 0x47}, 0, 0x11000, 0x100, 1, 0x1000, 0, 0x0800, 32, 0x2000, 0x1000, 6, 1, 91}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128A1", 254, F_XMEGA, {0x1E, 0x97, 0x4C}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 125}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128A1revD", 255, F_XMEGA, {0x1E, 0x97, 0x41}, 0, 0x22000, 0x200, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0}, // avrdude
{"ATxmega128A1U", 256, F_XMEGA, {0x1E, 0x97, 0x4C}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128B1", 257, F_XMEGA, {0x1E, 0x97, 0x4D}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 81}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128A3", 258, F_XMEGA, {0x1E, 0x97, 0x42}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 122}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128A3U", 259, F_XMEGA, {0x1E, 0x97, 0x42}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128B3", 260, F_XMEGA, {0x1E, 0x97, 0x4B}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 54}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128C3", 261, F_XMEGA, {0x1E, 0x97, 0x52}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128D3", 262, F_XMEGA, {0x1E, 0x97, 0x48}, 0, 0x22000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 114}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128A4", 263, F_XMEGA, {0x1E, 0x97, 0x46}, 0, 0x22000, 0x200, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0}, // avrdude
{"ATxmega128A4U", 264, F_XMEGA, {0x1E, 0x97, 0x46}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega128D4", 265, F_XMEGA, {0x1E, 0x97, 0x47}, 0, 0x22000, 0x100, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x2000, 6, 1, 91}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega192A1", 266, F_XMEGA, {0x1E, 0x97, 0x4E}, 0, 0x32000, 0x200, -1, -1, 0, 0x0800, 32, -1, -1, -1, -1, 0}, // avrdude
{"ATxmega192A3", 267, F_XMEGA, {0x1E, 0x97, 0x44}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 122}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega192A3U", 268, F_XMEGA, {0x1E, 0x97, 0x44}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega192C3", 269, F_XMEGA, {0x1E, 0x97, 0x51}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega192D3", 270, F_XMEGA, {0x1E, 0x97, 0x49}, 0, 0x32000, 0x200, 1, 0x2000, 0, 0x0800, 32, 0x2000, 0x4000, 6, 1, 114}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega256A1", 271, F_XMEGA, {0x1E, 0x98, 0x46}, 0, 0x42000, 0x200, -1, -1, 0, 0x1000, 32, -1, -1, -1, -1, 0}, // avrdude
{"ATxmega256A3", 272, F_XMEGA, {0x1E, 0x98, 0x42}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 122}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega256A3B", 273, F_XMEGA, {0x1E, 0x98, 0x43}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 122}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega256A3BU", 274, F_XMEGA, {0x1E, 0x98, 0x43}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega256A3U", 275, F_XMEGA, {0x1E, 0x98, 0x42}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega256C3", 276, F_XMEGA, {0x1E, 0x98, 0x46}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega256D3", 277, F_XMEGA, {0x1E, 0x98, 0x44}, 0, 0x42000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x4000, 6, 1, 114}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega384C3", 278, F_XMEGA, {0x1E, 0x98, 0x45}, 0, 0x62000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x8000, 6, 1, 127}, // atdf, avr-gcc 12.2.0, avrdude
{"ATxmega384D3", 279, F_XMEGA, {0x1E, 0x98, 0x47}, 0, 0x62000, 0x200, 1, 0x2000, 0, 0x1000, 32, 0x2000, 0x8000, 6, 1, 114}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny202", 280, F_AVR8X, {0x1E, 0x91, 0x23}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny204", 281, F_AVR8X, {0x1E, 0x91, 0x22}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny212", 282, F_AVR8X, {0x1E, 0x91, 0x21}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny214", 283, F_AVR8X, {0x1E, 0x91, 0x20}, 0, 0x00800, 0x040, 1, 0, 0x01400, 0x0040, 32, 0x3f80, 0x0080, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny402", 284, F_AVR8X, {0x1E, 0x92, 0x27}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny404", 285, F_AVR8X, {0x1E, 0x92, 0x26}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny406", 286, F_AVR8X, {0x1E, 0x92, 0x25}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny412", 287, F_AVR8X, {0x1E, 0x92, 0x23}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny414", 288, F_AVR8X, {0x1E, 0x92, 0x22}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny416", 289, F_AVR8X, {0x1E, 0x92, 0x21}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny416auto", 290, F_AVR8X, {0x1E, 0x92, 0x28}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf
{"ATtiny417", 291, F_AVR8X, {0x1E, 0x92, 0x20}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3f00, 0x0100, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny424", 292, F_AVR8X, {0x1E, 0x92, 0x2C}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 30}, // atdf, avrdude
{"ATtiny426", 293, F_AVR8X, {0x1E, 0x92, 0x2B}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 30}, // atdf, avrdude
{"ATtiny427", 294, F_AVR8X, {0x1E, 0x92, 0x2A}, 0, 0x01000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 30}, // atdf, avrdude
{"ATtiny804", 295, F_AVR8X, {0x1E, 0x93, 0x25}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny806", 296, F_AVR8X, {0x1E, 0x93, 0x24}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny807", 297, F_AVR8X, {0x1E, 0x93, 0x23}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny814", 298, F_AVR8X, {0x1E, 0x93, 0x22}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny816", 299, F_AVR8X, {0x1E, 0x93, 0x21}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny817", 300, F_AVR8X, {0x1E, 0x93, 0x20}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3e00, 0x0200, 10, 1, 26}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny824", 301, F_AVR8X, {0x1E, 0x93, 0x29}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3c00, 0x0400, 10, 1, 30}, // atdf, avrdude
{"ATtiny826", 302, F_AVR8X, {0x1E, 0x93, 0x28}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3c00, 0x0400, 10, 1, 30}, // atdf, avrdude
{"ATtiny827", 303, F_AVR8X, {0x1E, 0x93, 0x27}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0080, 32, 0x3c00, 0x0400, 10, 1, 30}, // atdf, avrdude
{"ATtiny1604", 304, F_AVR8X, {0x1E, 0x94, 0x25}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1606", 305, F_AVR8X, {0x1E, 0x94, 0x24}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1607", 306, F_AVR8X, {0x1E, 0x94, 0x23}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1614", 307, F_AVR8X, {0x1E, 0x94, 0x22}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1616", 308, F_AVR8X, {0x1E, 0x94, 0x21}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1617", 309, F_AVR8X, {0x1E, 0x94, 0x20}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny1624", 310, F_AVR8X, {0x1E, 0x94, 0x2A}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 30}, // atdf, avrdude
{"ATtiny1626", 311, F_AVR8X, {0x1E, 0x94, 0x29}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 30}, // atdf, avrdude
{"ATtiny1627", 312, F_AVR8X, {0x1E, 0x94, 0x28}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 30}, // atdf, avrdude
{"ATtiny3214", 313, F_AVR8X, {0x1E, 0x95, 0x20}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3800, 0x0800, 10, 1, 31}, // avr-gcc 12.2.0
{"ATtiny3216", 314, F_AVR8X, {0x1E, 0x95, 0x21}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3800, 0x0800, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny3217", 315, F_AVR8X, {0x1E, 0x95, 0x22}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3800, 0x0800, 10, 1, 31}, // atdf, avr-gcc 12.2.0, avrdude
{"ATtiny3224", 316, F_AVR8X, {0x1E, 0x95, 0x28}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3400, 0x0c00, 10, 1, 30}, // atdf, avrdude
{"ATtiny3226", 317, F_AVR8X, {0x1E, 0x95, 0x27}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3400, 0x0c00, 10, 1, 30}, // atdf, avrdude
{"ATtiny3227", 318, F_AVR8X, {0x1E, 0x95, 0x26}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3400, 0x0c00, 10, 1, 30}, // atdf, avrdude
{"ATmega808", 319, F_AVR8X, {0x1E, 0x93, 0x26}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 36}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega809", 320, F_AVR8X, {0x1E, 0x93, 0x2A}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3c00, 0x0400, 10, 1, 40}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega1608", 321, F_AVR8X, {0x1E, 0x94, 0x27}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 36}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega1609", 322, F_AVR8X, {0x1E, 0x94, 0x26}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0100, 32, 0x3800, 0x0800, 10, 1, 40}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3208", 323, F_AVR8X, {0x1E, 0x95, 0x30}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3000, 0x1000, 10, 1, 36}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega3209", 324, F_AVR8X, {0x1E, 0x95, 0x31}, 0, 0x08000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x3000, 0x1000, 10, 1, 40}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega4808", 325, F_AVR8X, {0x1E, 0x96, 0x50}, 0, 0x0c000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x2800, 0x1800, 10, 1, 36}, // atdf, avr-gcc 12.2.0, avrdude
{"ATmega4809", 326, F_AVR8X, {0x1E, 0x96, 0x51}, 0, 0x0c000, 0x080, 1, 0, 0x01400, 0x0100, 64, 0x2800, 0x1800, 10, 1, 40}, // atdf, avr-gcc 12.2.0, avrdude
{"AVR8EA28", 327, F_AVR8X, {0x1E, 0x93, 0x2C}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR8EA32", 328, F_AVR8X, {0x1E, 0x93, 0x2B}, 0, 0x02000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR16DD14", 329, F_AVR8X, {0x1E, 0x94, 0x34}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36}, // atdf, avrdude
{"AVR16DD20", 330, F_AVR8X, {0x1E, 0x94, 0x33}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36}, // atdf, avrdude
{"AVR16DD28", 331, F_AVR8X, {0x1E, 0x94, 0x32}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36}, // atdf, avrdude
{"AVR16EA28", 332, F_AVR8X, {0x1E, 0x94, 0x37}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR16DD32", 333, F_AVR8X, {0x1E, 0x94, 0x31}, 0, 0x04000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7800, 0x0800, 16, 4, 36}, // atdf, avrdude
{"AVR16EA32", 334, F_AVR8X, {0x1E, 0x94, 0x36}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR16EA48", 335, F_AVR8X, {0x1E, 0x94, 0x35}, 0, 0x04000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR32DD14", 336, F_AVR8X, {0x1E, 0x95, 0x3B}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36}, // atdf, avrdude
{"AVR32DD20", 337, F_AVR8X, {0x1E, 0x95, 0x3A}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36}, // atdf, avrdude
{"AVR32DA28", 338, F_AVR8X, {0x1E, 0x95, 0x34}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 41}, // atdf, avrdude
{"AVR32DB28", 339, F_AVR8X, {0x1E, 0x95, 0x37}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 42}, // atdf, avrdude
{"AVR32DD28", 340, F_AVR8X, {0x1E, 0x95, 0x39}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36}, // atdf, avrdude
{"AVR32EA28", 341, F_AVR8X, {0x1E, 0x95, 0x3E}, 0, 0x08000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR32DA32", 342, F_AVR8X, {0x1E, 0x95, 0x33}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 44}, // atdf, avrdude
{"AVR32DB32", 343, F_AVR8X, {0x1E, 0x95, 0x36}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 44}, // atdf, avrdude
{"AVR32DD32", 344, F_AVR8X, {0x1E, 0x95, 0x38}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x7000, 0x1000, 16, 4, 36}, // atdf, avrdude
{"AVR32EA32", 345, F_AVR8X, {0x1E, 0x95, 0x3D}, 0, 0x08000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR32DA48", 346, F_AVR8X, {0x1E, 0x95, 0x32}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 58}, // atdf, avrdude
{"AVR32DB48", 347, F_AVR8X, {0x1E, 0x95, 0x35}, 0, 0x08000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x7000, 0x1000, 16, 4, 61}, // atdf, avrdude
{"AVR32EA48", 348, F_AVR8X, {0x1E, 0x95, 0x3C}, 0, 0x08000, 0x040, 1, 0, 0x01400, 0x0200, 8, -1, -1, -1, -1, 0}, // avrdude
{"AVR64DD14", 349, F_AVR8X, {0x1E, 0x96, 0x1D}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36}, // atdf, avrdude
{"AVR64DD20", 350, F_AVR8X, {0x1E, 0x96, 0x1C}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36}, // atdf, avrdude
{"AVR64DA28", 351, F_AVR8X, {0x1E, 0x96, 0x15}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 41}, // atdf, avrdude
{"AVR64DB28", 352, F_AVR8X, {0x1E, 0x96, 0x19}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 42}, // atdf, avrdude
{"AVR64DD28", 353, F_AVR8X, {0x1E, 0x96, 0x1B}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36}, // atdf, avrdude
{"AVR64EA28", 354, F_AVR8X, {0x1E, 0x96, 0x20}, 0, 0x10000, 0x080, 1, 0, 0x01400, 0x0200, 8, 0x6800, 0x1800, 16, 4, 37}, // atdf, avrdude
{"AVR64DA32", 355, F_AVR8X, {0x1E, 0x96, 0x14}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 44}, // atdf, avrdude
{"AVR64DB32", 356, F_AVR8X, {0x1E, 0x96, 0x18}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 44}, // atdf, avrdude
{"AVR64DD32", 357, F_AVR8X, {0x1E, 0x96, 0x1A}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0100, 1, 0x6000, 0x2000, 16, 4, 36}, // atdf, avrdude
{"AVR64EA32", 358, F_AVR8X, {0x1E, 0x96, 0x1F}, 0, 0x10000, 0x080, 1, 0, 0x01400, 0x0200, 8, 0x6800, 0x1800, 16, 4, 37}, // atdf, avrdude
{"AVR64DA48", 359, F_AVR8X, {0x1E, 0x96, 0x13}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 58}, // atdf, avrdude
{"AVR64DB48", 360, F_AVR8X, {0x1E, 0x96, 0x17}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 61}, // atdf, avrdude
{"AVR64EA48", 361, F_AVR8X, {0x1E, 0x96, 0x1E}, 0, 0x10000, 0x080, 1, 0, 0x01400, 0x0200, 8, 0x6800, 0x1800, 16, 4, 45}, // atdf, avrdude
{"AVR64DA64", 362, F_AVR8X, {0x1E, 0x96, 0x12}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 64}, // atdf, avrdude
{"AVR64DB64", 363, F_AVR8X, {0x1E, 0x96, 0x16}, 0, 0x10000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x6000, 0x2000, 16, 4, 65}, // atdf, avrdude
{"AVR128DA28", 364, F_AVR8X, {0x1E, 0x97, 0x0A}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 41}, // atdf, avrdude
{"AVR128DB28", 365, F_AVR8X, {0x1E, 0x97, 0x0E}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 42}, // atdf, avrdude
{"AVR128DA32", 366, F_AVR8X, {0x1E, 0x97, 0x09}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 44}, // atdf, avrdude
{"AVR128DB32", 367, F_AVR8X, {0x1E, 0x97, 0x0D}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 44}, // atdf, avrdude
{"AVR128DA48", 368, F_AVR8X, {0x1E, 0x97, 0x08}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 58}, // atdf, avrdude
{"AVR128DB48", 369, F_AVR8X, {0x1E, 0x97, 0x0C}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 61}, // atdf, avrdude
{"AVR128DA64", 370, F_AVR8X, {0x1E, 0x97, 0x07}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 64}, // atdf, avrdude
{"AVR128DB64", 371, F_AVR8X, {0x1E, 0x97, 0x0B}, 0, 0x20000, 0x200, 1, 0, 0x01400, 0x0200, 1, 0x4000, 0x4000, 16, 4, 65}, // atdf, avrdude
};
const size_t avr_isp_chip_arr_size = COUNT_OF(avr_isp_chip_arr);

View File

@@ -0,0 +1,33 @@
#pragma once
#include <furi_hal.h>
#define F_AVR8L 1 // TPI programming, ATtiny(4|5|9|10|20|40|102|104)
#define F_AVR8 2 // ISP programming with SPI, "classic" AVRs
#define F_XMEGA 4 // PDI programming, ATxmega family
#define F_AVR8X 8 // UPDI programming, newer 8-bit MCUs
struct AvrIspChipArr { // Value of -1 typically means unknown
const char* name; // Name of part
uint16_t mcuid; // ID of MCU in 0..2039
uint8_t avrarch; // F_AVR8L, F_AVR8, F_XMEGA or F_AVR8X
uint8_t sigs[3]; // Signature bytes
int32_t flashoffset; // Flash offset
int32_t flashsize; // Flash size
int16_t pagesize; // Flash page size
int8_t nboots; // Number of supported boot sectors
int16_t bootsize; // Size of (smallest) boot sector
int32_t eepromoffset; // EEPROM offset
int32_t eepromsize; // EEPROM size
int32_t eeprompagesize; // EEPROM page size
int32_t sramstart; // SRAM offset
int32_t sramsize; // SRAM size
int8_t nfuses; // Number of fuse bytes
int8_t nlocks; // Number of lock bytes
uint8_t ninterrupts; // Number of vectors in interrupt vector table
};
typedef struct AvrIspChipArr AvrIspChipArr;
extern const AvrIspChipArr avr_isp_chip_arr[];
extern const size_t avr_isp_chip_arr_size;

View File

@@ -0,0 +1,639 @@
#include "avr_isp_prog.h"
#include "avr_isp_prog_cmd.h"
#include <furi.h>
#define AVR_ISP_PROG_TX_RX_BUF_SIZE 320
#define TAG "AvrIspProg"
struct AvrIspProgSignature {
uint8_t vendor;
uint8_t part_family;
uint8_t part_number;
};
typedef struct AvrIspProgSignature AvrIspProgSignature;
struct AvrIspProgCfgDevice {
uint8_t devicecode;
uint8_t revision;
uint8_t progtype;
uint8_t parmode;
uint8_t polling;
uint8_t selftimed;
uint8_t lockbytes;
uint8_t fusebytes;
uint8_t flashpoll;
uint16_t eeprompoll;
uint16_t pagesize;
uint16_t eepromsize;
uint32_t flashsize;
};
typedef struct AvrIspProgCfgDevice AvrIspProgCfgDevice;
struct AvrIspProg {
AvrIspSpiSw* spi;
AvrIspProgCfgDevice* cfg;
FuriStreamBuffer* stream_rx;
FuriStreamBuffer* stream_tx;
uint16_t error;
uint16_t addr;
bool pmode;
bool exit;
bool rst_active_high;
uint8_t buff[AVR_ISP_PROG_TX_RX_BUF_SIZE];
AvrIspProgCallback callback;
void* context;
};
static void avr_isp_prog_end_pmode(AvrIspProg* instance);
AvrIspProg* avr_isp_prog_init(void) {
AvrIspProg* instance = malloc(sizeof(AvrIspProg));
instance->cfg = malloc(sizeof(AvrIspProgCfgDevice));
instance->stream_rx =
furi_stream_buffer_alloc(sizeof(int8_t) * AVR_ISP_PROG_TX_RX_BUF_SIZE, sizeof(int8_t));
instance->stream_tx =
furi_stream_buffer_alloc(sizeof(int8_t) * AVR_ISP_PROG_TX_RX_BUF_SIZE, sizeof(int8_t));
instance->rst_active_high = false;
instance->exit = false;
return instance;
}
void avr_isp_prog_free(AvrIspProg* instance) {
furi_assert(instance);
if(instance->spi) avr_isp_prog_end_pmode(instance);
furi_stream_buffer_free(instance->stream_tx);
furi_stream_buffer_free(instance->stream_rx);
free(instance->cfg);
free(instance);
}
size_t avr_isp_prog_spaces_rx(AvrIspProg* instance) {
return furi_stream_buffer_spaces_available(instance->stream_rx);
}
bool avr_isp_prog_rx(AvrIspProg* instance, uint8_t* data, size_t len) {
furi_assert(instance);
furi_assert(data);
furi_assert(len != 0);
size_t ret = furi_stream_buffer_send(instance->stream_rx, data, sizeof(uint8_t) * len, 0);
return ret == sizeof(uint8_t) * len;
}
size_t avr_isp_prog_tx(AvrIspProg* instance, uint8_t* data, size_t max_len) {
furi_assert(instance);
return furi_stream_buffer_receive(instance->stream_tx, data, sizeof(int8_t) * max_len, 0);
}
void avr_isp_prog_exit(AvrIspProg* instance) {
furi_assert(instance);
instance->exit = true;
}
void avr_isp_prog_set_tx_callback(AvrIspProg* instance, AvrIspProgCallback callback, void* context) {
furi_assert(instance);
furi_assert(context);
instance->callback = callback;
instance->context = context;
}
static void avr_isp_prog_tx_ch(AvrIspProg* instance, uint8_t data) {
furi_assert(instance);
furi_stream_buffer_send(instance->stream_tx, &data, sizeof(uint8_t), FuriWaitForever);
}
static uint8_t avr_isp_prog_getch(AvrIspProg* instance) {
furi_assert(instance);
uint8_t data[1] = {0};
while(furi_stream_buffer_receive(instance->stream_rx, &data, sizeof(int8_t), 30) == 0) {
if(instance->exit) break;
};
return data[0];
}
static void avr_isp_prog_fill(AvrIspProg* instance, size_t len) {
furi_assert(instance);
for(size_t x = 0; x < len; x++) {
instance->buff[x] = avr_isp_prog_getch(instance);
}
}
static void avr_isp_prog_reset_target(AvrIspProg* instance, bool reset) {
furi_assert(instance);
avr_isp_spi_sw_res_set(instance->spi, (reset == instance->rst_active_high) ? true : false);
}
static uint8_t avr_isp_prog_spi_transaction(
AvrIspProg* instance,
uint8_t cmd,
uint8_t addr_hi,
uint8_t addr_lo,
uint8_t data) {
furi_assert(instance);
avr_isp_spi_sw_txrx(instance->spi, cmd);
avr_isp_spi_sw_txrx(instance->spi, addr_hi);
avr_isp_spi_sw_txrx(instance->spi, addr_lo);
return avr_isp_spi_sw_txrx(instance->spi, data);
}
static void avr_isp_prog_empty_reply(AvrIspProg* instance) {
furi_assert(instance);
if(avr_isp_prog_getch(instance) == CRC_EOP) {
avr_isp_prog_tx_ch(instance, STK_INSYNC);
avr_isp_prog_tx_ch(instance, STK_OK);
} else {
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
}
}
static void avr_isp_prog_breply(AvrIspProg* instance, uint8_t data) {
furi_assert(instance);
if(avr_isp_prog_getch(instance) == CRC_EOP) {
avr_isp_prog_tx_ch(instance, STK_INSYNC);
avr_isp_prog_tx_ch(instance, data);
avr_isp_prog_tx_ch(instance, STK_OK);
} else {
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
}
}
static void avr_isp_prog_get_version(AvrIspProg* instance, uint8_t data) {
furi_assert(instance);
switch(data) {
case STK_HW_VER:
avr_isp_prog_breply(instance, AVR_ISP_HWVER);
break;
case STK_SW_MAJOR:
avr_isp_prog_breply(instance, AVR_ISP_SWMAJ);
break;
case STK_SW_MINOR:
avr_isp_prog_breply(instance, AVR_ISP_SWMIN);
break;
case AVP_ISP_CONNECT_TYPE:
avr_isp_prog_breply(instance, AVP_ISP_SERIAL_CONNECT_TYPE);
break;
default:
avr_isp_prog_breply(instance, AVR_ISP_RESP_0);
}
}
static void avr_isp_prog_set_cfg(AvrIspProg* instance) {
furi_assert(instance);
// call this after reading cfg packet into buff[]
instance->cfg->devicecode = instance->buff[0];
instance->cfg->revision = instance->buff[1];
instance->cfg->progtype = instance->buff[2];
instance->cfg->parmode = instance->buff[3];
instance->cfg->polling = instance->buff[4];
instance->cfg->selftimed = instance->buff[5];
instance->cfg->lockbytes = instance->buff[6];
instance->cfg->fusebytes = instance->buff[7];
instance->cfg->flashpoll = instance->buff[8];
// ignore (instance->buff[9] == instance->buff[8]) //FLASH polling value. Same as <20>flashpoll<6C>
instance->cfg->eeprompoll = instance->buff[10] << 8 | instance->buff[11];
instance->cfg->pagesize = instance->buff[12] << 8 | instance->buff[13];
instance->cfg->eepromsize = instance->buff[14] << 8 | instance->buff[15];
instance->cfg->flashsize = instance->buff[16] << 24 | instance->buff[17] << 16 |
instance->buff[18] << 8 | instance->buff[19];
// avr devices have active low reset, at89sx are active high
instance->rst_active_high = (instance->cfg->devicecode >= 0xe0);
}
static bool
avr_isp_prog_set_pmode(AvrIspProg* instance, uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
furi_assert(instance);
uint8_t res = 0;
avr_isp_spi_sw_txrx(instance->spi, a);
avr_isp_spi_sw_txrx(instance->spi, b);
res = avr_isp_spi_sw_txrx(instance->spi, c);
avr_isp_spi_sw_txrx(instance->spi, d);
return res == 0x53;
}
static void avr_isp_prog_end_pmode(AvrIspProg* instance) {
furi_assert(instance);
if(instance->pmode) {
avr_isp_prog_reset_target(instance, false);
// We're about to take the target out of reset
// so configure SPI pins as input
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
instance->spi = NULL;
}
instance->pmode = false;
}
static bool avr_isp_prog_start_pmode(AvrIspProg* instance, AvrIspSpiSwSpeed spi_speed) {
furi_assert(instance);
// Reset target before driving PIN_SCK or PIN_MOSI
// SPI.begin() will configure SS as output,
// so SPI master mode is selected.
// We have defined RESET as pin 10,
// which for many arduino's is not the SS pin.
// So we have to configure RESET as output here,
// (reset_target() first sets the correct level)
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
instance->spi = avr_isp_spi_sw_init(spi_speed);
avr_isp_prog_reset_target(instance, true);
// See avr datasheets, chapter "SERIAL_PRG Programming Algorithm":
// Pulse RESET after PIN_SCK is low:
avr_isp_spi_sw_sck_set(instance->spi, false);
// discharge PIN_SCK, value arbitrally chosen
furi_delay_ms(20);
avr_isp_prog_reset_target(instance, false);
// Pulse must be minimum 2 target CPU speed cycles
// so 100 usec is ok for CPU speeds above 20KHz
furi_delay_ms(1);
avr_isp_prog_reset_target(instance, true);
// Send the enable programming command:
// datasheet: must be > 20 msec
furi_delay_ms(50);
if(avr_isp_prog_set_pmode(instance, AVR_ISP_SET_PMODE)) {
instance->pmode = true;
return true;
}
return false;
}
static AvrIspProgSignature avr_isp_prog_check_signature(AvrIspProg* instance) {
furi_assert(instance);
AvrIspProgSignature signature;
signature.vendor = avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_VENDOR);
signature.part_family = avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_PART_FAMILY);
signature.part_number = avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_PART_NUMBER);
return signature;
}
static bool avr_isp_prog_auto_set_spi_speed_start_pmode(AvrIspProg* instance) {
AvrIspSpiSwSpeed spi_speed[] = {
AvrIspSpiSwSpeed1Mhz,
AvrIspSpiSwSpeed400Khz,
AvrIspSpiSwSpeed250Khz,
AvrIspSpiSwSpeed125Khz,
AvrIspSpiSwSpeed60Khz,
AvrIspSpiSwSpeed40Khz,
AvrIspSpiSwSpeed20Khz,
AvrIspSpiSwSpeed10Khz,
AvrIspSpiSwSpeed5Khz,
AvrIspSpiSwSpeed1Khz,
};
for(uint8_t i = 0; i < COUNT_OF(spi_speed); i++) {
if(avr_isp_prog_start_pmode(instance, spi_speed[i])) {
AvrIspProgSignature sig = avr_isp_prog_check_signature(instance);
AvrIspProgSignature sig_examination = avr_isp_prog_check_signature(instance); //-V656
uint8_t y = 0;
while(y < 8) {
if(memcmp(
(uint8_t*)&sig, (uint8_t*)&sig_examination, sizeof(AvrIspProgSignature)) !=
0)
break;
sig_examination = avr_isp_prog_check_signature(instance);
y++;
}
if(y == 8) {
if(spi_speed[i] > AvrIspSpiSwSpeed1Mhz) {
if(i < (COUNT_OF(spi_speed) - 1)) {
avr_isp_prog_end_pmode(instance);
i++;
return avr_isp_prog_start_pmode(instance, spi_speed[i]);
}
}
return true;
}
}
}
if(instance->spi) {
avr_isp_spi_sw_free(instance->spi);
instance->spi = NULL;
}
return false;
}
static void avr_isp_prog_universal(AvrIspProg* instance) {
furi_assert(instance);
uint8_t data;
avr_isp_prog_fill(instance, 4);
data = avr_isp_prog_spi_transaction(
instance, instance->buff[0], instance->buff[1], instance->buff[2], instance->buff[3]);
avr_isp_prog_breply(instance, data);
}
static void avr_isp_prog_commit(AvrIspProg* instance, uint16_t addr, uint8_t data) {
furi_assert(instance);
avr_isp_prog_spi_transaction(instance, AVR_ISP_COMMIT(addr));
/* polling flash */
if(data == 0xFF) {
furi_delay_ms(5);
} else {
/* polling flash */
uint32_t starttime = furi_get_tick();
while((furi_get_tick() - starttime) < 30) {
if(avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_FLASH_HI(addr)) != 0xFF) {
break;
};
}
}
}
static uint16_t avr_isp_prog_current_page(AvrIspProg* instance) {
furi_assert(instance);
uint16_t page = 0;
switch(instance->cfg->pagesize) {
case 32:
page = instance->addr & 0xFFFFFFF0;
break;
case 64:
page = instance->addr & 0xFFFFFFE0;
break;
case 128:
page = instance->addr & 0xFFFFFFC0;
break;
case 256:
page = instance->addr & 0xFFFFFF80;
break;
default:
page = instance->addr;
break;
}
return page;
}
static uint8_t avr_isp_prog_write_flash_pages(AvrIspProg* instance, size_t length) {
furi_assert(instance);
size_t x = 0;
uint16_t page = avr_isp_prog_current_page(instance);
while(x < length) {
if(page != avr_isp_prog_current_page(instance)) {
--x;
avr_isp_prog_commit(instance, page, instance->buff[x++]);
page = avr_isp_prog_current_page(instance);
}
avr_isp_prog_spi_transaction(
instance, AVR_ISP_WRITE_FLASH_LO(instance->addr, instance->buff[x++]));
avr_isp_prog_spi_transaction(
instance, AVR_ISP_WRITE_FLASH_HI(instance->addr, instance->buff[x++]));
instance->addr++;
}
avr_isp_prog_commit(instance, page, instance->buff[--x]);
return STK_OK;
}
static void avr_isp_prog_write_flash(AvrIspProg* instance, size_t length) {
furi_assert(instance);
avr_isp_prog_fill(instance, length);
if(avr_isp_prog_getch(instance) == CRC_EOP) {
avr_isp_prog_tx_ch(instance, STK_INSYNC);
avr_isp_prog_tx_ch(instance, avr_isp_prog_write_flash_pages(instance, length));
} else {
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
}
}
// write (length) bytes, (start) is a byte address
static uint8_t
avr_isp_prog_write_eeprom_chunk(AvrIspProg* instance, uint16_t start, uint16_t length) {
furi_assert(instance);
// this writes byte-by-byte,
// page writing may be faster (4 bytes at a time)
avr_isp_prog_fill(instance, length);
for(uint16_t x = 0; x < length; x++) {
uint16_t addr = start + x;
avr_isp_prog_spi_transaction(instance, AVR_ISP_WRITE_EEPROM(addr, instance->buff[x]));
furi_delay_ms(10);
}
return STK_OK;
}
static uint8_t avr_isp_prog_write_eeprom(AvrIspProg* instance, size_t length) {
furi_assert(instance);
// here is a word address, get the byte address
uint16_t start = instance->addr * 2;
uint16_t remaining = length;
if(length > instance->cfg->eepromsize) {
instance->error++;
return STK_FAILED;
}
while(remaining > AVR_ISP_EECHUNK) {
avr_isp_prog_write_eeprom_chunk(instance, start, AVR_ISP_EECHUNK);
start += AVR_ISP_EECHUNK;
remaining -= AVR_ISP_EECHUNK;
}
avr_isp_prog_write_eeprom_chunk(instance, start, remaining);
return STK_OK;
}
static void avr_isp_prog_program_page(AvrIspProg* instance) {
furi_assert(instance);
uint8_t result = STK_FAILED;
uint16_t length = avr_isp_prog_getch(instance) << 8 | avr_isp_prog_getch(instance);
uint8_t memtype = avr_isp_prog_getch(instance);
// flash memory @addr, (length) bytes
if(memtype == STK_SET_FLASH_TYPE) {
avr_isp_prog_write_flash(instance, length);
return;
}
if(memtype == STK_SET_EEPROM_TYPE) {
result = avr_isp_prog_write_eeprom(instance, length);
if(avr_isp_prog_getch(instance) == CRC_EOP) {
avr_isp_prog_tx_ch(instance, STK_INSYNC);
avr_isp_prog_tx_ch(instance, result);
} else {
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
}
return;
}
avr_isp_prog_tx_ch(instance, STK_FAILED);
return;
}
static uint8_t avr_isp_prog_flash_read_page(AvrIspProg* instance, uint16_t length) {
furi_assert(instance);
for(uint16_t x = 0; x < length; x += 2) {
avr_isp_prog_tx_ch(
instance,
avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_FLASH_LO(instance->addr)));
avr_isp_prog_tx_ch(
instance,
avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_FLASH_HI(instance->addr)));
instance->addr++;
}
return STK_OK;
}
static uint8_t avr_isp_prog_eeprom_read_page(AvrIspProg* instance, uint16_t length) {
furi_assert(instance);
// here again we have a word address
uint16_t start = instance->addr * 2;
for(uint16_t x = 0; x < length; x++) {
uint16_t addr = start + x;
avr_isp_prog_tx_ch(
instance, avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_EEPROM(addr)));
}
return STK_OK;
}
static void avr_isp_prog_read_page(AvrIspProg* instance) {
furi_assert(instance);
uint8_t result = STK_FAILED;
uint16_t length = avr_isp_prog_getch(instance) << 8 | avr_isp_prog_getch(instance);
uint8_t memtype = avr_isp_prog_getch(instance);
if(avr_isp_prog_getch(instance) != CRC_EOP) {
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
return;
}
avr_isp_prog_tx_ch(instance, STK_INSYNC);
if(memtype == STK_SET_FLASH_TYPE) result = avr_isp_prog_flash_read_page(instance, length);
if(memtype == STK_SET_EEPROM_TYPE) result = avr_isp_prog_eeprom_read_page(instance, length);
avr_isp_prog_tx_ch(instance, result);
}
static void avr_isp_prog_read_signature(AvrIspProg* instance) {
furi_assert(instance);
if(avr_isp_prog_getch(instance) != CRC_EOP) {
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
return;
}
avr_isp_prog_tx_ch(instance, STK_INSYNC);
avr_isp_prog_tx_ch(instance, avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_VENDOR));
avr_isp_prog_tx_ch(instance, avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_PART_FAMILY));
avr_isp_prog_tx_ch(instance, avr_isp_prog_spi_transaction(instance, AVR_ISP_READ_PART_NUMBER));
avr_isp_prog_tx_ch(instance, STK_OK);
}
void avr_isp_prog_avrisp(AvrIspProg* instance) {
furi_assert(instance);
uint8_t ch = avr_isp_prog_getch(instance);
switch(ch) {
case STK_GET_SYNC:
FURI_LOG_D(TAG, "cmd STK_GET_SYNC");
instance->error = 0;
avr_isp_prog_empty_reply(instance);
break;
case STK_GET_SIGN_ON:
FURI_LOG_D(TAG, "cmd STK_GET_SIGN_ON");
if(avr_isp_prog_getch(instance) == CRC_EOP) {
avr_isp_prog_tx_ch(instance, STK_INSYNC);
avr_isp_prog_tx_ch(instance, 'A');
avr_isp_prog_tx_ch(instance, 'V');
avr_isp_prog_tx_ch(instance, 'R');
avr_isp_prog_tx_ch(instance, ' ');
avr_isp_prog_tx_ch(instance, 'I');
avr_isp_prog_tx_ch(instance, 'S');
avr_isp_prog_tx_ch(instance, 'P');
avr_isp_prog_tx_ch(instance, STK_OK);
} else {
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
}
break;
case STK_GET_PARAMETER:
FURI_LOG_D(TAG, "cmd STK_GET_PARAMETER");
avr_isp_prog_get_version(instance, avr_isp_prog_getch(instance));
break;
case STK_SET_DEVICE:
FURI_LOG_D(TAG, "cmd STK_SET_DEVICE");
avr_isp_prog_fill(instance, 20);
avr_isp_prog_set_cfg(instance);
avr_isp_prog_empty_reply(instance);
break;
case STK_SET_DEVICE_EXT: // ignore for now
FURI_LOG_D(TAG, "cmd STK_SET_DEVICE_EXT");
avr_isp_prog_fill(instance, 5);
avr_isp_prog_empty_reply(instance);
break;
case STK_ENTER_PROGMODE:
FURI_LOG_D(TAG, "cmd STK_ENTER_PROGMODE");
if(!instance->pmode) avr_isp_prog_auto_set_spi_speed_start_pmode(instance);
avr_isp_prog_empty_reply(instance);
break;
case STK_LOAD_ADDRESS:
FURI_LOG_D(TAG, "cmd STK_LOAD_ADDRESS");
instance->addr = avr_isp_prog_getch(instance) | avr_isp_prog_getch(instance) << 8;
avr_isp_prog_empty_reply(instance);
break;
case STK_PROG_FLASH: // ignore for now
FURI_LOG_D(TAG, "cmd STK_PROG_FLASH");
avr_isp_prog_getch(instance);
avr_isp_prog_getch(instance);
avr_isp_prog_empty_reply(instance);
break;
case STK_PROG_DATA: // ignore for now
FURI_LOG_D(TAG, "cmd STK_PROG_DATA");
avr_isp_prog_getch(instance);
avr_isp_prog_empty_reply(instance);
break;
case STK_PROG_PAGE:
FURI_LOG_D(TAG, "cmd STK_PROG_PAGE");
avr_isp_prog_program_page(instance);
break;
case STK_READ_PAGE:
FURI_LOG_D(TAG, "cmd STK_READ_PAGE");
avr_isp_prog_read_page(instance);
break;
case STK_UNIVERSAL:
FURI_LOG_D(TAG, "cmd STK_UNIVERSAL");
avr_isp_prog_universal(instance);
break;
case STK_LEAVE_PROGMODE:
FURI_LOG_D(TAG, "cmd STK_LEAVE_PROGMODE");
instance->error = 0;
if(instance->pmode) avr_isp_prog_end_pmode(instance);
avr_isp_prog_empty_reply(instance);
break;
case STK_READ_SIGN:
FURI_LOG_D(TAG, "cmd STK_READ_SIGN");
avr_isp_prog_read_signature(instance);
break;
// expecting a command, not CRC_EOP
// this is how we can get back in sync
case CRC_EOP:
FURI_LOG_D(TAG, "cmd CRC_EOP");
instance->error++;
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
break;
// anything else we will return STK_UNKNOWN
default:
FURI_LOG_D(TAG, "cmd STK_ERROR_CMD");
instance->error++;
if(avr_isp_prog_getch(instance) == CRC_EOP)
avr_isp_prog_tx_ch(instance, STK_UNKNOWN);
else
avr_isp_prog_tx_ch(instance, STK_NOSYNC);
}
if(instance->callback) {
instance->callback(instance->context);
}
}

View File

@@ -0,0 +1,16 @@
#pragma once
#include "avr_isp_spi_sw.h"
#include <furi_hal.h>
typedef struct AvrIspProg AvrIspProg;
typedef void (*AvrIspProgCallback)(void* context);
AvrIspProg* avr_isp_prog_init(void);
void avr_isp_prog_free(AvrIspProg* instance);
size_t avr_isp_prog_spaces_rx(AvrIspProg* instance) ;
bool avr_isp_prog_rx(AvrIspProg* instance, uint8_t* data, size_t len);
size_t avr_isp_prog_tx(AvrIspProg* instance, uint8_t* data, size_t max_len);
void avr_isp_prog_avrisp(AvrIspProg* instance);
void avr_isp_prog_exit(AvrIspProg* instance);
void avr_isp_prog_set_tx_callback(AvrIspProg* instance, AvrIspProgCallback callback, void* context);

View File

@@ -0,0 +1,97 @@
#pragma once
// http://ww1.microchip.com/downloads/en/appnotes/atmel-0943-in-system-programming_applicationnote_avr910.pdf
// AVR ISP Definitions
#define AVR_ISP_HWVER 0X02
#define AVR_ISP_SWMAJ 0X01
#define AVR_ISP_SWMIN 0X12
#define AVP_ISP_SERIAL_CONNECT_TYPE 0X53
#define AVP_ISP_CONNECT_TYPE 0x93
#define AVR_ISP_RESP_0 0X00
#define AVR_ISP_SET_PMODE 0xAC, 0x53, 0x00, 0x00
#define AVR_ISP_READ_VENDOR 0x30, 0x00, 0x00, 0x00
#define AVR_ISP_READ_PART_FAMILY 0x30, 0x00, 0x01, 0x00
#define AVR_ISP_READ_PART_NUMBER 0x30, 0x00, 0x02, 0x00
#define AVR_ISP_ERASE_CHIP \
0xAC, 0x80, 0x00, 0x00 //Erase Chip, Wait N ms, Release RESET to end the erase.
//The only way to end a Chip Erase cycle is by temporarily releasing the Reset line
#define AVR_ISP_EXTENDED_ADDR(data) 0x4D, 0x00, data, 0x00
#define AVR_ISP_WRITE_FLASH_LO(add, data) 0x40, (add >> 8) & 0xFF, add & 0xFF, data
#define AVR_ISP_WRITE_FLASH_HI(add, data) 0x48, (add >> 8) & 0xFF, add & 0xFF, data
#define AVR_ISP_READ_FLASH_LO(add) 0x20, (add >> 8) & 0xFF, add & 0xFF, 0x00
#define AVR_ISP_READ_FLASH_HI(add) 0x28, (add >> 8) & 0xFF, add & 0xFF, 0x00
#define AVR_ISP_WRITE_EEPROM(add, data) \
0xC0, (add >> 8) & 0xFF, add & 0xFF, data //Send cmd, Wait N ms
#define AVR_ISP_READ_EEPROM(add) 0xA0, (add >> 8) & 0xFF, add & 0xFF, 0xFF
#define AVR_ISP_COMMIT(add) \
0x4C, (add >> 8) & 0xFF, add & 0xFF, 0x00 //Send cmd, polling read last addr page
#define AVR_ISP_OSCCAL(add) 0x38, 0x00, add, 0x00
#define AVR_ISP_WRITE_LOCK_BYTE(data) 0xAC, 0xE0, 0x00, data //Send cmd, Wait N ms
#define AVR_ISP_READ_LOCK_BYTE 0x58, 0x00, 0x00, 0x00
#define AVR_ISP_WRITE_FUSE_LOW(data) 0xAC, 0xA0, 0x00, data //Send cmd, Wait N ms
#define AVR_ISP_READ_FUSE_LOW 0x50, 0x00, 0x00, 0x00
#define AVR_ISP_WRITE_FUSE_HIGH(data) 0xAC, 0xA8, 0x00, data //Send cmd, Wait N ms
#define AVR_ISP_READ_FUSE_HIGH 0x58, 0x08, 0x00, 0x00
#define AVR_ISP_WRITE_FUSE_EXTENDED(data) 0xAC, 0xA4, 0x00, data //Send cmd, Wait N ms (~write)
#define AVR_ISP_READ_FUSE_EXTENDED 0x50, 0x08, 0x00, 0x00
#define AVR_ISP_EECHUNK 0x20
// https://www.microchip.com/content/dam/mchp/documents/OTH/ApplicationNotes/ApplicationNotes/doc2525.pdf
// STK Definitions
#define STK_OK 0x10
#define STK_FAILED 0x11
#define STK_UNKNOWN 0x12
#define STK_INSYNC 0x14
#define STK_NOSYNC 0x15
#define CRC_EOP 0x20
#define STK_GET_SYNC 0x30
#define STK_GET_SIGN_ON 0x31
#define STK_SET_PARAMETER 0x40
#define STK_GET_PARAMETER 0x41
#define STK_SET_DEVICE 0x42
#define STK_SET_DEVICE_EXT 0x45
#define STK_ENTER_PROGMODE 0x50
#define STK_LEAVE_PROGMODE 0x51
#define STK_CHIP_ERASE 0x52
#define STK_CHECK_AUTOINC 0x53
#define STK_LOAD_ADDRESS 0x55
#define STK_UNIVERSAL 0x56
#define STK_UNIVERSAL_MULTI 0x57
#define STK_PROG_FLASH 0x60
#define STK_PROG_DATA 0x61
#define STK_PROG_FUSE 0x62
#define STK_PROG_FUSE_EXT 0x65
#define STK_PROG_LOCK 0x63
#define STK_PROG_PAGE 0x64
#define STK_READ_FLASH 0x70
#define STK_READ_DATA 0x71
#define STK_READ_FUSE 0x72
#define STK_READ_LOCK 0x73
#define STK_READ_PAGE 0x74
#define STK_READ_SIGN 0x75
#define STK_READ_OSCCAL 0x76
#define STK_READ_FUSE_EXT 0x77
#define STK_READ_OSCCAL_EXT 0x78
#define STK_HW_VER 0x80
#define STK_SW_MAJOR 0x81
#define STK_SW_MINOR 0x82
#define STK_LEDS 0x83
#define STK_VTARGET 0x84
#define STK_VADJUST 0x85
#define STK_OSC_PSCALE 0x86
#define STK_OSC_CMATCH 0x87
#define STK_SCK_DURATION 0x89
#define STK_BUFSIZEL 0x90
#define STK_BUFSIZEH 0x91
#define STK_STK500_TOPCARD_DETECT 0x98
#define STK_SET_EEPROM_TYPE 0X45
#define STK_SET_FLASH_TYPE 0X46

View File

@@ -0,0 +1,71 @@
#include "avr_isp_spi_sw.h"
#include <furi.h>
#define AVR_ISP_SPI_SW_MISO &gpio_ext_pa6
#define AVR_ISP_SPI_SW_MOSI &gpio_ext_pa7
#define AVR_ISP_SPI_SW_SCK &gpio_ext_pb3
#define AVR_ISP_RESET &gpio_ext_pb2
struct AvrIspSpiSw {
AvrIspSpiSwSpeed speed_wait_time;
const GpioPin* miso;
const GpioPin* mosi;
const GpioPin* sck;
const GpioPin* res;
};
AvrIspSpiSw* avr_isp_spi_sw_init(AvrIspSpiSwSpeed speed) {
AvrIspSpiSw* instance = malloc(sizeof(AvrIspSpiSw));
instance->speed_wait_time = speed;
instance->miso = AVR_ISP_SPI_SW_MISO;
instance->mosi = AVR_ISP_SPI_SW_MOSI;
instance->sck = AVR_ISP_SPI_SW_SCK;
instance->res = AVR_ISP_RESET;
furi_hal_gpio_init(instance->miso, GpioModeInput, GpioPullNo, GpioSpeedVeryHigh);
furi_hal_gpio_write(instance->mosi, false);
furi_hal_gpio_init(instance->mosi, GpioModeOutputPushPull, GpioPullNo, GpioSpeedVeryHigh);
furi_hal_gpio_write(instance->sck, false);
furi_hal_gpio_init(instance->sck, GpioModeOutputPushPull, GpioPullNo, GpioSpeedVeryHigh);
furi_hal_gpio_init(instance->res, GpioModeOutputPushPull, GpioPullNo, GpioSpeedVeryHigh);
return instance;
}
void avr_isp_spi_sw_free(AvrIspSpiSw* instance) {
furi_assert(instance);
furi_hal_gpio_init(instance->res, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
furi_hal_gpio_init(instance->miso, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
furi_hal_gpio_init(instance->mosi, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
furi_hal_gpio_init(instance->sck, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
free(instance);
}
uint8_t avr_isp_spi_sw_txrx(AvrIspSpiSw* instance, uint8_t data) {
furi_assert(instance);
for(uint8_t i = 0; i < 8; ++i) {
furi_hal_gpio_write(instance->mosi, (data & 0x80) ? true : false);
furi_hal_gpio_write(instance->sck, true);
if(instance->speed_wait_time != AvrIspSpiSwSpeed1Mhz)
furi_delay_us(instance->speed_wait_time - 1);
data = (data << 1) | furi_hal_gpio_read(instance->miso); //-V792
furi_hal_gpio_write(instance->sck, false);
if(instance->speed_wait_time != AvrIspSpiSwSpeed1Mhz)
furi_delay_us(instance->speed_wait_time - 1);
}
return data;
}
void avr_isp_spi_sw_res_set(AvrIspSpiSw* instance, bool state) {
furi_assert(instance);
furi_hal_gpio_write(instance->res, state);
}
void avr_isp_spi_sw_sck_set(AvrIspSpiSw* instance, bool state) {
furi_assert(instance);
furi_hal_gpio_write(instance->sck, state);
}

View File

@@ -0,0 +1,24 @@
#pragma once
#include <furi_hal.h>
typedef enum {
AvrIspSpiSwSpeed1Mhz = 0,
AvrIspSpiSwSpeed400Khz = 1,
AvrIspSpiSwSpeed250Khz = 2,
AvrIspSpiSwSpeed125Khz = 4,
AvrIspSpiSwSpeed60Khz = 8,
AvrIspSpiSwSpeed40Khz = 12,
AvrIspSpiSwSpeed20Khz = 24,
AvrIspSpiSwSpeed10Khz = 48,
AvrIspSpiSwSpeed5Khz = 96,
AvrIspSpiSwSpeed1Khz = 480,
} AvrIspSpiSwSpeed;
typedef struct AvrIspSpiSw AvrIspSpiSw;
AvrIspSpiSw* avr_isp_spi_sw_init(AvrIspSpiSwSpeed speed);
void avr_isp_spi_sw_free(AvrIspSpiSw* instance);
uint8_t avr_isp_spi_sw_txrx(AvrIspSpiSw* instance, uint8_t data);
void avr_isp_spi_sw_res_set(AvrIspSpiSw* instance, bool state);
void avr_isp_spi_sw_sck_set(AvrIspSpiSw* instance, bool state);

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,30 @@
#include "../avr_isp_app_i.h"
// Generate scene on_enter handlers array
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
void (*const avr_isp_scene_on_enter_handlers[])(void*) = {
#include "avr_isp_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 avr_isp_scene_on_event_handlers[])(void* context, SceneManagerEvent event) = {
#include "avr_isp_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 avr_isp_scene_on_exit_handlers[])(void* context) = {
#include "avr_isp_scene_config.h"
};
#undef ADD_SCENE
// Initialize scene handlers configuration structure
const SceneManagerHandlers avr_isp_scene_handlers = {
.on_enter_handlers = avr_isp_scene_on_enter_handlers,
.on_event_handlers = avr_isp_scene_on_event_handlers,
.on_exit_handlers = avr_isp_scene_on_exit_handlers,
.scene_num = AvrIspSceneNum,
};

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) AvrIspScene##id,
typedef enum {
#include "avr_isp_scene_config.h"
AvrIspSceneNum,
} AvrIspScene;
#undef ADD_SCENE
extern const SceneManagerHandlers avr_isp_scene_handlers;
// Generate scene on_enter handlers declaration
#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
#include "avr_isp_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 "avr_isp_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 "avr_isp_scene_config.h"
#undef ADD_SCENE

View File

@@ -0,0 +1,99 @@
#include "../avr_isp_app_i.h"
#include "../helpers/avr_isp_types.h"
void avr_isp_scene_about_widget_callback(GuiButtonType result, InputType type, void* context) {
furi_assert(context);
AvrIspApp* app = context;
if(type == InputTypeShort) {
view_dispatcher_send_custom_event(app->view_dispatcher, result);
}
}
void avr_isp_scene_about_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
FuriString* temp_str = furi_string_alloc();
furi_string_printf(temp_str, "\e#%s\n", "Information");
furi_string_cat_printf(temp_str, "Version: %s\n", AVR_ISP_VERSION_APP);
furi_string_cat_printf(temp_str, "Developed by: %s\n", AVR_ISP_DEVELOPED);
furi_string_cat_printf(temp_str, "Github: %s\n\n", AVR_ISP_GITHUB);
furi_string_cat_printf(temp_str, "\e#%s\n", "Description");
furi_string_cat_printf(
temp_str,
"This application is an AVR in-system programmer based on stk500mk1. It is compatible with AVR-based"
" microcontrollers including Arduino. You can also use it to repair the chip if you accidentally"
" corrupt the bootloader.\n\n");
furi_string_cat_printf(temp_str, "\e#%s\n", "What it can do:");
furi_string_cat_printf(temp_str, "- Create a dump of your chip on an SD card\n");
furi_string_cat_printf(temp_str, "- Flash your chip firmware from the SD card\n");
furi_string_cat_printf(temp_str, "- Act as a wired USB ISP using avrdude software\n\n");
furi_string_cat_printf(temp_str, "\e#%s\n", "Supported chip series:");
furi_string_cat_printf(
temp_str,
"Example command for avrdude flashing: avrdude.exe -p m328p -c stk500v1 -P COMxx -U flash:r:"
"X:\\sketch_sample.hex"
":i\n");
furi_string_cat_printf(
temp_str,
"Where: "
"-p m328p"
" brand of your chip, "
"-P COMxx"
" com port number in the system when "
"ISP Programmer"
" is enabled\n\n");
furi_string_cat_printf(temp_str, "\e#%s\n", "Info");
furi_string_cat_printf(
temp_str,
"ATtinyXXXX\nATmegaXXXX\nAT43Uxxx\nAT76C711\nAT86RF401\nAT90xxxxx\nAT94K\n"
"ATAxxxxx\nATA664251\nM3000\nLGT8F88P\nLGT8F168P\nLGT8F328P\n");
furi_string_cat_printf(
temp_str, "For a more detailed list of supported chips, see AVRDude help\n");
widget_add_text_box_element(
app->widget,
0,
0,
128,
14,
AlignCenter,
AlignBottom,
"\e#\e! \e!\n",
false);
widget_add_text_box_element(
app->widget,
0,
2,
128,
14,
AlignCenter,
AlignBottom,
"\e#\e! ISP Programmer \e!\n",
false);
widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
furi_string_free(temp_str);
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewWidget);
}
bool avr_isp_scene_about_on_event(void* context, SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
return false;
}
void avr_isp_scene_about_on_exit(void* context) {
furi_assert(context);
AvrIspApp* app = context;
// Clear views
widget_reset(app->widget);
}

View File

@@ -0,0 +1,72 @@
#include "../avr_isp_app_i.h"
void avr_isp_scene_chip_detect_callback(AvrIspCustomEvent event, void* context) {
furi_assert(context);
AvrIspApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, event);
}
void avr_isp_scene_chip_detect_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
switch(app->error) {
case AvrIspErrorReading:
case AvrIspErrorWriting:
case AvrIspErrorWritingFuse:
avr_isp_chip_detect_set_state(
app->avr_isp_chip_detect_view, AvrIspChipDetectViewStateErrorOccured);
break;
case AvrIspErrorVerification:
avr_isp_chip_detect_set_state(
app->avr_isp_chip_detect_view, AvrIspChipDetectViewStateErrorVerification);
break;
default:
avr_isp_chip_detect_set_state(
app->avr_isp_chip_detect_view, AvrIspChipDetectViewStateNoDetect);
break;
}
app->error = AvrIspErrorNoError;
avr_isp_chip_detect_view_set_callback(
app->avr_isp_chip_detect_view, avr_isp_scene_chip_detect_callback, app);
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewChipDetect);
}
bool avr_isp_scene_chip_detect_on_event(void* context, SceneManagerEvent event) {
furi_assert(context);
AvrIspApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case AvrIspCustomEventSceneChipDetectOk:
if(scene_manager_get_scene_state(app->scene_manager, AvrIspSceneChipDetect) ==
AvrIspViewProgrammer) {
scene_manager_next_scene(app->scene_manager, AvrIspSceneProgrammer);
} else if(
scene_manager_get_scene_state(app->scene_manager, AvrIspSceneChipDetect) ==
AvrIspViewReader) {
scene_manager_next_scene(app->scene_manager, AvrIspSceneInputName);
} else if(
scene_manager_get_scene_state(app->scene_manager, AvrIspSceneChipDetect) ==
AvrIspViewWriter) {
scene_manager_next_scene(app->scene_manager, AvrIspSceneLoad);
}
consumed = true;
break;
default:
break;
}
} else if(event.type == SceneManagerEventTypeTick) {
}
return consumed;
}
void avr_isp_scene_chip_detect_on_exit(void* context) {
UNUSED(context);
}

View File

@@ -0,0 +1,10 @@
ADD_SCENE(avr_isp, start, Start)
ADD_SCENE(avr_isp, about, About)
ADD_SCENE(avr_isp, programmer, Programmer)
ADD_SCENE(avr_isp, reader, Reader)
ADD_SCENE(avr_isp, input_name, InputName)
ADD_SCENE(avr_isp, load, Load)
ADD_SCENE(avr_isp, writer, Writer)
ADD_SCENE(avr_isp, wiring, Wiring)
ADD_SCENE(avr_isp, chip_detect, ChipDetect)
ADD_SCENE(avr_isp, success, Success)

View File

@@ -0,0 +1,89 @@
#include "../avr_isp_app_i.h"
#include <gui/modules/validators.h>
#define MAX_TEXT_INPUT_LEN 22
void avr_isp_scene_input_name_text_callback(void* context) {
furi_assert(context);
AvrIspApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, AvrIspCustomEventSceneInputName);
}
void avr_isp_scene_input_name_get_timefilename(FuriString* name) {
FuriHalRtcDateTime datetime = {0};
furi_hal_rtc_get_datetime(&datetime);
furi_string_printf(
name,
"AVR_dump-%.4d%.2d%.2d-%.2d%.2d%.2d",
datetime.year,
datetime.month,
datetime.day,
datetime.hour,
datetime.minute,
datetime.second);
}
void avr_isp_scene_input_name_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
// Setup view
TextInput* text_input = app->text_input;
bool dev_name_empty = false;
FuriString* file_name = furi_string_alloc();
avr_isp_scene_input_name_get_timefilename(file_name);
furi_string_set(app->file_path, STORAGE_APP_DATA_PATH_PREFIX);
//highlighting the entire filename by default
dev_name_empty = true;
strncpy(app->file_name_tmp, furi_string_get_cstr(file_name), AVR_ISP_MAX_LEN_NAME);
text_input_set_header_text(text_input, "Name dump");
text_input_set_result_callback(
text_input,
avr_isp_scene_input_name_text_callback,
app,
app->file_name_tmp,
MAX_TEXT_INPUT_LEN, // buffer size
dev_name_empty);
ValidatorIsFile* validator_is_file =
validator_is_file_alloc_init(STORAGE_APP_DATA_PATH_PREFIX, AVR_ISP_APP_EXTENSION, "");
text_input_set_validator(text_input, validator_is_file_callback, validator_is_file);
furi_string_free(file_name);
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewTextInput);
}
bool avr_isp_scene_input_name_on_event(void* context, SceneManagerEvent event) {
furi_assert(context);
AvrIspApp* app = context;
if(event.type == SceneManagerEventTypeBack) {
scene_manager_previous_scene(app->scene_manager);
return true;
} else if(event.type == SceneManagerEventTypeCustom) {
if(event.event == AvrIspCustomEventSceneInputName) {
if(strcmp(app->file_name_tmp, "") != 0) {
scene_manager_next_scene(app->scene_manager, AvrIspSceneReader);
} else {
}
}
}
return false;
}
void avr_isp_scene_input_name_on_exit(void* context) {
furi_assert(context);
AvrIspApp* app = context;
// Clear validator
void* validator_context = text_input_get_validator_callback_context(app->text_input);
text_input_set_validator(app->text_input, NULL, NULL);
validator_is_file_free(validator_context);
// Clear view
text_input_reset(app->text_input);
}

View File

@@ -0,0 +1,22 @@
#include "../avr_isp_app_i.h"
void avr_isp_scene_load_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
if(avr_isp_load_from_file(app)) {
scene_manager_next_scene(app->scene_manager, AvrIspSceneWriter);
} else {
scene_manager_previous_scene(app->scene_manager);
}
}
bool avr_isp_scene_load_on_event(void* context, SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
return false;
}
void avr_isp_scene_load_on_exit(void* context) {
UNUSED(context);
}

View File

@@ -0,0 +1,28 @@
#include "../avr_isp_app_i.h"
void avr_isp_scene_programmer_callback(AvrIspCustomEvent event, void* context) {
furi_assert(context);
AvrIspApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, event);
}
void avr_isp_scene_programmer_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
avr_isp_programmer_view_set_callback(
app->avr_isp_programmer_view, avr_isp_scene_programmer_callback, app);
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewProgrammer);
}
bool avr_isp_scene_programmer_on_event(void* context, SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
return false;
}
void avr_isp_scene_programmer_on_exit(void* context) {
UNUSED(context);
}

View File

@@ -0,0 +1,64 @@
#include "../avr_isp_app_i.h"
void avr_isp_scene_reader_callback(AvrIspCustomEvent event, void* context) {
furi_assert(context);
AvrIspApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, event);
}
void avr_isp_scene_reader_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
avr_isp_reader_set_file_path(
app->avr_isp_reader_view, furi_string_get_cstr(app->file_path), app->file_name_tmp);
avr_isp_reader_view_set_callback(app->avr_isp_reader_view, avr_isp_scene_reader_callback, app);
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewReader);
}
bool avr_isp_scene_reader_on_event(void* context, SceneManagerEvent event) {
furi_assert(context);
AvrIspApp* app = context;
UNUSED(app);
bool consumed = false;
if(event.type == SceneManagerEventTypeBack) {
//do not handle exit on "Back"
consumed = true;
} else if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case AvrIspCustomEventSceneReadingOk:
scene_manager_next_scene(app->scene_manager, AvrIspSceneSuccess);
consumed = true;
break;
case AvrIspCustomEventSceneExit:
scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, AvrIspSceneChipDetect);
consumed = true;
break;
case AvrIspCustomEventSceneErrorVerification:
app->error = AvrIspErrorVerification;
scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, AvrIspSceneChipDetect);
consumed = true;
break;
case AvrIspCustomEventSceneErrorReading:
app->error = AvrIspErrorReading;
scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, AvrIspSceneChipDetect);
consumed = true;
break;
default:
break;
}
} else if(event.type == SceneManagerEventTypeTick) {
avr_isp_reader_update_progress(app->avr_isp_reader_view);
}
return consumed;
}
void avr_isp_scene_reader_on_exit(void* context) {
UNUSED(context);
}

View File

@@ -0,0 +1,75 @@
#include "../avr_isp_app_i.h"
void avr_isp_scene_start_submenu_callback(void* context, uint32_t index) {
furi_assert(context);
AvrIspApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, index);
}
void avr_isp_scene_start_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
Submenu* submenu = app->submenu;
submenu_add_item(
submenu, "Dump AVR", SubmenuIndexAvrIspReader, avr_isp_scene_start_submenu_callback, app);
submenu_add_item(
submenu, "Flash AVR", SubmenuIndexAvrIspWriter, avr_isp_scene_start_submenu_callback, app);
submenu_add_item(
submenu,
"ISP Programmer",
SubmenuIndexAvrIspProgrammer,
avr_isp_scene_start_submenu_callback,
app);
submenu_add_item(
submenu, "Wiring", SubmenuIndexAvrIsWiring, avr_isp_scene_start_submenu_callback, app);
submenu_add_item(
submenu, "About", SubmenuIndexAvrIspAbout, avr_isp_scene_start_submenu_callback, app);
submenu_set_selected_item(
submenu, scene_manager_get_scene_state(app->scene_manager, AvrIspSceneStart));
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewSubmenu);
}
bool avr_isp_scene_start_on_event(void* context, SceneManagerEvent event) {
furi_assert(context);
AvrIspApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SubmenuIndexAvrIspAbout) {
scene_manager_next_scene(app->scene_manager, AvrIspSceneAbout);
consumed = true;
} else if(event.event == SubmenuIndexAvrIspProgrammer) {
scene_manager_set_scene_state(
app->scene_manager, AvrIspSceneChipDetect, AvrIspViewProgrammer);
scene_manager_next_scene(app->scene_manager, AvrIspSceneChipDetect);
consumed = true;
} else if(event.event == SubmenuIndexAvrIspReader) {
scene_manager_set_scene_state(
app->scene_manager, AvrIspSceneChipDetect, AvrIspViewReader);
scene_manager_next_scene(app->scene_manager, AvrIspSceneChipDetect);
consumed = true;
} else if(event.event == SubmenuIndexAvrIspWriter) {
scene_manager_set_scene_state(
app->scene_manager, AvrIspSceneChipDetect, AvrIspViewWriter);
scene_manager_next_scene(app->scene_manager, AvrIspSceneChipDetect);
consumed = true;
} else if(event.event == SubmenuIndexAvrIsWiring) {
scene_manager_next_scene(app->scene_manager, AvrIspSceneWiring);
consumed = true;
}
scene_manager_set_scene_state(app->scene_manager, AvrIspSceneStart, event.event);
}
return consumed;
}
void avr_isp_scene_start_on_exit(void* context) {
furi_assert(context);
AvrIspApp* app = context;
submenu_reset(app->submenu);
}

View File

@@ -0,0 +1,44 @@
#include "../avr_isp_app_i.h"
void avr_isp_scene_success_popup_callback(void* context) {
furi_assert(context);
AvrIspApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, AvrIspCustomEventSceneSuccess);
}
void avr_isp_scene_success_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
Popup* popup = app->popup;
popup_set_icon(popup, 32, 5, &I_dolphin_nice_96x59);
popup_set_header(popup, "Success!", 8, 22, AlignLeft, AlignBottom);
popup_set_timeout(popup, 1500);
popup_set_context(popup, app);
popup_set_callback(popup, avr_isp_scene_success_popup_callback);
popup_enable_timeout(popup);
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewPopup);
}
bool avr_isp_scene_success_on_event(void* context, SceneManagerEvent event) {
furi_assert(context);
AvrIspApp* app = context;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == AvrIspCustomEventSceneSuccess) {
scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, AvrIspSceneStart);
return true;
}
}
return false;
}
void avr_isp_scene_success_on_exit(void* context) {
furi_assert(context);
AvrIspApp* app = context;
Popup* popup = app->popup;
popup_reset(popup);
}

View File

@@ -0,0 +1,21 @@
#include "../avr_isp_app_i.h"
void avr_isp_scene_wiring_on_enter(void* context) {
furi_assert(context);
AvrIspApp* app = context;
widget_add_icon_element(app->widget, 0, 0, &I_avr_wiring);
view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewWidget);
}
bool avr_isp_scene_wiring_on_event(void* context, SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
return false;
}
void avr_isp_scene_wiring_on_exit(void* context) {
furi_assert(context);
AvrIspApp* app = context;
widget_reset(app->widget);
}

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