Преглед изворни кода

add new apps and replace text viewer

MX пре 2 година
родитељ
комит
1bbc3ad3a9
42 измењених фајлова са 2526 додато и 392 уклоњено
  1. 113 110
      ReadMe.md
  2. 0 21
      base_pack/text_viewer/LICENSE
  3. 0 9
      base_pack/text_viewer/README.md
  4. 4 4
      base_pack/text_viewer/application.fam
  5. BIN
      base_pack/text_viewer/img/1.png
  6. BIN
      base_pack/text_viewer/img/2.png
  7. 30 0
      base_pack/text_viewer/scenes/text_viewer_scene.c
  8. 29 0
      base_pack/text_viewer/scenes/text_viewer_scene.h
  9. 1 0
      base_pack/text_viewer/scenes/text_viewer_scene_config.h
  10. 132 0
      base_pack/text_viewer/scenes/text_viewer_scene_show.c
  11. 45 248
      base_pack/text_viewer/text_viewer.c
  12. 26 0
      base_pack/text_viewer/text_viewer.h
  13. BIN
      base_pack/text_viewer/textviewerflipper.PNG
  14. 48 0
      non_catalog_apps/flipper_atomicdiceroller/README.md
  15. 13 0
      non_catalog_apps/flipper_atomicdiceroller/application.fam
  16. BIN
      non_catalog_apps/flipper_atomicdiceroller/atomicdiceroller.png
  17. 368 0
      non_catalog_apps/flipper_atomicdiceroller/flipper_atomicdiceroller.c
  18. 191 0
      non_catalog_apps/secret_toggle/.clang-format
  19. 13 0
      non_catalog_apps/secret_toggle/.editorconfig
  20. 1 0
      non_catalog_apps/secret_toggle/.gitignore
  21. 0 0
      non_catalog_apps/secret_toggle/.gitkeep
  22. 14 0
      non_catalog_apps/secret_toggle/.vscode/c_cpp_properties.json
  23. 2 0
      non_catalog_apps/secret_toggle/.vscode/compile_commands.json
  24. 19 0
      non_catalog_apps/secret_toggle/.vscode/extensions.json
  25. 103 0
      non_catalog_apps/secret_toggle/.vscode/launch.json
  26. 20 0
      non_catalog_apps/secret_toggle/.vscode/settings.json
  27. 66 0
      non_catalog_apps/secret_toggle/.vscode/tasks.json
  28. 674 0
      non_catalog_apps/secret_toggle/LICENSE
  29. 32 0
      non_catalog_apps/secret_toggle/README.md
  30. 18 0
      non_catalog_apps/secret_toggle/application.fam
  31. 0 0
      non_catalog_apps/secret_toggle/images/.gitkeep
  32. BIN
      non_catalog_apps/secret_toggle/screenshot.png
  33. 359 0
      non_catalog_apps/secret_toggle/secret_toggle.c
  34. BIN
      non_catalog_apps/secret_toggle/secret_toggle_icon.png
  35. 17 0
      non_catalog_apps/secret_toggle/util.c
  36. 17 0
      non_catalog_apps/secret_toggle/util.h
  37. 25 0
      non_catalog_apps/wire_tester/LICENSE
  38. 20 0
      non_catalog_apps/wire_tester/README.md
  39. 15 0
      non_catalog_apps/wire_tester/application.fam
  40. BIN
      non_catalog_apps/wire_tester/assets/background_128x64.png
  41. BIN
      non_catalog_apps/wire_tester/icon.png
  42. 111 0
      non_catalog_apps/wire_tester/wire_tester.c

+ 113 - 110
ReadMe.md

@@ -13,7 +13,7 @@ Apps contains changes needed to compile them on latest firmware, fixes has been
 
 
 The Flipper and its community wouldn't be as rich as it is without your contributions and support. Thank you for all you have done.
 The Flipper and its community wouldn't be as rich as it is without your contributions and support. Thank you for all you have done.
 
 
-### Apps checked & updated at `5 Aug 13:51 GMT +3`
+### Apps checked & updated at `13 Aug 04:40 GMT +3`
 
 
 
 
 # Default pack
 # Default pack
@@ -44,7 +44,7 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
 - Lightmeter [(by oleksiikutuzov)](https://github.com/oleksiikutuzov/flipperzero-lightmeter)
 - Lightmeter [(by oleksiikutuzov)](https://github.com/oleksiikutuzov/flipperzero-lightmeter)
 - HEX Viewer [(by QtRoS)](https://github.com/QtRoS/flipper-zero-hex-viewer)
 - HEX Viewer [(by QtRoS)](https://github.com/QtRoS/flipper-zero-hex-viewer)
 - POCSAG Pager [(by xMasterX & Shmuma)](https://github.com/xMasterX/flipper-pager)
 - POCSAG Pager [(by xMasterX & Shmuma)](https://github.com/xMasterX/flipper-pager)
-- Text Viewer [(by kowalski7cc & kyhwana)](https://github.com/kowalski7cc/flipper-zero-text-viewer/tree/refactor-text-app)
+- Text Viewer [(by Willy-JL)](https://github.com/Flipper-XFW/Xtreme-Firmware/tree/dev/applications/external/text_viewer) (original by kowalski7cc & kyhwana)
 - **UART Terminal** [(by cool4uma)](https://github.com/cool4uma/UART_Terminal/tree/main)
 - **UART Terminal** [(by cool4uma)](https://github.com/cool4uma/UART_Terminal/tree/main)
 - **ProtoView** [(by antirez)](https://github.com/antirez/protoview)
 - **ProtoView** [(by antirez)](https://github.com/antirez/protoview)
 - **SWD Probe** [(by g3gg0)](https://github.com/g3gg0/flipper-swd_probe)
 - **SWD Probe** [(by g3gg0)](https://github.com/g3gg0/flipper-swd_probe)
@@ -57,7 +57,7 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
 
 
 Games:
 Games:
 - DOOM (ported and fixed by @xMasterX & @Svarich & @hedger) [(original by p4nic4ttack)](https://github.com/p4nic4ttack/doom-flipper-zero/)
 - DOOM (ported and fixed by @xMasterX & @Svarich & @hedger) [(original by p4nic4ttack)](https://github.com/p4nic4ttack/doom-flipper-zero/)
-- Zombiez [(Reworked By DevMilanIan)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/240) [(Original By Dooskington)](https://github.com/Dooskington/flipperzero-zombiez)
+- Zombiez [(Reworked by DevMilanIan)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/240) [(Original by Dooskington)](https://github.com/Dooskington/flipperzero-zombiez)
 - Flappy Bird [(by DroomOne)](https://github.com/DroomOne/flipperzero-firmware/tree/dev/applications/flappy_bird)
 - Flappy Bird [(by DroomOne)](https://github.com/DroomOne/flipperzero-firmware/tree/dev/applications/flappy_bird)
 - Arkanoid (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
 - Arkanoid (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
 - Tic Tac Toe (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
 - Tic Tac Toe (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
@@ -74,131 +74,134 @@ Games:
 
 
 # Extra pack
 # Extra pack
 ## Bluetooth
 ## Bluetooth
-- [BT Camera Trigger (By Nem0oo)](https://github.com/Nem0oo/flipper-zero-bluetooth-trigger)
-- [BT Serial Example (By maybe-hello-world)](https://github.com/maybe-hello-world/fbs)
+- [BT Camera Trigger (by Nem0oo)](https://github.com/Nem0oo/flipper-zero-bluetooth-trigger)
+- [BT Serial Example (by maybe-hello-world)](https://github.com/maybe-hello-world/fbs)
 
 
 ## Games
 ## Games
-- [4 in row (By leo-need-more-coffee)](https://github.com/leo-need-more-coffee/flipperzero-4inrow)
-- [Asteroids (By antirez & SimplyMinimal)](https://github.com/antirez/flipper-asteroids) - Modified by [SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Asteroids) all changes can be found by clicking on [this link](https://github.com/SimplyMinimal/FlipperZero-Asteroids)
-- [Chess Clock (By ihatecsv)](https://github.com/ihatecsv/flipper_chess_clock)
-- [Chess (By xtruan)](https://github.com/xtruan/flipper-chess)
-- [Color Guess (By leedave)](https://github.com/leedave/Leeds-Flipper-Zero-Applications)
-- [Dice (By Ka3u6y6a)](https://github.com/Ka3u6y6a/flipper-zero-dice)
-- [DVD Bounce (By schaene)](https://github.com/schaene/Flipper-DVD-Bounce)
-- [Etch-A-Sketch (By SimplyMinimal)](https://github.com/SimplyMinimal/FlipperZero-Etch-A-Sketch)
-- [Pong (By nmrr)](https://github.com/nmrr/flipperzero-pong) - Modified by [SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Pong)
-- [Game of Life (Updated to work by tgxn) (By itsyourbedtime)](https://github.com/tgxn/flipperzero-firmware/blob/dev/applications/game_of_life/game_of_life.c)
-- [Mandelbrot Set (By Possibly-Matt)](https://github.com/Possibly-Matt/flipperzero-firmware-wPlugins)
-- [Monty Hall (By DevMilanIan)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/203)
-- [Nu Pogodi! (Ну, погоди!) (By sionyx)](https://github.com/sionyx/flipper_nupogodi)
-- [Paint (By n-o-T-I-n-s-a-n-e)](https://github.com/n-o-T-I-n-s-a-n-e)
-- [Race (By zyuhel)](https://github.com/zyuhel/flipperzero-racegame)
-- [Reaction test Game (By Milk-Cool)](https://github.com/Milk-Cool/fz-reaction-game)
-- [Reversi (By dimat)](https://github.com/dimat/flipperzero-reversi)
-- [Root of Life (By Xorboo)](https://github.com/Xorboo/root-of-life)
-- [Rubik's Cube Scrambler (By RaZeSloth)](https://github.com/RaZeSloth/flipperzero-rubiks-cube-scrambler)
-- [SUPER-CHIP (Chip8) Emulator (By Milk-Cool)](https://github.com/Milk-Cool/fz-schip) <- WIP, please report found issues [here](https://github.com/Milk-Cool/fz-schip/issues)
-- [Scorched Tanks (By jasniec)](https://github.com/jasniec/flipper-scorched-tanks-game)
-- [Simon Says (By SimplyMinimal)](https://github.com/SimplyMinimal/FlipperZero-SimonSays)
-- [Slots for Flipper Zero (By Daniel-dev-s)](https://github.com/Daniel-dev-s/flipperzero-slots)
-- [Snake 2.0 (By Willzvul)](https://github.com/Willzvul/Snake_2.0)
-- [T-rex game (By Rrycbarm)](https://github.com/Rrycbarm/t-rex-runner)
-- [TAMA P1 (By GMMan & DroomOne)](https://github.com/GMMan/flipperzero-tamagotch-p1) requires [this rom](https://tinyurl.com/tamap1) IN `tama_p1` folder on SD renamed as `rom.bin` to make it work. - Modified to allow saving game state by [DroomOne](https://github.com/DroomOne/flipperzero-tamagotch-p1) - Mute mode & settings by [Round-Pi](https://github.com/Round-Pi/flipperzero-tamagotch-p1)
-- [Tanks Game (By alexgr13)](https://github.com/alexgr13/flipperzero-firmware/tree/fork/dev/applications/tanks-game) - Fixes for latest subghz changes by @Sil333033
-- [Tic-Tac-Toe Multi (By RouNNdeL)](https://github.com/RouNNdeL/flipper-tictactoe-multi)
-- [Video Poker (By PixlEmly)](https://github.com/PixlEmly/flipperzero-firmware-testing/blob/420/applications/VideoPoker/poker.c)
-- [Yatzee (By emfleak)](https://github.com/emfleak/flipperzero-yatzee)
+- [4 in row (by leo-need-more-coffee)](https://github.com/leo-need-more-coffee/flipperzero-4inrow)
+- [Asteroids (by antirez & SimplyMinimal)](https://github.com/antirez/flipper-asteroids) - Modified by [SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Asteroids) all changes can be found by clicking on [this link](https://github.com/SimplyMinimal/FlipperZero-Asteroids)
+- [Chess Clock (by ihatecsv)](https://github.com/ihatecsv/flipper_chess_clock)
+- [Chess (by xtruan)](https://github.com/xtruan/flipper-chess)
+- [Color Guess (by leedave)](https://github.com/leedave/Leeds-Flipper-Zero-Applications)
+- [Dice (by Ka3u6y6a)](https://github.com/Ka3u6y6a/flipper-zero-dice)
+- [DVD Bounce (by schaene)](https://github.com/schaene/Flipper-DVD-Bounce)
+- [Etch-A-Sketch (by SimplyMinimal)](https://github.com/SimplyMinimal/FlipperZero-Etch-A-Sketch)
+- [Pong (by nmrr)](https://github.com/nmrr/flipperzero-pong) - Modified by [SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Pong)
+- [Game of Life (Updated to work by tgxn) (by itsyourbedtime)](https://github.com/tgxn/flipperzero-firmware/blob/dev/applications/game_of_life/game_of_life.c)
+- [Mandelbrot Set (by Possibly-Matt)](https://github.com/Possibly-Matt/flipperzero-firmware-wPlugins)
+- [Monty Hall (by DevMilanIan)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/203)
+- [Nu Pogodi! (Ну, погоди!) (by sionyx)](https://github.com/sionyx/flipper_nupogodi)
+- [Paint (by n-o-T-I-n-s-a-n-e)](https://github.com/n-o-T-I-n-s-a-n-e)
+- [Race (by zyuhel)](https://github.com/zyuhel/flipperzero-racegame)
+- [Reaction test Game (by Milk-Cool)](https://github.com/Milk-Cool/fz-reaction-game)
+- [Reversi (by dimat)](https://github.com/dimat/flipperzero-reversi)
+- [Root of Life (by Xorboo)](https://github.com/Xorboo/root-of-life)
+- [Rubik's Cube Scrambler (by RaZeSloth)](https://github.com/RaZeSloth/flipperzero-rubiks-cube-scrambler)
+- [SUPER-CHIP (Chip8) Emulator (by Milk-Cool)](https://github.com/Milk-Cool/fz-schip) <- WIP, please report found issues [here](https://github.com/Milk-Cool/fz-schip/issues)
+- [Scorched Tanks (by jasniec)](https://github.com/jasniec/flipper-scorched-tanks-game)
+- [Simon Says (by SimplyMinimal)](https://github.com/SimplyMinimal/FlipperZero-SimonSays)
+- [Slots for Flipper Zero (by Daniel-dev-s)](https://github.com/Daniel-dev-s/flipperzero-slots)
+- [Snake 2.0 (by Willzvul)](https://github.com/Willzvul/Snake_2.0)
+- [T-rex game (by Rrycbarm)](https://github.com/Rrycbarm/t-rex-runner)
+- [TAMA P1 (by GMMan & DroomOne)](https://github.com/GMMan/flipperzero-tamagotch-p1) requires [this rom](https://tinyurl.com/tamap1) IN `tama_p1` folder on SD renamed as `rom.bin` to make it work. - Modified to allow saving game state by [DroomOne](https://github.com/DroomOne/flipperzero-tamagotch-p1) - Mute mode & settings by [Round-Pi](https://github.com/Round-Pi/flipperzero-tamagotch-p1)
+- [Tanks Game (by alexgr13)](https://github.com/alexgr13/flipperzero-firmware/tree/fork/dev/applications/tanks-game) - Fixes for latest subghz changes by @Sil333033
+- [Tic-Tac-Toe Multi (by RouNNdeL)](https://github.com/RouNNdeL/flipper-tictactoe-multi)
+- [Video Poker (by PixlEmly)](https://github.com/PixlEmly/flipperzero-firmware-testing/blob/420/applications/VideoPoker/poker.c)
+- [Yatzee (by emfleak)](https://github.com/emfleak/flipperzero-yatzee)
+- [Secret Toggle (by nostrumuva)](https://github.com/nostrumuva/secret_toggle)
 
 
 ## GPIO
 ## GPIO
-- [Air Mouse (By ginkage)](https://github.com/ginkage/FlippAirMouse/)
-- [Plantower PMSx003 sensor reader (By 3cky)](https://github.com/3cky/flipperzero-airmon)
-- [Bar code scanner emulator via COM port (By polarikus)](https://github.com/polarikus/flipper-zero_bc_scanner_emulator)
-- [ESP32->Flipper Camera (By Z4urce)](https://github.com/Z4urce/flipperzero-camera)
-- [RC2014 ColecoVision (By ezod)](https://github.com/ezod/flipperzero-rc2014-coleco)
-- [ESP Flasher (By 0xchocolate)](https://github.com/0xchocolate/flipperzero-esp-flasher)
-- [ESP32-C6 Gravity terminal (By chris-bc)](https://github.com/chris-bc/Flipper-Gravity)
-- [IFTTT Virtual Button for ESP8266 (By Ferrazzi)](https://github.com/Ferrazzi/FlipperZero_IFTTT_Virtual_Button) - Fixes [(by Willy-JL)](https://github.com/ClaraCrazy/Flipper-Xtreme/commit/ae321fb5f4c616d3965546926b1b4b446eef8d86)
-- [Wifi Deauth v2 for ESP8266 (By Timmotools)](https://github.com/Timmotools/flipperzero_esp8266_deautherv2)
-- [Evil captive portal (By bigbrodude6119)](https://github.com/bigbrodude6119/flipper-zero-evil-portal) - WIP -> +2 new features [by leedave](https://github.com/leedave/flipper-zero-evil-portal/tree/leedave/ap_rename)
-- [Flashlight (By xMasterX)](https://github.com/xMasterX/flipper-flashlight)
-- [Pwnagotchi->Flipper interface (By Matt-London)](https://github.com/Matt-London/pwnagotchi-flipper)
-- [Geiger Counter (By nmrr)](https://github.com/nmrr/flipperzero-geigercounter) - works with external module!
-- [Oscilloscope (By anfractuosity)](https://github.com/anfractuosity/flipperscope) -> (Fixed furi_bus issues by @xMasterX)
-- [Control 7-segment display with Flipper Zero (By jamisonderek)](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio)
-- [GPIO Controller (By Lokno)](https://github.com/Lokno/gpio_controller) -> `A visual tool to control the general purpose pins of the Flipper Zero`
-- [GPIO Reader (By aureli1c)](https://github.com/aureli1c/flipperzero_GPIO_read)
-- [Timelapse (zeitraffer) (By theageoflove)](https://github.com/theageoflove/flipperzero-zeitraffer)
-- [GPIO Reader 2 (By biotinker)](https://github.com/biotinker/flipperzero-gpioreader)
-- [Logic analyzer (By g3gg0)](https://github.com/g3gg0/flipper-logic_analyzer) -> [How to use](https://github.com/g3gg0/flipper-logic_analyzer#readme)
-- [LORA Terminal (By aafksab)](https://github.com/aafksab/LORA-Term)
-- [MagSpoof (WIP) (By zacharyweiss)](https://github.com/zacharyweiss/magspoof_flipper) - Read mode [(by hummusec)](https://github.com/hummusec/magspoof_flipper) - + GPIO & Power fixes
-- [Mx2125 Dual-Axis Accelerometer (By jamisonderek)](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio)
-- [MH-Z19 - CO2 sensor (By meshchaninov)](https://github.com/meshchaninov/flipper-zero-mh-z19)
-- [NRF24 Batch Read/Send (WIP) (By vad7)](https://github.com/vad7/nRF24-Batch)
-- [NRF24 Scanner (By vad7)](https://github.com/vad7/nrf24scan)
-- [Pokemon Trading (for GameBoy) (By EstebanFuentealba)](https://github.com/EstebanFuentealba/Flipper-Zero-Game-Boy-Trading-Pokemons)
-- [Radiation Sensor (By sionyx)](https://github.com/sionyx/flipper_radsens) -> works with RadSens module
-- [RCWL-516 Motion Sensor (By ahmedafe1)](https://github.com/ahmedafe1/rcwl_0516-Flipperzero)
-- [ServoTester (By spin7ion)](https://github.com/spin7ion/flipper-servotester)
-- [ServoTester (2) (By mhasbini)](https://github.com/mhasbini/ServoTesterApp/tree/master)
-- [TAS playback (By rcombs)](https://github.com/rcombs/tas-playback) -> `This app plays back TAS files for retro video games. Connect the GPIO pins to the console's controller port and select a file to play back.`
-- [u-blox GPS (By liamhays)](https://github.com/liamhays/ublox)
-- [[USPING] Distance Sensor (By privet971)](https://github.com/privet971/FlipperZeroApps/tree/main/usping)
-- [Wiegand Reader (By jamisonderek)](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio)
-- [ESP32 Wifi Mapping (By carvilsi)](https://github.com/carvilsi/flipper0-wifi-map/tree/main)
-- [Wii EC Analyser (By csBlueChip)](https://github.com/csBlueChip/FlipperZero_WiiEC)
+- [Air Mouse (by ginkage)](https://github.com/ginkage/FlippAirMouse/)
+- [Plantower PMSx003 sensor reader (by 3cky)](https://github.com/3cky/flipperzero-airmon)
+- [Bar code scanner emulator via COM port (by polarikus)](https://github.com/polarikus/flipper-zero_bc_scanner_emulator)
+- [ESP32->Flipper Camera (by Z4urce)](https://github.com/Z4urce/flipperzero-camera)
+- [RC2014 ColecoVision (by ezod)](https://github.com/ezod/flipperzero-rc2014-coleco)
+- [ESP Flasher (by 0xchocolate)](https://github.com/0xchocolate/flipperzero-esp-flasher)
+- [ESP32-C6 Gravity terminal (by chris-bc)](https://github.com/chris-bc/Flipper-Gravity)
+- [IFTTT Virtual Button for ESP8266 (by Ferrazzi)](https://github.com/Ferrazzi/FlipperZero_IFTTT_Virtual_Button) - Fixes [(by Willy-JL)](https://github.com/ClaraCrazy/Flipper-Xtreme/commit/ae321fb5f4c616d3965546926b1b4b446eef8d86)
+- [Wifi Deauth v2 for ESP8266 (by Timmotools)](https://github.com/Timmotools/flipperzero_esp8266_deautherv2)
+- [Evil captive portal (by bigbrodude6119)](https://github.com/bigbrodude6119/flipper-zero-evil-portal) - WIP -> +2 new features [by leedave](https://github.com/leedave/flipper-zero-evil-portal/tree/leedave/ap_rename)
+- [Flashlight (by xMasterX)](https://github.com/xMasterX/flipper-flashlight)
+- [Pwnagotchi->Flipper interface (by Matt-London)](https://github.com/Matt-London/pwnagotchi-flipper)
+- [Geiger Counter (by nmrr)](https://github.com/nmrr/flipperzero-geigercounter) - works with external module!
+- [Oscilloscope (by anfractuosity)](https://github.com/anfractuosity/flipperscope) -> (Fixed furi_bus issues by @xMasterX)
+- [Control 7-segment display with Flipper Zero (by jamisonderek)](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio)
+- [GPIO Controller (by Lokno)](https://github.com/Lokno/gpio_controller) -> `A visual tool to control the general purpose pins of the Flipper Zero`
+- [GPIO Reader (by aureli1c)](https://github.com/aureli1c/flipperzero_GPIO_read)
+- [Timelapse (zeitraffer) (by theageoflove)](https://github.com/theageoflove/flipperzero-zeitraffer)
+- [GPIO Reader 2 (by biotinker)](https://github.com/biotinker/flipperzero-gpioreader)
+- [Logic analyzer (by g3gg0)](https://github.com/g3gg0/flipper-logic_analyzer) -> [How to use](https://github.com/g3gg0/flipper-logic_analyzer#readme)
+- [LORA Terminal (by aafksab)](https://github.com/aafksab/LORA-Term)
+- [MagSpoof (WIP) (by zacharyweiss)](https://github.com/zacharyweiss/magspoof_flipper) - Read mode [(by hummusec)](https://github.com/hummusec/magspoof_flipper) - + GPIO & Power fixes
+- [Mx2125 Dual-Axis Accelerometer (by jamisonderek)](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio)
+- [MH-Z19 - CO2 sensor (by meshchaninov)](https://github.com/meshchaninov/flipper-zero-mh-z19)
+- [NRF24 Batch Read/Send (WIP) (by vad7)](https://github.com/vad7/nRF24-Batch)
+- [NRF24 Scanner (by vad7)](https://github.com/vad7/nrf24scan)
+- [Pokemon Trading (for GameBoy) (by EstebanFuentealba)](https://github.com/EstebanFuentealba/Flipper-Zero-Game-Boy-Trading-Pokemons)
+- [Radiation Sensor (by sionyx)](https://github.com/sionyx/flipper_radsens) -> works with RadSens module
+- [RCWL-516 Motion Sensor (by ahmedafe1)](https://github.com/ahmedafe1/rcwl_0516-Flipperzero)
+- [ServoTester (by spin7ion)](https://github.com/spin7ion/flipper-servotester)
+- [ServoTester (2) (by mhasbini)](https://github.com/mhasbini/ServoTesterApp/tree/master)
+- [TAS playback (by rcombs)](https://github.com/rcombs/tas-playback) -> `This app plays back TAS files for retro video games. Connect the GPIO pins to the console's controller port and select a file to play back.`
+- [u-blox GPS (by liamhays)](https://github.com/liamhays/ublox)
+- [[USPING] Distance Sensor (by privet971)](https://github.com/privet971/FlipperZeroApps/tree/main/usping)
+- [Wiegand Reader (by jamisonderek)](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio)
+- [ESP32 Wifi Mapping (by carvilsi)](https://github.com/carvilsi/flipper0-wifi-map/tree/main)
+- [Wii EC Analyser (by csBlueChip)](https://github.com/csBlueChip/FlipperZero_WiiEC)
+- [Wire Tester (by unixispower)](https://gitlab.com/unixispower/flipper-wire-tester)
+- [Atomic Dice Roller (by nmrr)](https://github.com/nmrr/flipperzero-atomicdiceroller)
 
 
 ## Infrared
 ## Infrared
-- [IR Remote (By Hong5489)](https://github.com/Hong5489/ir_remote) - improvements [(By friebel)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/535) - Hold Option, RAW support [(By d4ve10)](https://github.com/d4ve10/ir_remote/tree/infrared_hold_option)
-- [IR Intervalometer for Sony Cameras (By Nitepone)](https://github.com/Nitepone/flipper-intervalometer)
-- [IR Xbox Controller (By gebeto)](https://github.com/gebeto/flipper-xbox-controller)
+- [IR Remote (by Hong5489)](https://github.com/Hong5489/ir_remote) - improvements [(by friebel)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/535) - Hold Option, RAW support [(by d4ve10)](https://github.com/d4ve10/ir_remote/tree/infrared_hold_option)
+- [IR Intervalometer for Sony Cameras (by Nitepone)](https://github.com/Nitepone/flipper-intervalometer)
+- [IR Xbox Controller (by gebeto)](https://github.com/gebeto/flipper-xbox-controller)
 
 
 ## Media
 ## Media
-- [BPM Tapper (By panki27)](https://github.com/panki27/bpm-tapper)
-- [Flizzer Tracker (By LTVA1)](https://github.com/LTVA1/flizzer_tracker)
-- [Music Beeper (By qqMajiKpp / Haseo)](https://github.com/qqmajikpp/)
-- [Ocarina (By invalidna-me)](https://github.com/invalidna-me/flipperzero-ocarina)
-- [Text 2 SAM (By Round-Pi)](https://github.com/Round-Pi/flipperzero-text2sam) - Fixes [(by Willy-JL)](https://github.com/ClaraCrazy/Flipper-Xtreme/commit/e688f81b53b0138d80de4b609daf1f9fca5be647)
-- [Tuning Fork (By besya)](https://github.com/besya/flipperzero-tuning-fork) - Fixes [(by Willy-JL)](https://github.com/ClaraCrazy/Flipper-Xtreme/commit/44023851f7349b6ae9ca9f9bd9228d795a7e04c0)
-- [USB Midi (By DrZlo13)](https://github.com/DrZlo13/flipper-zero-usb-midi)
-- [Video Player (By LTVA1)](https://github.com/LTVA1/flipper-zero-video-player) <- Follow link to download examples and learn how to convert videos
-- [Music Tracker (By DrZlo13)](https://github.com/DrZlo13/flipper-zero-music-tracker)
+- [BPM Tapper (by panki27)](https://github.com/panki27/bpm-tapper)
+- [Flizzer Tracker (by LTVA1)](https://github.com/LTVA1/flizzer_tracker)
+- [Music Beeper (by qqMajiKpp / Haseo)](https://github.com/qqmajikpp/)
+- [Ocarina (by invalidna-me)](https://github.com/invalidna-me/flipperzero-ocarina)
+- [Text 2 SAM (by Round-Pi)](https://github.com/Round-Pi/flipperzero-text2sam) - Fixes [(by Willy-JL)](https://github.com/ClaraCrazy/Flipper-Xtreme/commit/e688f81b53b0138d80de4b609daf1f9fca5be647)
+- [Tuning Fork (by besya)](https://github.com/besya/flipperzero-tuning-fork) - Fixes [(by Willy-JL)](https://github.com/ClaraCrazy/Flipper-Xtreme/commit/44023851f7349b6ae9ca9f9bd9228d795a7e04c0)
+- [USB Midi (by DrZlo13)](https://github.com/DrZlo13/flipper-zero-usb-midi)
+- [Video Player (by LTVA1)](https://github.com/LTVA1/flipper-zero-video-player) <- Follow link to download examples and learn how to convert videos
+- [Music Tracker (by DrZlo13)](https://github.com/DrZlo13/flipper-zero-music-tracker)
 
 
 ## NFC
 ## NFC
-- [Mifare Fuzzer (By spheeere98)](https://github.com/spheeere98/mifare_fuzzer) -> (+Fixed crash on exit)
-- [Seader (By bettse)](https://github.com/bettse/seader/tree/main) - `Interface with a SAM from the Flipper Zero over UART`
+- [Mifare Fuzzer (by spheeere98)](https://github.com/spheeere98/mifare_fuzzer) -> (+Fixed crash on exit)
+- [Seader (by bettse)](https://github.com/bettse/seader/tree/main) - `Interface with a SAM from the Flipper Zero over UART`
 
 
 ## RFID
 ## RFID
-- [RFID Beacon (By nmrr)](https://github.com/nmrr/flipperzero-rfidbeacon) - `A letter/number Morse beacon on 125 kHz`
-- [EM4100 universal keys generator (for RFID Fuzzer) (By Milk-Cool)](https://github.com/Milk-Cool/fz-em4100-generator)
+- [RFID Beacon (by nmrr)](https://github.com/nmrr/flipperzero-rfidbeacon) - `A letter/number Morse beacon on 125 kHz`
+- [EM4100 universal keys generator (for RFID Fuzzer) (by Milk-Cool)](https://github.com/Milk-Cool/fz-em4100-generator)
 
 
 ## Sub-GHz
 ## Sub-GHz
-- [Enhanced Sub-GHz Chat (By twisted-pear)](https://github.com/twisted-pear/esubghz_chat)
-- [TPMS Reader (By wosk)](https://github.com/wosk/flipperzero-tpms/tree/main)
+- [Enhanced Sub-GHz Chat (by twisted-pear)](https://github.com/twisted-pear/esubghz_chat)
+- [TPMS Reader (by wosk)](https://github.com/wosk/flipperzero-tpms/tree/main)
 
 
 ## Tools
 ## Tools
-- [Analog Clock (By scrolltex)](https://github.com/scrolltex/flipper_analog_clock)
-- [Brainfuck interpreter (By nymda)](https://github.com/nymda/FlipperZeroBrainfuck)
-- [Ceasar Cipher (By panki27)](https://github.com/panki27/caesar-cipher)
-- [Calculator (By n-o-T-I-n-s-a-n-e)](https://github.com/n-o-T-I-n-s-a-n-e)
-- [CLI-GUI Bridge (By ranchordo)](https://github.com/ranchordo/flipperzero-cli-bridge) -> (Fixed by @Willy-JL)
-- [Count Down Timer (By 0w0mewo)](https://github.com/0w0mewo/fpz_cntdown_timer)
-- [Counter (By Krulknul)](https://github.com/Krulknul/dolphin-counter)
-- [DCF77 Transmitter (By arha)](https://github.com/arha/flipper-dcf77)
-- [FlipBIP Crypto Tool (By xtruan)](https://github.com/xtruan/FlipBIP)
-- [Flipp Pomodoro Timer (By Th3Un1q3)](https://github.com/Th3Un1q3/flipp_pomodoro)
-- [Chronometer (By nmrr)](https://github.com/nmrr/flipperzero-chronometer)
-- [HEX Editor (By dunaevai135)](https://github.com/dunaevai135/flipper-zero-hex_editor)
-- [Multi Counter (By JadePossible)](https://github.com/JadePossible/Flipper-Multi-Counter)
-- [NightStand Clock (By nymda)](https://github.com/nymda/FlipperNightStand) - Fixes by [Willy-JL](https://github.com/Willy-JL)
-- [Password Generator (By anakod)](https://github.com/anakod/flipper_passgen) - Proper random by [henrygab](https://github.com/anakod/flipper_passgen/pull/6)
-- [Pomodoro Timer (By sbrin)](https://github.com/sbrin/flipperzero_pomodoro)
-- [QR Code (By bmatcuk)](https://github.com/bmatcuk/flipperzero-qrcode)
-- [Resistance calculator (By instantiator)](https://github.com/instantiator/flipper-zero-experimental-apps)
-- [VB Lab Migration Assistant (By GMMan (cyanic))](https://github.com/GMMan/flipperzero-vb-migrate)
+- [Analog Clock (by scrolltex)](https://github.com/scrolltex/flipper_analog_clock)
+- [Brainfuck interpreter (by nymda)](https://github.com/nymda/FlipperZeroBrainfuck)
+- [Ceasar Cipher (by panki27)](https://github.com/panki27/caesar-cipher)
+- [Calculator (by n-o-T-I-n-s-a-n-e)](https://github.com/n-o-T-I-n-s-a-n-e)
+- [CLI-GUI Bridge (by ranchordo)](https://github.com/ranchordo/flipperzero-cli-bridge) -> (Fixed by @Willy-JL)
+- [Count Down Timer (by 0w0mewo)](https://github.com/0w0mewo/fpz_cntdown_timer)
+- [Counter (by Krulknul)](https://github.com/Krulknul/dolphin-counter)
+- [DCF77 Transmitter (by arha)](https://github.com/arha/flipper-dcf77)
+- [FlipBIP Crypto Tool (by xtruan)](https://github.com/xtruan/FlipBIP)
+- [Flipp Pomodoro Timer (by Th3Un1q3)](https://github.com/Th3Un1q3/flipp_pomodoro)
+- [Chronometer (by nmrr)](https://github.com/nmrr/flipperzero-chronometer)
+- [HEX Editor (by dunaevai135)](https://github.com/dunaevai135/flipper-zero-hex_editor)
+- [Multi Counter (by JadePossible)](https://github.com/JadePossible/Flipper-Multi-Counter)
+- [NightStand Clock (by nymda)](https://github.com/nymda/FlipperNightStand) - Fixes by [Willy-JL](https://github.com/Willy-JL)
+- [Password Generator (by anakod)](https://github.com/anakod/flipper_passgen) - Proper random by [henrygab](https://github.com/anakod/flipper_passgen/pull/6)
+- [Pomodoro Timer (by sbrin)](https://github.com/sbrin/flipperzero_pomodoro)
+- [QR Code (by bmatcuk)](https://github.com/bmatcuk/flipperzero-qrcode)
+- [Resistance calculator (by instantiator)](https://github.com/instantiator/flipper-zero-experimental-apps)
+- [VB Lab Migration Assistant (by GMMan (cyanic))](https://github.com/GMMan/flipperzero-vb-migrate)
 
 
 ## USB
 ## USB
-- [USB HID Autofire (By pbek)](https://github.com/pbek/usb_hid_autofire)
+- [USB HID Autofire (by pbek)](https://github.com/pbek/usb_hid_autofire)
 
 
 --- 
 --- 
 
 

+ 0 - 21
base_pack/text_viewer/LICENSE

@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2022 Roman Shchekin
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 0 - 9
base_pack/text_viewer/README.md

@@ -1,9 +0,0 @@
-# flipper-zero-text-viewer
-
-Text Viewer application for Flipper Zero!
-
-A fork with a few changes from [QTRoS' hex viewer](https://github.com/QtRoS/flipper-zero-hex-viewer) to just display text without any hex byte representation
-
-![Text Viewer app!](https://github.com/kyhwana/flipper-zero-hex-viewer/blob/master/textviewerflipper.PNG?raw=true)
-
-[Link to FAP](https://github.com/kyhwana/latest_flipper_zero_apps/raw/main/text_viewer.fap)

+ 4 - 4
base_pack/text_viewer/application.fam

@@ -2,17 +2,17 @@ App(
     appid="text_viewer",
     appid="text_viewer",
     name="Text Viewer",
     name="Text Viewer",
     apptype=FlipperAppType.EXTERNAL,
     apptype=FlipperAppType.EXTERNAL,
-    entry_point="text_viewer_app",
+    entry_point="text_viewer",
     requires=[
     requires=[
         "gui",
         "gui",
         "dialogs",
         "dialogs",
     ],
     ],
-    stack_size=2 * 1024,
+    stack_size=10 * 1024,
     order=20,
     order=20,
     fap_icon="icons/text_10px.png",
     fap_icon="icons/text_10px.png",
     fap_category="Tools",
     fap_category="Tools",
     fap_icon_assets="icons",
     fap_icon_assets="icons",
-    fap_author="@kowalski7cc & @kyhwana",
-    fap_version="1.1",
+    fap_author="@Willy-JL",  # Original by @kowalski7cc & @kyhwana, new has code borrowed from archive > show
+    fap_version="1.0",
     fap_description="Text viewer application",
     fap_description="Text viewer application",
 )
 )

BIN
base_pack/text_viewer/img/1.png


BIN
base_pack/text_viewer/img/2.png


+ 30 - 0
base_pack/text_viewer/scenes/text_viewer_scene.c

@@ -0,0 +1,30 @@
+#include "text_viewer_scene.h"
+
+// Generate scene on_enter handlers array
+#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
+void (*const text_viewer_on_enter_handlers[])(void*) = {
+#include "text_viewer_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 text_viewer_on_event_handlers[])(void* context, SceneManagerEvent event) = {
+#include "text_viewer_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 text_viewer_on_exit_handlers[])(void* context) = {
+#include "text_viewer_scene_config.h"
+};
+#undef ADD_SCENE
+
+// Initialize scene handlers configuration structure
+const SceneManagerHandlers text_viewer_scene_handlers = {
+    .on_enter_handlers = text_viewer_on_enter_handlers,
+    .on_event_handlers = text_viewer_on_event_handlers,
+    .on_exit_handlers = text_viewer_on_exit_handlers,
+    .scene_num = TextViewerSceneNum,
+};

+ 29 - 0
base_pack/text_viewer/scenes/text_viewer_scene.h

@@ -0,0 +1,29 @@
+#pragma once
+
+#include <gui/scene_manager.h>
+
+// Generate scene id and total number
+#define ADD_SCENE(prefix, name, id) TextViewerScene##id,
+typedef enum {
+#include "text_viewer_scene_config.h"
+    TextViewerSceneNum,
+} TextViewerScene;
+#undef ADD_SCENE
+
+extern const SceneManagerHandlers text_viewer_scene_handlers;
+
+// Generate scene on_enter handlers declaration
+#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
+#include "text_viewer_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 "text_viewer_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 "text_viewer_scene_config.h"
+#undef ADD_SCENE

+ 1 - 0
base_pack/text_viewer/scenes/text_viewer_scene_config.h

@@ -0,0 +1 @@
+ADD_SCENE(text_viewer, show, Show)

+ 132 - 0
base_pack/text_viewer/scenes/text_viewer_scene_show.c

@@ -0,0 +1,132 @@
+#include "../text_viewer.h"
+
+#define SHOW_MAX_FILE_SIZE 8000
+
+void text_viewer_scene_show_widget_callback(GuiButtonType result, InputType type, void* context) {
+    furi_assert(context);
+    TextViewer* app = (TextViewer*)context;
+    if(type == InputTypeShort) {
+        view_dispatcher_send_custom_event(app->view_dispatcher, result);
+    }
+}
+
+static bool text_show_read_lines(File* file, FuriString* str_result) {
+    //furi_string_reset(str_result);
+    uint8_t buffer[SHOW_MAX_FILE_SIZE];
+
+    uint16_t read_count = storage_file_read(file, buffer, SHOW_MAX_FILE_SIZE);
+    if(storage_file_get_error(file) != FSE_OK) {
+        return false;
+    }
+
+    for(uint16_t i = 0; i < read_count; i++) {
+        furi_string_push_back(str_result, buffer[i]);
+    }
+
+    return true;
+}
+
+void text_viewer_scene_show_on_enter(void* context) {
+    furi_assert(context);
+    TextViewer* app = context;
+
+    FuriString* buffer;
+    buffer = furi_string_alloc();
+
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    File* file = storage_file_alloc(storage);
+
+    FileInfo fileinfo;
+    FS_Error error = storage_common_stat(storage, furi_string_get_cstr(app->path), &fileinfo);
+    if(error == FSE_OK) {
+        if((fileinfo.size < SHOW_MAX_FILE_SIZE) && (fileinfo.size > 2)) {
+            bool ok = storage_file_open(
+                file, furi_string_get_cstr(app->path), FSAM_READ, FSOM_OPEN_EXISTING);
+            if(ok) {
+                if(!text_show_read_lines(file, buffer)) {
+                    goto text_file_read_err;
+                }
+                if(!furi_string_size(buffer)) {
+                    goto text_file_read_err;
+                }
+
+                storage_file_seek(file, 0, true);
+
+                widget_add_text_scroll_element(
+                    app->widget, 0, 0, 128, 64, furi_string_get_cstr(buffer));
+
+            } else {
+            text_file_read_err:
+                widget_add_text_box_element(
+                    app->widget,
+                    0,
+                    0,
+                    128,
+                    64,
+                    AlignLeft,
+                    AlignCenter,
+                    "\e#Error:\nStorage file open error\e#",
+                    false);
+            }
+            storage_file_close(file);
+        } else if(fileinfo.size < 2) {
+            widget_add_text_box_element(
+                app->widget,
+                0,
+                0,
+                128,
+                64,
+                AlignLeft,
+                AlignCenter,
+                "\e#Error:\nFile is too small\e#",
+                false);
+        } else {
+            widget_add_text_box_element(
+                app->widget,
+                0,
+                0,
+                128,
+                64,
+                AlignLeft,
+                AlignCenter,
+                "\e#Error:\nFile is too large to show\e#",
+                false);
+        }
+    } else {
+        widget_add_text_box_element(
+            app->widget,
+            0,
+            0,
+            128,
+            64,
+            AlignLeft,
+            AlignCenter,
+            "\e#Error:\nFile system error\e#",
+            false);
+    }
+
+    furi_string_free(buffer);
+
+    storage_file_free(file);
+    furi_record_close(RECORD_STORAGE);
+
+    view_dispatcher_switch_to_view(app->view_dispatcher, TextViewerViewWidget);
+}
+
+bool text_viewer_scene_show_on_event(void* context, SceneManagerEvent event) {
+    furi_assert(context);
+    TextViewer* app = (TextViewer*)context;
+
+    if(event.type == SceneManagerEventTypeCustom) {
+        scene_manager_previous_scene(app->scene_manager);
+        return true;
+    }
+    return false;
+}
+
+void text_viewer_scene_show_on_exit(void* context) {
+    furi_assert(context);
+    TextViewer* app = (TextViewer*)context;
+
+    widget_reset(app->widget);
+}

+ 45 - 248
base_pack/text_viewer/text_viewer.c

@@ -1,287 +1,84 @@
-#include <furi.h>
-#include <furi_hal.h>
+#include "text_viewer.h"
 
 
-#include <text_viewer_icons.h>
-#include <gui/gui.h>
-#include <gui/elements.h>
-#include <dialogs/dialogs.h>
-
-#include <storage/storage.h>
-#include <stream/stream.h>
-#include <stream/buffered_file_stream.h>
-#include <toolbox/stream/file_stream.h>
-
-#define TAG "TextViewer"
-
-#define TEXT_VIEWER_APP_PATH_FOLDER ANY_PATH("")
-#define TEXT_VIEWER_APP_EXTENSION "*"
-
-#define TEXT_VIEWER_BYTES_PER_LINE 20u
-#define TEXT_VIEWER_LINES_ON_SCREEN 5u
-#define TEXT_VIEWER_BUF_SIZE (TEXT_VIEWER_LINES_ON_SCREEN * TEXT_VIEWER_BYTES_PER_LINE)
-
-typedef struct {
-    uint8_t file_bytes[TEXT_VIEWER_LINES_ON_SCREEN][TEXT_VIEWER_BYTES_PER_LINE];
-    uint32_t file_offset;
-    uint32_t file_read_bytes;
-    uint32_t file_size;
-    Stream* stream;
-    bool mode; // Print address or content
-} TextViewerModel;
-
-typedef struct {
-    TextViewerModel* model;
-    FuriMutex** mutex;
-
-    FuriMessageQueue* input_queue;
-
-    ViewPort* view_port;
-    Gui* gui;
-    Storage* storage;
-} TextViewer;
-
-static void render_callback(Canvas* canvas, void* ctx) {
-    TextViewer* text_viewer = ctx;
-    furi_check(furi_mutex_acquire(text_viewer->mutex, FuriWaitForever) == FuriStatusOk);
-
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-
-    //elements_button_left(canvas, text_viewer->model->mode ? "Addr" : "Text");
-    text_viewer->model->mode = 1; //text mode
-    //elements_button_right(canvas, "Info");
-
-    int ROW_HEIGHT = 12;
-    int TOP_OFFSET = 10;
-    int LEFT_OFFSET = 3;
-
-    uint32_t line_count = text_viewer->model->file_size / TEXT_VIEWER_BYTES_PER_LINE;
-    if(text_viewer->model->file_size % TEXT_VIEWER_BYTES_PER_LINE != 0) line_count += 1;
-    uint32_t first_line_on_screen = text_viewer->model->file_offset / TEXT_VIEWER_BYTES_PER_LINE;
-    if(line_count > TEXT_VIEWER_LINES_ON_SCREEN) {
-        uint8_t width = canvas_width(canvas);
-        elements_scrollbar_pos(
-            canvas,
-            width,
-            0,
-            ROW_HEIGHT * TEXT_VIEWER_LINES_ON_SCREEN,
-            first_line_on_screen, // TODO
-            line_count - (TEXT_VIEWER_LINES_ON_SCREEN - 1));
-    }
-
-    char temp_buf[32];
-    uint32_t row_iters = text_viewer->model->file_read_bytes / TEXT_VIEWER_BYTES_PER_LINE;
-    if(text_viewer->model->file_read_bytes % TEXT_VIEWER_BYTES_PER_LINE != 0) row_iters += 1;
-
-    for(uint32_t i = 0; i < row_iters; ++i) {
-        uint32_t bytes_left_per_row =
-            text_viewer->model->file_read_bytes - i * TEXT_VIEWER_BYTES_PER_LINE;
-        bytes_left_per_row = MIN(bytes_left_per_row, TEXT_VIEWER_BYTES_PER_LINE);
-
-        if(text_viewer->model->mode) {
-            memcpy(temp_buf, text_viewer->model->file_bytes[i], bytes_left_per_row);
-            temp_buf[bytes_left_per_row] = '\0';
-            for(uint32_t j = 0; j < bytes_left_per_row; ++j)
-                if(!isprint((int)temp_buf[j])) temp_buf[j] = ' ';
-
-            canvas_set_font(canvas, FontKeyboard);
-            canvas_draw_str(canvas, LEFT_OFFSET, TOP_OFFSET + i * ROW_HEIGHT, temp_buf);
-        } else {
-            uint32_t addr = text_viewer->model->file_offset + i * TEXT_VIEWER_BYTES_PER_LINE;
-            snprintf(temp_buf, 32, "%04lX", addr);
-
-            canvas_set_font(canvas, FontKeyboard);
-            canvas_draw_str(canvas, LEFT_OFFSET, TOP_OFFSET + i * ROW_HEIGHT, temp_buf);
-        }
-    }
-
-    furi_mutex_release(text_viewer->mutex);
-}
-
-static void input_callback(InputEvent* input_event, void* ctx) {
-    TextViewer* text_viewer = ctx;
-    if(input_event->type == InputTypeShort || input_event->type == InputTypeRepeat) {
-        furi_message_queue_put(text_viewer->input_queue, input_event, 0);
-    }
+static bool text_viewer_custom_event_callback(void* context, uint32_t event) {
+    furi_assert(context);
+    TextViewer* app = context;
+    return scene_manager_handle_custom_event(app->scene_manager, event);
 }
 }
 
 
-static TextViewer* text_viewer_alloc() {
-    TextViewer* instance = malloc(sizeof(TextViewer));
-
-    instance->model = malloc(sizeof(TextViewerModel));
-    memset(instance->model, 0x0, sizeof(TextViewerModel));
-
-    instance->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
-
-    instance->input_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
-
-    instance->view_port = view_port_alloc();
-    view_port_draw_callback_set(instance->view_port, render_callback, instance);
-    view_port_input_callback_set(instance->view_port, input_callback, instance);
-
-    instance->gui = furi_record_open(RECORD_GUI);
-    gui_add_view_port(instance->gui, instance->view_port, GuiLayerFullscreen);
-
-    instance->storage = furi_record_open(RECORD_STORAGE);
-
-    return instance;
+static bool text_viewer_back_event_callback(void* context) {
+    furi_assert(context);
+    TextViewer* app = context;
+    return scene_manager_handle_back_event(app->scene_manager);
 }
 }
 
 
-static void text_viewer_free(TextViewer* instance) {
-    furi_record_close(RECORD_STORAGE);
+TextViewer* text_viewer_alloc() {
+    TextViewer* app = malloc(sizeof(TextViewer));
+    app->gui = furi_record_open(RECORD_GUI);
 
 
-    gui_remove_view_port(instance->gui, instance->view_port);
-    furi_record_close(RECORD_GUI);
-    view_port_free(instance->view_port);
-
-    furi_message_queue_free(instance->input_queue);
+    app->view_dispatcher = view_dispatcher_alloc();
+    app->scene_manager = scene_manager_alloc(&text_viewer_scene_handlers, app);
+    view_dispatcher_enable_queue(app->view_dispatcher);
+    view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
 
 
-    furi_mutex_free(instance->mutex);
+    view_dispatcher_set_custom_event_callback(
+        app->view_dispatcher, text_viewer_custom_event_callback);
+    view_dispatcher_set_navigation_event_callback(
+        app->view_dispatcher, text_viewer_back_event_callback);
 
 
-    if(instance->model->stream) buffered_file_stream_close(instance->model->stream);
+    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
 
 
-    free(instance->model);
-    free(instance);
-}
+    app->widget = widget_alloc();
+    view_dispatcher_add_view(
+        app->view_dispatcher, TextViewerViewWidget, widget_get_view(app->widget));
 
 
-static bool text_viewer_open_file(TextViewer* text_viewer, const char* file_path) {
-    furi_assert(text_viewer);
-    furi_assert(file_path);
+    app->path = furi_string_alloc();
 
 
-    text_viewer->model->stream = buffered_file_stream_alloc(text_viewer->storage);
-    bool isOk = true;
-
-    do {
-        if(!buffered_file_stream_open(
-               text_viewer->model->stream, file_path, FSAM_READ, FSOM_OPEN_EXISTING)) {
-            FURI_LOG_E(TAG, "Unable to open stream: %s", file_path);
-            isOk = false;
-            break;
-        };
-
-        text_viewer->model->file_size = stream_size(text_viewer->model->stream);
-    } while(false);
-
-    return isOk;
+    return app;
 }
 }
 
 
-static bool text_viewer_read_file(TextViewer* text_viewer) {
-    furi_assert(text_viewer);
-    furi_assert(text_viewer->model->stream);
-    furi_assert(text_viewer->model->file_offset % TEXT_VIEWER_BYTES_PER_LINE == 0);
+void text_viewer_free(TextViewer* app) {
+    furi_assert(app);
 
 
-    memset(text_viewer->model->file_bytes, 0x0, TEXT_VIEWER_BUF_SIZE);
-    bool isOk = true;
+    view_dispatcher_remove_view(app->view_dispatcher, TextViewerViewWidget);
+    widget_free(app->widget);
 
 
-    do {
-        uint32_t offset = text_viewer->model->file_offset;
-        if(!stream_seek(text_viewer->model->stream, offset, true)) {
-            FURI_LOG_E(TAG, "Unable to seek stream");
-            isOk = false;
-            break;
-        }
+    view_dispatcher_free(app->view_dispatcher);
+    scene_manager_free(app->scene_manager);
 
 
-        text_viewer->model->file_read_bytes = stream_read(
-            text_viewer->model->stream,
-            (uint8_t*)text_viewer->model->file_bytes,
-            TEXT_VIEWER_BUF_SIZE);
-    } while(false);
+    furi_string_free(app->path);
 
 
-    return isOk;
+    furi_record_close(RECORD_GUI);
+    free(app);
 }
 }
 
 
-int32_t text_viewer_app(void* p) {
-    TextViewer* text_viewer = text_viewer_alloc();
-
-    FuriString* file_path;
-    file_path = furi_string_alloc();
+extern int32_t text_viewer(void* p) {
+    TextViewer* app = text_viewer_alloc();
 
 
     do {
     do {
         if(p && strlen(p)) {
         if(p && strlen(p)) {
-            furi_string_set(file_path, (const char*)p);
+            furi_string_set(app->path, (const char*)p);
         } else {
         } else {
-            furi_string_set(file_path, TEXT_VIEWER_APP_PATH_FOLDER);
+            furi_string_set(app->path, TEXT_VIEWER_PATH);
 
 
             DialogsFileBrowserOptions browser_options;
             DialogsFileBrowserOptions browser_options;
             dialog_file_browser_set_basic_options(
             dialog_file_browser_set_basic_options(
-                &browser_options, TEXT_VIEWER_APP_EXTENSION, &I_text_10px);
+                &browser_options, TEXT_VIEWER_EXTENSION, &I_text_10px);
             browser_options.hide_ext = false;
             browser_options.hide_ext = false;
 
 
             DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
             DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
-            bool res = dialog_file_browser_show(dialogs, file_path, file_path, &browser_options);
+            bool res = dialog_file_browser_show(dialogs, app->path, app->path, &browser_options);
 
 
             furi_record_close(RECORD_DIALOGS);
             furi_record_close(RECORD_DIALOGS);
             if(!res) {
             if(!res) {
-                FURI_LOG_I(TAG, "No file selected");
                 break;
                 break;
             }
             }
         }
         }
 
 
-        FURI_LOG_I(TAG, "File selected: %s", furi_string_get_cstr(file_path));
-
-        if(!text_viewer_open_file(text_viewer, furi_string_get_cstr(file_path))) break;
-        text_viewer_read_file(text_viewer);
-
-        InputEvent input;
-        while(1) {
-            if(furi_message_queue_get(text_viewer->input_queue, &input, 100) == FuriStatusOk) {
-                if(input.key == InputKeyBack) {
-                    break;
-                } else if(input.key == InputKeyUp) {
-                    furi_check(
-                        furi_mutex_acquire(text_viewer->mutex, FuriWaitForever) == FuriStatusOk);
-                    if(text_viewer->model->file_offset > 0) {
-                        text_viewer->model->file_offset -= TEXT_VIEWER_BYTES_PER_LINE;
-                        if(!text_viewer_read_file(text_viewer)) break;
-                    }
-                    furi_mutex_release(text_viewer->mutex);
-                } else if(input.key == InputKeyDown) {
-                    furi_check(
-                        furi_mutex_acquire(text_viewer->mutex, FuriWaitForever) == FuriStatusOk);
-                    uint32_t last_byte_on_screen =
-                        text_viewer->model->file_offset + text_viewer->model->file_read_bytes;
-
-                    if(text_viewer->model->file_size > last_byte_on_screen) {
-                        text_viewer->model->file_offset += TEXT_VIEWER_BYTES_PER_LINE;
-                        if(!text_viewer_read_file(text_viewer)) break;
-                    }
-                    furi_mutex_release(text_viewer->mutex);
-                } else if(input.key == InputKeyLeft) {
-                    furi_check(
-                        furi_mutex_acquire(text_viewer->mutex, FuriWaitForever) == FuriStatusOk);
-                    text_viewer->model->mode = !text_viewer->model->mode;
-                    furi_mutex_release(text_viewer->mutex);
-                } else if(input.key == InputKeyRight) {
-                    FuriString* buffer;
-                    buffer = furi_string_alloc();
-                    furi_string_printf(
-                        buffer,
-                        "File path: %s\nFile size: %lu (0x%lX)",
-                        furi_string_get_cstr(file_path),
-                        text_viewer->model->file_size,
-                        text_viewer->model->file_size);
-
-                    DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
-                    DialogMessage* message = dialog_message_alloc();
-                    dialog_message_set_header(
-                        message, "Text Viewer v1.1", 16, 2, AlignLeft, AlignTop);
-                    dialog_message_set_icon(message, &I_text_10px, 3, 2);
-                    dialog_message_set_text(
-                        message, furi_string_get_cstr(buffer), 3, 16, AlignLeft, AlignTop);
-                    dialog_message_set_buttons(message, NULL, NULL, "Back");
-                    dialog_message_show(dialogs, message);
-
-                    furi_string_free(buffer);
-                    dialog_message_free(message);
-                    furi_record_close(RECORD_DIALOGS);
-                }
-            }
-            view_port_update(text_viewer->view_port);
-        }
+        scene_manager_next_scene(app->scene_manager, TextViewerSceneShow);
+        view_dispatcher_run(app->view_dispatcher);
     } while(false);
     } while(false);
 
 
-    furi_string_free(file_path);
-    text_viewer_free(text_viewer);
-
+    text_viewer_free(app);
     return 0;
     return 0;
-}
+}

+ 26 - 0
base_pack/text_viewer/text_viewer.h

@@ -0,0 +1,26 @@
+#pragma once
+
+#include <gui/gui.h>
+#include <storage/storage.h>
+#include <dialogs/dialogs.h>
+#include <gui/view_dispatcher.h>
+#include <gui/scene_manager.h>
+#include <gui/modules/widget.h>
+#include "text_viewer_icons.h"
+#include "scenes/text_viewer_scene.h"
+
+#define TEXT_VIEWER_PATH STORAGE_EXT_PATH_PREFIX
+#define TEXT_VIEWER_EXTENSION "*"
+
+typedef struct {
+    Gui* gui;
+    SceneManager* scene_manager;
+    ViewDispatcher* view_dispatcher;
+    Widget* widget;
+
+    FuriString* path;
+} TextViewer;
+
+typedef enum {
+    TextViewerViewWidget,
+} TextViewerView;

BIN
base_pack/text_viewer/textviewerflipper.PNG


+ 48 - 0
non_catalog_apps/flipper_atomicdiceroller/README.md

@@ -0,0 +1,48 @@
+# flipperzero-atomicdiceroller
+🎲☢ An atomic dice roller for the Flipper Zero ☢🎲
+
+![banner](https://github.com/nmrr/flipperzero-atomicdiceroller/blob/main/img/banner.jpg)
+
+[**Geiger Counter**](https://github.com/nmrr/flipperzero-geigercounter) application must work on your **Flipper Zero** to be able to use this application. You need the same **geiger board** and this board must be connected in the same way as described in the description of the **Geiger Counter** application.
+
+**Note:** There is no test port compared to the **Geiger Counter** application, your absolutely need a **geiger board** to run this application.
+
+This application generates random numbers by hashing timestamps from a 64 MHz 32-bit time clock (TIM2) from the **MCU**. Two hash methods have been implemented:
+- CRC32: 8 ticks are needed to obtain a hash, for low activity sources
+- MD5: 32 ticks are needed to obtain a hash, for high activity source
+
+Dice rolls are produced by transforming hashes into 1 to 6 numbers. Output is balanced by ignoring out of scope values. Modulo-based methods are ugly because they are usually unbalanced.
+
+It's possible to roll the dice without using a **radioactive isotope**. Air contains **radon** gas that is **radioactive**. **Geiger board** can detect descendants of radon gas that emit strong **beta** or **gamma** rays.
+
+## Gallery
+
+<img src="https://github.com/nmrr/flipperzero-atomicdiceroller/blob/main/img/flipper2.png" width=25% height=25%> <img src="https://github.com/nmrr/flipperzero-atomicdiceroller/blob/main/img/flipper3.png" width=25% height=25%>
+
+In the left corner, **counts per second** (cps) indicates the activity. In the right corner, **availiable dice rolls** are indicated. 64 rolls can be stored.
+
+## Build the program
+
+Assuming the toolchain is already installed, copy **flipper_atomicdiceroller** directory to **applications_user**
+
+Plug your **Flipper Zero** and build the atomic dice roller:
+```
+./fbt launch_app APPSRC=applications_user/flipper_atomicdiceroller
+```
+
+The program will automatically be launched after compilation
+
+<img src="https://github.com/nmrr/flipperzero-atomicdiceroller/blob/main/img/flipper1.png" width=25% height=25%>
+
+**Button assignments**: 
+
+button  | function
+------------- | -------------
+**Ok** *[short short]*  | Roll the dice
+**Left** *[long press]* | Set CRC32 as hash method
+**Right** *[long press]* | Set MD5 as hash method
+**Back** *[long press]*  | Exit
+
+If you don't want to build this application, just simply copy **flipper_atomicdiceroller.fap** on your **Flipper Zero** 
+
+Build has been made with official toolchain, **API Mismatch** error may appear if you are using custom firmware. You can bypass this error but the program may crash.

+ 13 - 0
non_catalog_apps/flipper_atomicdiceroller/application.fam

@@ -0,0 +1,13 @@
+App(
+    appid="flipper_atomicdiceroller",
+    name="Atomic Dice Roller",
+    apptype=FlipperAppType.EXTERNAL,
+    entry_point="flipper_atomicdiceroller_app",
+    cdefines=["APP_ATOMICDICEROLLER"],
+    requires=[
+        "gui",
+    ],
+    stack_size=2 * 1024,
+    fap_icon="atomicdiceroller.png",
+    fap_category="GPIO",
+)

BIN
non_catalog_apps/flipper_atomicdiceroller/atomicdiceroller.png


+ 368 - 0
non_catalog_apps/flipper_atomicdiceroller/flipper_atomicdiceroller.c

@@ -0,0 +1,368 @@
+// CC0 1.0 Universal (CC0 1.0)
+// Public Domain Dedication
+// https://github.com/nmrr
+
+#include <stdio.h>
+#include <furi.h>
+#include <gui/gui.h>
+#include <input/input.h>
+#include <notification/notification_messages.h>
+#include <furi_hal_power.h>
+#include <locale/locale.h>
+#include <toolbox/crc32_calc.h>
+#include <lib/toolbox/md5.h>
+
+#define SCREEN_SIZE_X 128
+#define SCREEN_SIZE_Y 64
+
+typedef enum {
+    EventTypeInput,
+    ClockEventTypeTick,
+    ClockEventTypeTickPause,
+    EventGPIO,
+} EventType;
+
+typedef struct {
+    EventType type;
+    InputEvent input;
+} EventApp;
+
+#define lineArraySize 128
+
+typedef struct {
+    FuriMutex* mutex;
+    uint32_t cps;
+    uint32_t diceAvailiable;
+    uint8_t dice;
+    uint8_t method;
+    uint8_t pause;
+} mutexStruct;
+
+static void draw_callback(Canvas* canvas, void* ctx) 
+{
+    mutexStruct* mutexVal = ctx;
+    mutexStruct mutexDraw;
+    furi_mutex_acquire(mutexVal->mutex, FuriWaitForever);
+    memcpy(&mutexDraw, mutexVal, sizeof(mutexStruct));
+    furi_mutex_release(mutexVal->mutex);
+
+    canvas_set_font(canvas, FontPrimary);
+    char buffer[32];
+    snprintf(buffer, sizeof(buffer), "%ld cps", mutexDraw.cps);
+    canvas_draw_str_aligned(canvas, 0, 10, AlignLeft, AlignBottom, buffer);
+
+    snprintf(buffer, sizeof(buffer), "%lu/64", mutexDraw.diceAvailiable);
+    canvas_draw_str_aligned(canvas, SCREEN_SIZE_X, 10, AlignRight, AlignBottom, buffer);
+
+    if (mutexDraw.method == 0) canvas_draw_str_aligned(canvas, 0, 20, AlignLeft, AlignBottom, "Hash: CRC32");
+    else canvas_draw_str_aligned(canvas, 0, 20, AlignLeft, AlignBottom, "Hash: MD5");
+
+    if (mutexDraw.dice != 0 && mutexDraw.pause == 0)
+    {
+        canvas_set_font(canvas, FontBigNumbers);
+        snprintf(buffer, sizeof(buffer), "%u", mutexDraw.dice);
+        canvas_draw_str_aligned(canvas, SCREEN_SIZE_X/2, 50, AlignCenter, AlignBottom, buffer);
+    }
+}
+
+static void input_callback(InputEvent* input_event, void* ctx) 
+{
+    furi_assert(ctx);
+    FuriMessageQueue* event_queue = ctx;
+    EventApp event = {.type = EventTypeInput, .input = *input_event};
+    furi_message_queue_put(event_queue, &event, FuriWaitForever);
+}
+
+static void clock_tick(void* ctx) {
+    furi_assert(ctx);
+
+    FuriMessageQueue* queue = ctx;
+    EventApp event = {.type = ClockEventTypeTick};
+    furi_message_queue_put(queue, &event, 0);
+}
+
+static void clock_tick_pause(void* ctx) {
+    furi_assert(ctx);
+
+    FuriMessageQueue* queue = ctx;
+    EventApp event = {.type = ClockEventTypeTickPause};
+    furi_message_queue_put(queue, &event, 0);
+}
+
+static void gpiocallback(void* ctx) {
+    furi_assert(ctx);
+    FuriMessageQueue* queue = ctx;
+    EventApp event = {.type = EventGPIO};
+    furi_message_queue_put(queue, &event, 0);
+}
+
+int32_t flipper_atomicdiceroller_app() 
+{
+    furi_hal_bus_enable(FuriHalBusTIM2);
+    LL_TIM_SetCounterMode(TIM2, LL_TIM_COUNTERMODE_UP);
+    LL_TIM_SetClockDivision(TIM2, LL_TIM_CLOCKDIVISION_DIV1);
+    LL_TIM_SetPrescaler(TIM2, 0);
+    LL_TIM_SetAutoReload(TIM2, 0xFFFFFFFF);
+    LL_TIM_SetCounter(TIM2, 0);
+    LL_TIM_EnableCounter(TIM2);
+
+    EventApp event;
+    FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(EventApp));
+
+    furi_hal_gpio_init(&gpio_ext_pa7, GpioModeInterruptFall, GpioPullUp, GpioSpeedVeryHigh);
+
+    mutexStruct mutexVal;
+    mutexVal.cps = 0;
+    mutexVal.dice = 0;
+    mutexVal.diceAvailiable = 0;
+    mutexVal.method = 0;
+    uint32_t counter = 0;
+
+    mutexVal.mutex= furi_mutex_alloc(FuriMutexTypeNormal);
+    if(!mutexVal.mutex) {
+        furi_message_queue_free(event_queue);
+        return 255;
+    }
+
+    ViewPort* view_port = view_port_alloc();
+    view_port_draw_callback_set(view_port, draw_callback, &mutexVal.mutex);
+    view_port_input_callback_set(view_port, input_callback, event_queue);
+
+    furi_hal_gpio_add_int_callback(&gpio_ext_pa7, gpiocallback, event_queue);
+
+    Gui* gui = furi_record_open(RECORD_GUI);
+    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
+
+    FuriTimer* timer = furi_timer_alloc(clock_tick, FuriTimerTypePeriodic, event_queue);
+    furi_timer_start(timer, 1000);
+
+    FuriTimer* timerPause = furi_timer_alloc(clock_tick_pause, FuriTimerTypePeriodic, event_queue);
+
+    // ENABLE 5V pin
+    furi_hal_power_enable_otg();
+
+    uint8_t diceBuffer[64];
+    for (uint8_t i=0;i<64;i++) diceBuffer[i] = 0;
+
+    uint8_t diceBufferCounter = 0;
+    uint8_t diceBufferPositionWrite = 0;
+    uint8_t diceBufferPositionRead = 0;
+    uint8_t tickCounter = 0;
+    uint32_t CRC32 = 0;
+    uint8_t method = 0;
+
+    // MD5
+    md5_context* md5_ctx = malloc(sizeof(md5_context));
+    uint8_t* hash = malloc(sizeof(uint8_t) * 16);
+    uint8_t* bufferTim2 = malloc(4);
+    md5_starts(md5_ctx);
+
+    uint8_t pause = 0;
+
+    while(1) 
+    {
+        FuriStatus event_status = furi_message_queue_get(event_queue, &event, FuriWaitForever);
+        
+        uint8_t screenRefresh = 0;
+
+        if (event_status == FuriStatusOk)
+        {   
+            if(event.type == EventTypeInput) 
+            {
+                if(event.input.key == InputKeyBack && event.input.type == InputTypeLong) 
+                {
+                    break;
+                }
+                else if (pause == 0)
+                {
+                    if (event.input.key == InputKeyOk  && event.input.type == InputTypeShort)
+                    {
+                        if (diceBufferCounter > 0)
+                        {
+                            furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
+                            mutexVal.dice = diceBuffer[diceBufferPositionRead];
+                            mutexVal.diceAvailiable = --diceBufferCounter;
+                            mutexVal.pause = 1;
+                            furi_mutex_release(mutexVal.mutex);
+
+                            if (diceBufferPositionRead != 63) diceBufferPositionRead++;
+                            else diceBufferPositionRead = 0;
+
+                            pause = 1;
+                            furi_timer_start(timerPause, 500);
+                            screenRefresh = 1;
+                        }
+                    }
+                    else if (event.input.key == InputKeyLeft  && event.input.type == InputTypeLong)
+                    {
+                        if (method == 1)
+                        {
+                            method = 0;
+                            diceBufferPositionWrite = 0;
+                            diceBufferPositionRead = 0;
+                            diceBufferCounter = 0;
+                            CRC32 = 0;
+                            tickCounter = 0;
+                            furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
+                            mutexVal.method = 0;
+                            mutexVal.dice = 0;
+                            mutexVal.diceAvailiable = 0;
+                            furi_mutex_release(mutexVal.mutex);
+                            screenRefresh = 1;
+                        }
+                    }
+                    else if (event.input.key == InputKeyRight && event.input.type == InputTypeLong)
+                    {
+                        if (method == 0)
+                        {
+                            method = 1;
+                            diceBufferPositionWrite = 0;
+                            diceBufferPositionRead = 0;
+                            diceBufferCounter = 0;
+                            md5_starts(md5_ctx);
+                            tickCounter = 0;
+                            furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
+                            mutexVal.method = 1;
+                            mutexVal.dice = 0;
+                            mutexVal.diceAvailiable = 0;
+                            furi_mutex_release(mutexVal.mutex);
+                            screenRefresh = 1;
+                        }
+                    }
+                }
+            }
+            else if (event.type == ClockEventTypeTick)
+            {
+                furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
+                mutexVal.cps = counter;
+                furi_mutex_release(mutexVal.mutex);
+
+                counter = 0;
+                screenRefresh = 1;
+            }
+            else if (event.type == ClockEventTypeTickPause)
+            {
+                furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
+                mutexVal.pause = 0;
+                furi_mutex_release(mutexVal.mutex);
+
+                furi_timer_stop(timerPause);
+
+                pause = 0;
+                screenRefresh = 1;
+            }
+            else if (event.type == EventGPIO)
+            {
+                if (diceBufferCounter < 64)
+                {
+                    // CRC32
+                    if (method == 0)
+                    {
+                        uint32_t TIM2Tick = TIM2->CNT;
+                        bufferTim2[0] = (uint8_t)(TIM2Tick >> 24);
+                        bufferTim2[1] = (uint8_t)(TIM2Tick >> 16);
+                        bufferTim2[2] = (uint8_t)(TIM2Tick >> 8);
+                        bufferTim2[3] = (uint8_t)TIM2Tick;
+                        CRC32 = crc32_calc_buffer(CRC32, bufferTim2, 4);
+                        tickCounter++;
+
+                        if (tickCounter == 8)
+                        {
+                            uint8_t localDice = CRC32 & 0b111;
+
+                            if (localDice == 0 || localDice == 7)
+                            {
+                                localDice = (diceBuffer[diceBufferPositionRead] >> 3) & 0b111;
+                            }
+
+                            if (localDice >= 1 && localDice <= 6)
+                            {
+                                diceBuffer[diceBufferPositionWrite] = localDice;
+                                diceBufferCounter++;
+                                if (diceBufferPositionWrite != 63) diceBufferPositionWrite++;
+                                else diceBufferPositionWrite = 0;
+
+                                furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
+                                mutexVal.diceAvailiable = diceBufferCounter;
+                                furi_mutex_release(mutexVal.mutex);
+
+                                screenRefresh = 1;
+                            }
+
+                            CRC32 = 0;
+                            tickCounter = 0;
+                        }
+                    }
+                    // MD5
+                    else
+                    {
+                        uint32_t tick = TIM2->CNT;
+                        bufferTim2[0] = (uint8_t)(tick >> 24);
+                        bufferTim2[1] = (uint8_t)(tick >> 16);
+                        bufferTim2[2] = (uint8_t)(tick >> 8);
+                        bufferTim2[3] = (uint8_t)tick;
+                        md5_update(md5_ctx, bufferTim2, 4);
+
+                        tickCounter++;
+
+                        if (tickCounter == 32)
+                        {
+                            md5_finish(md5_ctx, hash);
+                            uint8_t localDice = 0;
+
+                            for (uint8_t i=0;i<16;i++)
+                            {
+                                localDice = hash[i] & 0b111;
+                                if (localDice >= 1 && localDice <= 6)
+                                {
+                                    diceBuffer[diceBufferPositionWrite] = localDice;
+                                    diceBufferCounter++;
+                                    if (diceBufferPositionWrite != 63) diceBufferPositionWrite++;
+                                    else diceBufferPositionWrite = 0;
+
+                                    furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
+                                    mutexVal.diceAvailiable = diceBufferCounter;
+                                    furi_mutex_release(mutexVal.mutex);
+
+                                    screenRefresh = 1;
+                                    break;
+                                }
+                            }
+
+                            md5_starts(md5_ctx);
+                            tickCounter = 0;
+                        }
+                    }
+                }
+
+                counter++;
+            }
+        }
+
+        if (screenRefresh == 1) view_port_update(view_port);
+    }
+
+    LL_TIM_DisableCounter(TIM2);
+    furi_hal_bus_disable(FuriHalBusTIM2);
+
+    free(md5_ctx);
+    free(bufferTim2);
+    free(hash);
+        
+    furi_record_close(RECORD_NOTIFICATION);
+
+    furi_hal_power_disable_otg();
+
+    furi_hal_gpio_disable_int_callback(&gpio_ext_pa7);
+    furi_hal_gpio_remove_int_callback(&gpio_ext_pa7);
+
+    furi_message_queue_free(event_queue);
+    furi_mutex_free(mutexVal.mutex);
+    gui_remove_view_port(gui, view_port);
+    view_port_free(view_port);
+    furi_timer_free(timer);
+    furi_timer_free(timerPause);
+    furi_record_close(RECORD_GUI);
+
+    return 0;
+}

+ 191 - 0
non_catalog_apps/secret_toggle/.clang-format

@@ -0,0 +1,191 @@
+---
+Language:        Cpp
+AccessModifierOffset: -4
+AlignAfterOpenBracket: AlwaysBreak
+AlignArrayOfStructures: None
+AlignConsecutiveMacros: None
+AlignConsecutiveAssignments: None
+AlignConsecutiveBitFields: None
+AlignConsecutiveDeclarations: None
+AlignEscapedNewlines: Left
+AlignOperands:   Align
+AlignTrailingComments: false
+AllowAllArgumentsOnNextLine: true
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortEnumsOnASingleLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: WithoutElse
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: Yes
+AttributeMacros:
+  - __capability
+BinPackArguments: false
+BinPackParameters: false
+BraceWrapping:
+  AfterCaseLabel:  false
+  AfterClass:      false
+  AfterControlStatement: Never
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  AfterExternBlock: false
+  BeforeCatch:     false
+  BeforeElse:      false
+  BeforeLambdaBody: false
+  BeforeWhile:     false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeConceptDeclarations: true
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: false
+ColumnLimit:     99
+CommentPragmas:  '^ IWYU pragma:'
+QualifierAlignment: Leave
+CompactNamespaces: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DeriveLineEnding: true
+DerivePointerAlignment: false
+DisableFormat:   false
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: LogicalBlock
+ExperimentalAutoDetectBinPacking: false
+PackConstructorInitializers: BinPack
+BasedOnStyle:    ''
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+AllowAllConstructorInitializersOnNextLine: true
+FixNamespaceComments: false
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IfMacros:
+  - KJ_IF_MAYBE
+IncludeBlocks:   Preserve
+IncludeCategories:
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
+    Priority:        3
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
+IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentAccessModifiers: false
+IndentCaseLabels: false
+IndentCaseBlocks: false
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentExternBlock: AfterExternBlock
+IndentRequires:  false
+IndentWidth:     4
+IndentWrappedFunctionNames: true
+InsertTrailingCommas: None
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: Signature
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 4
+ObjCBreakBeforeNestedBlockParam: true
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 10
+PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakComment: 10
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakOpenParenthesis: 0
+PenaltyBreakString: 10
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 100
+PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
+PPIndentWidth:   -1
+ReferenceAlignment: Pointer
+ReflowComments:  false
+RemoveBracesLLVM: false
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SortIncludes:    Never
+SortJavaStaticImport: Before
+SortUsingDeclarations: false
+SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: Never
+SpaceBeforeParensOptions:
+  AfterControlStatements: false
+  AfterForeachMacros: false
+  AfterFunctionDefinitionName: false
+  AfterFunctionDeclarationName: false
+  AfterIfMacros:   false
+  AfterOverloadedOperator: false
+  BeforeNonEmptyParentheses: false
+SpaceAroundPointerQualifiers: Default
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  Never
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: false
+SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+  Minimum:         1
+  Maximum:         -1
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceBeforeSquareBrackets: false
+BitFieldColonSpacing: Both
+Standard:        c++03
+StatementAttributeLikeMacros:
+  - Q_EMIT
+StatementMacros:
+  - Q_UNUSED
+  - QT_REQUIRE_VERSION
+TabWidth:        4
+UseCRLF:         false
+UseTab:          Never
+WhitespaceSensitiveMacros:
+  - STRINGIZE
+  - PP_STRINGIZE
+  - BOOST_PP_STRINGIZE
+  - NS_SWIFT_NAME
+  - CF_SWIFT_NAME
+...
+

+ 13 - 0
non_catalog_apps/secret_toggle/.editorconfig

@@ -0,0 +1,13 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+
+[*.{cpp,h,c,py,sh}]
+indent_style = space
+indent_size = 4
+
+[{Makefile,*.mk}]
+indent_size = tab

+ 1 - 0
non_catalog_apps/secret_toggle/.gitignore

@@ -0,0 +1 @@
+dist/*

+ 0 - 0
non_catalog_apps/secret_toggle/.gitkeep


+ 14 - 0
non_catalog_apps/secret_toggle/.vscode/c_cpp_properties.json

@@ -0,0 +1,14 @@
+{
+    "configurations": [
+        {
+            "name": "main",
+            "compilerPath": "/home/nostrum/.ufbt/toolchain/x86_64-linux/bin/arm-none-eabi-gcc",
+            "intelliSenseMode": "gcc-arm",
+            "compileCommands": "${workspaceFolder}/.vscode/compile_commands.json",
+            "configurationProvider": "ms-vscode.cpptools",
+            "cStandard": "gnu17",
+            "cppStandard": "c++17"
+        },
+    ],
+    "version": 4
+}

Разлика између датотеке није приказан због своје велике величине
+ 2 - 0
non_catalog_apps/secret_toggle/.vscode/compile_commands.json


+ 19 - 0
non_catalog_apps/secret_toggle/.vscode/extensions.json

@@ -0,0 +1,19 @@
+{
+	// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
+	// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
+	// List of extensions which should be recommended for users of this workspace.
+	"recommendations": [
+		"ms-python.black-formatter",
+		"ms-vscode.cpptools",
+		"amiralizadeh9480.cpp-helper",
+		"marus25.cortex-debug",
+		"zxh404.vscode-proto3",
+		"augustocdias.tasks-shell-input",
+		"rioj7.command-variable"
+	],
+	// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
+	"unwantedRecommendations": [
+		"twxs.cmake",
+		"ms-vscode.cmake-tools"
+	]
+}

+ 103 - 0
non_catalog_apps/secret_toggle/.vscode/launch.json

@@ -0,0 +1,103 @@
+{
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "inputs": [
+        {
+            "id": "BLACKMAGIC",
+            "type": "command",
+            "command": "shellCommand.execute",
+            "args": {
+                "description": "Get Blackmagic device",
+                "useSingleResult": true,
+                "command": "ufbt -s get_blackmagic",
+            }
+        },
+    ],
+    "configurations": [
+        {
+            "name": "Attach FW (ST-Link)",
+            "cwd": "${workspaceFolder}",
+            "executable": "/home/nostrum/.ufbt/current/firmware.elf",
+            "request": "attach",
+            "type": "cortex-debug",
+            "servertype": "openocd",
+            "device": "stlink",
+            "svdFile": "/home/nostrum/.ufbt/current/scripts/debug/STM32WB55_CM4.svd",
+            "rtos": "FreeRTOS",
+            "configFiles": [
+                "interface/stlink.cfg",
+                "/home/nostrum/.ufbt/current/scripts/debug/stm32wbx.cfg"
+            ],
+            "postAttachCommands": [
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperversion.py",
+                "fw-version",
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperapps.py",
+                "fap-set-debug-elf-root /home/nostrum/.ufbt/build"
+            ],
+            // "showDevDebugOutput": "raw",
+        },
+        {
+            "name": "Attach FW (DAP)",
+            "cwd": "${workspaceFolder}",
+            "executable": "/home/nostrum/.ufbt/current/firmware.elf",
+            "request": "attach",
+            "type": "cortex-debug",
+            "servertype": "openocd",
+            "device": "cmsis-dap",
+            "svdFile": "/home/nostrum/.ufbt/current/scripts/debug/STM32WB55_CM4.svd",
+            "rtos": "FreeRTOS",
+            "configFiles": [
+                "interface/cmsis-dap.cfg",
+                "/home/nostrum/.ufbt/current/scripts/debug/stm32wbx.cfg"
+            ],
+            "postAttachCommands": [
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperversion.py",
+                "fw-version",
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperapps.py",
+                "fap-set-debug-elf-root /home/nostrum/.ufbt/build"
+            ],
+            // "showDevDebugOutput": "raw",
+        },
+        {
+            "name": "Attach FW (blackmagic)",
+            "cwd": "${workspaceFolder}",
+            "executable": "/home/nostrum/.ufbt/current/firmware.elf",
+            "request": "attach",
+            "type": "cortex-debug",
+            "servertype": "external",
+            "gdbTarget": "${input:BLACKMAGIC}",
+            "svdFile": "/home/nostrum/.ufbt/current/scripts/debug/STM32WB55_CM4.svd",
+            "rtos": "FreeRTOS",
+            "postAttachCommands": [
+                "monitor swdp_scan",
+                "attach 1",
+                "set confirm off",
+                "set mem inaccessible-by-default off",
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperversion.py",
+                "fw-version",
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperapps.py",
+                "fap-set-debug-elf-root /home/nostrum/.ufbt/build"
+            ]
+            // "showDevDebugOutput": "raw",
+        },
+        {
+            "name": "Attach FW (JLink)",
+            "cwd": "${workspaceFolder}",
+            "executable": "/home/nostrum/.ufbt/current/firmware.elf",
+            "request": "attach",
+            "type": "cortex-debug",
+            "servertype": "jlink",
+            "interface": "swd",
+            "device": "STM32WB55RG",
+            "svdFile": "/home/nostrum/.ufbt/current/scripts/debug/STM32WB55_CM4.svd",
+            "rtos": "FreeRTOS",
+            "postAttachCommands": [
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperversion.py",
+                "fw-version",
+                "source /home/nostrum/.ufbt/current/scripts/debug/flipperapps.py",
+                "fap-set-debug-elf-root /home/nostrum/.ufbt/build"
+            ]
+            // "showDevDebugOutput": "raw",
+        },
+    ]
+}

+ 20 - 0
non_catalog_apps/secret_toggle/.vscode/settings.json

@@ -0,0 +1,20 @@
+{
+    "cortex-debug.enableTelemetry": false,
+    "cortex-debug.variableUseNaturalFormat": false,
+    "cortex-debug.showRTOS": true,
+    "cortex-debug.armToolchainPath": "/home/nostrum/.ufbt/toolchain/x86_64-linux/bin",
+    "cortex-debug.openocdPath": "/home/nostrum/.ufbt/toolchain/x86_64-linux/openocd/bin/openocd",
+    "cortex-debug.gdbPath": "/home/nostrum/.ufbt/toolchain/x86_64-linux/bin/arm-none-eabi-gdb-py",
+    "editor.formatOnSave": true,
+    "files.associations": {
+        "*.scons": "python",
+        "SConscript": "python",
+        "SConstruct": "python",
+        "*.fam": "python"
+    },
+    "cortex-debug.registerUseNaturalFormat": false,
+    "python.analysis.typeCheckingMode": "off",
+    "[python]": {
+        "editor.defaultFormatter": "ms-python.black-formatter"
+    }
+}

+ 66 - 0
non_catalog_apps/secret_toggle/.vscode/tasks.json

@@ -0,0 +1,66 @@
+{
+    // See https://go.microsoft.com/fwlink/?LinkId=733558
+    // for the documentation about the tasks.json format
+    "version": "2.0.0",
+    "options": {
+        "env": {
+            "PATH": "${workspaceFolder}:${env:PATH}:/home/nostrum/.ufbt/current/scripts/ufbt"
+        }
+    },
+    "tasks": [
+        {
+            "label": "Launch App on Flipper",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt launch"
+        },
+        {
+            "label": "Build",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt"
+        },
+        {
+            "label": "Clean",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt -c"
+        },
+        {
+            "label": "Flash FW (ST-Link)",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt FORCE=1 flash"
+        },
+        {
+            "label": "Flash FW (blackmagic)",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt flash_blackmagic"
+        },
+        {
+            "label": "Flash FW (JLink)",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt FORCE=1 jflash"
+        },
+        {
+            "label": "Flash FW (USB, with resources)",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt FORCE=1 flash_usb"
+        },
+        {
+            "label": "Update uFBT SDK",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt update"
+        },
+        {
+            "label": "Update VSCode config for current SDK",
+            "group": "build",
+            "type": "shell",
+            "command": "ufbt vscode_dist"
+        }
+    ]
+}

+ 674 - 0
non_catalog_apps/secret_toggle/LICENSE

@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<https://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<https://www.gnu.org/licenses/why-not-lgpl.html>.

+ 32 - 0
non_catalog_apps/secret_toggle/README.md

@@ -0,0 +1,32 @@
+#secret_toggle
+
+A game for the Flipper Zero device.
+
+## Instructions
+
+- Arrow buttons move around the board.
+- Push center OK button to toggle a square. Some squares are connected.
+- Turn all of the squares on (light colored) to pass the level.
+- Levels get harder as you go.
+- Beat level 10 and you win.
+
+## Compiling
+
+sudo usermod -a -G dialout username
+...reboot machine to be added to dialout group for access to /dev/ttyACM0
+python3 -m pip install --user --upgrade ufbt
+cd secret_toggle
+ufbt -h
+ufbt update
+ufbt
+...connect flipper over usb
+ufbt launch
+
+## Validating Manifest
+
+sudo apt-get install python3.10-venv
+cd flipper-application-catalog
+python3 -m venv venv
+source venv/bin/activate
+pip install -r tools/requirements.txt
+python3 tools/bundle.py applications/Games/secret_toggle/manifest.yml bundle.zip

+ 18 - 0
non_catalog_apps/secret_toggle/application.fam

@@ -0,0 +1,18 @@
+# For details & more options, see documentation/AppManifests.md in firmware repo
+
+App(
+    appid="secret_toggle",  # Must be unique
+    name="Secret Toggle",  # Displayed in menus
+    apptype=FlipperAppType.EXTERNAL,
+    entry_point="secret_toggle_app",
+    cdefines=["APP_SECRETTOGGLE"],
+    stack_size=2 * 1024,
+    fap_category="Games",
+    # Optional values
+    # fap_version="0.1",
+    fap_icon="secret_toggle_icon.png",  # 10x10 1-bit PNG
+    fap_description="A game that toggles squares.",
+    fap_author="@nostrumuva",
+    fap_weburl="https://github.com/nostrumuva/secret_toggle.git",
+    fap_icon_assets="images",  # Image assets to compile for this application
+)

+ 0 - 0
non_catalog_apps/secret_toggle/images/.gitkeep


BIN
non_catalog_apps/secret_toggle/screenshot.png


+ 359 - 0
non_catalog_apps/secret_toggle/secret_toggle.c

@@ -0,0 +1,359 @@
+/* @file secret_toggle.c
+ * @author @nostrumuva, Isomer Programming LLC
+ * @license GNU General Public License Version 3
+ * @note yup it's open source for the flipper zero
+ */
+
+#include <dialogs/dialogs.h>
+#include <furi.h>
+#include <furi_hal.h>
+#include <gui/gui.h>
+#include <input/input.h>
+#include <notification/notification_messages.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include "util.h"
+
+#define BOARD_HEIGHT 7
+#define BOARD_WIDTH 7
+#define BOARD_NUM_SQUARES (BOARD_HEIGHT * BOARD_WIDTH)
+#define MAX_LEVELS 10
+
+typedef enum {
+    EventTypeTick,
+    EventTypeKey,
+} EventType;
+
+typedef struct {
+    EventType type;
+    InputEvent input;
+} PluginEvent;
+
+typedef enum { SquareActiveOff, SquareActiveOn } SquareActive;
+
+typedef struct {
+    SquareActive mySquareActive;
+    int myConnectedSquares[BOARD_NUM_SQUARES]; //0 if not connected, 1 if connected
+} Square;
+
+typedef struct {
+    Square myBoard[BOARD_NUM_SQUARES];
+    int myLevel;
+    int myCursorX;
+    int myCursorY;
+    int myNumToggles;
+    bool myWin;
+} Game;
+
+static void showStartupScreen() {
+    const char* tempTitle = "Secret Toggle";
+    const char* tempMessage =
+        "Toggle all squares to be bright.\nSome squares are connected.\ngithub.com/nostrumuva";
+    const char* tempConfirmButtonText = "Play";
+    utilShowDialog(tempTitle, tempMessage, tempConfirmButtonText);
+}
+
+static void showLevelScreen(Game* paramGame) {
+    const char* tempTitle = "Secret Toggle";
+    FuriString* tempMessage;
+    tempMessage = furi_string_alloc();
+    furi_string_printf(tempMessage, "LEVEL %d!", paramGame->myLevel);
+    const char* tempConfirmButtonText = "Play";
+    utilShowDialog(tempTitle, furi_string_get_cstr(tempMessage), tempConfirmButtonText);
+    furi_string_free(tempMessage);
+}
+
+static void showExitScreen(Game* paramGame) {
+    const char* tempExit = "Never give up!";
+    const char* tempMessage = "Thanks for playing!\ngithub.com/nostrumuva";
+    const char* tempConfirmButtonText = "Bye";
+    FuriString* tempWin;
+    tempWin = furi_string_alloc();
+    furi_string_printf(tempWin, "You Win! T: %d", paramGame->myNumToggles);
+    if(paramGame->myWin == true) {
+        utilShowDialog(furi_string_get_cstr(tempWin), tempMessage, tempConfirmButtonText);
+    } else {
+        utilShowDialog(tempExit, tempMessage, tempConfirmButtonText);
+    }
+    furi_string_free(tempWin);
+}
+
+static bool gameCheckWinLevel(Game* paramGame) {
+    bool tempWinLevel = true;
+    int tempIterateSquares = 0;
+    for(tempIterateSquares = 0; tempIterateSquares < BOARD_NUM_SQUARES; tempIterateSquares++) {
+        if(paramGame->myBoard[tempIterateSquares].mySquareActive == SquareActiveOff) {
+            tempWinLevel = false;
+            break;
+        }
+    }
+    return tempWinLevel;
+}
+
+static void gameToggleSquare(Game* paramGame, int paramSquareIndex) {
+    int tempIterateConnected = 0;
+    for(tempIterateConnected = 0; tempIterateConnected < BOARD_NUM_SQUARES;
+        tempIterateConnected++) {
+        if(paramGame->myBoard[paramSquareIndex].myConnectedSquares[tempIterateConnected] == 1 &&
+           tempIterateConnected != paramSquareIndex) {
+            paramGame->myBoard[tempIterateConnected].mySquareActive =
+                (SquareActive)(!((bool)paramGame->myBoard[tempIterateConnected].mySquareActive));
+        }
+    }
+    paramGame->myBoard[paramSquareIndex].mySquareActive =
+        (SquareActive)(!((bool)paramGame->myBoard[paramSquareIndex].mySquareActive));
+}
+
+static void gameSetup(Game* paramGame, int paramLevel) {
+    int tempIterateLevel = 0;
+    int tempIterateSquares = 0;
+    int tempIterateConnected = 0;
+    int tempRandomSquare = 0;
+    paramGame->myLevel = paramLevel;
+    paramGame->myCursorX = 0;
+    paramGame->myCursorY = 0;
+    //turn them all on and set to no connections
+    for(tempIterateSquares = 0; tempIterateSquares < BOARD_NUM_SQUARES; tempIterateSquares++) {
+        paramGame->myBoard[tempIterateSquares].mySquareActive = SquareActiveOn;
+        for(tempIterateConnected = 0; tempIterateConnected < BOARD_NUM_SQUARES;
+            tempIterateConnected++) {
+            paramGame->myBoard[tempIterateSquares].myConnectedSquares[tempIterateConnected] = 0;
+        }
+    }
+    //based on level, connect more squares
+    for(tempIterateSquares = 0; tempIterateSquares < BOARD_NUM_SQUARES; tempIterateSquares++) {
+        for(tempIterateLevel = 0; tempIterateLevel < paramGame->myLevel; tempIterateLevel++) {
+            tempRandomSquare = furi_hal_random_get() % BOARD_NUM_SQUARES;
+            paramGame->myBoard[tempIterateSquares].myConnectedSquares[tempRandomSquare] = 1;
+        }
+    }
+    //based on level, toggle more squares to scramble
+    for(tempIterateLevel = 0; tempIterateLevel < paramGame->myLevel; tempIterateLevel++) {
+        tempRandomSquare = rand() % BOARD_NUM_SQUARES;
+        gameToggleSquare(paramGame, tempRandomSquare);
+    }
+}
+
+static void render_callback(Canvas* const canvas, void* ctx) {
+    Game* tempGame = (Game*)ctx;
+    FuriString* tempStatusStr;
+    tempStatusStr = furi_string_alloc();
+    furi_string_printf(
+        tempStatusStr, "L: %d/%d   T: %d", tempGame->myLevel, MAX_LEVELS, tempGame->myNumToggles);
+    canvas_set_font(canvas, FontSecondary);
+    canvas_draw_str_aligned(
+        canvas, 0, 0, AlignLeft, AlignTop, furi_string_get_cstr(tempStatusStr));
+    static uint8_t staticMinX = 40;
+    static uint8_t staticMinY = 8;
+    static uint8_t staticSquareActiveOnBits[] = {
+        0x00,
+        0x7E,
+        0x42,
+        0x42,
+        0x42,
+        0x42,
+        0x7E,
+        0x00,
+    }; //1 is black, 0 is bright
+    static uint8_t staticSquareActiveOnBitsSelected[] = {
+        0xFF,
+        0xFF,
+        0xC3,
+        0xC3,
+        0xC3,
+        0xC3,
+        0xFF,
+        0xFF,
+    }; //1 is black, 0 is bright
+    static uint8_t staticSquareActiveOffBits[] = {
+        0x00,
+        0x7E,
+        0x7E,
+        0x7E,
+        0x7E,
+        0x7E,
+        0x7E,
+        0x00,
+    }; //1 is black, 0 is bright
+    static uint8_t staticSquareActiveOffBitsSelected[] = {
+        0xFF,
+        0xFF,
+        0xFF,
+        0xFF,
+        0xFF,
+        0xFF,
+        0xFF,
+        0xFF,
+    }; //1 is black, 0 is bright
+    int tempIterateSquares = 0;
+    int tempSquareX = 0;
+    int tempSquareY = 0;
+    for(tempIterateSquares = 0; tempIterateSquares < BOARD_NUM_SQUARES; tempIterateSquares++) {
+        tempSquareX = tempIterateSquares % BOARD_WIDTH;
+        tempSquareY = (tempIterateSquares - tempSquareX) / BOARD_HEIGHT;
+        if(tempGame->myBoard[tempIterateSquares].mySquareActive == SquareActiveOn) {
+            if(tempSquareX == tempGame->myCursorX && tempSquareY == tempGame->myCursorY) {
+                canvas_draw_xbm(
+                    canvas,
+                    staticMinX + (tempSquareX * 8), //x position
+                    staticMinY + (tempSquareY * 8), //y position
+                    8, //width
+                    8, //height
+                    staticSquareActiveOnBitsSelected);
+            } else {
+                canvas_draw_xbm(
+                    canvas,
+                    staticMinX + (tempSquareX * 8), //x position
+                    staticMinY + (tempSquareY * 8), //y position
+                    8, //width
+                    8, //height
+                    staticSquareActiveOnBits);
+            }
+        } else {
+            if(tempSquareX == tempGame->myCursorX && tempSquareY == tempGame->myCursorY) {
+                canvas_draw_xbm(
+                    canvas,
+                    staticMinX + (tempSquareX * 8), //x position
+                    staticMinY + (tempSquareY * 8), //y position
+                    8, //width
+                    8, //height
+                    staticSquareActiveOffBitsSelected);
+            } else {
+                canvas_draw_xbm(
+                    canvas,
+                    staticMinX + (tempSquareX * 8), //x position
+                    staticMinY + (tempSquareY * 8), //y position
+                    8, //width
+                    8, //height
+                    staticSquareActiveOffBits);
+            }
+        }
+    }
+    furi_string_free(tempStatusStr);
+}
+
+static void input_callback(InputEvent* input_event, FuriMessageQueue* event_queue) {
+    furi_assert(event_queue);
+    PluginEvent event = {.type = EventTypeKey, .input = *input_event};
+    furi_message_queue_put(event_queue, &event, FuriWaitForever);
+}
+
+static void clampCursor(Game* paramGame) {
+    if(paramGame->myCursorX < 0) {
+        paramGame->myCursorX = 0;
+    } else if(paramGame->myCursorX > BOARD_WIDTH - 1) {
+        paramGame->myCursorX = BOARD_WIDTH - 1;
+    }
+    if(paramGame->myCursorY < 0) {
+        paramGame->myCursorY = 0;
+    } else if(paramGame->myCursorY > BOARD_HEIGHT - 1) {
+        paramGame->myCursorY = BOARD_HEIGHT - 1;
+    }
+}
+
+static int getCursorSquareIndex(Game* paramGame) {
+    return paramGame->myCursorY * BOARD_HEIGHT + paramGame->myCursorX;
+}
+
+int32_t secret_toggle_app(void* p) {
+    UNUSED(p);
+    showStartupScreen();
+    Game* newGame = malloc(sizeof(Game));
+    newGame->myWin = false;
+    newGame->myNumToggles = 0;
+    int tempLevel = 1;
+    bool tempContinueGame = true;
+    while(tempContinueGame == true) {
+        gameSetup(newGame, tempLevel);
+        showLevelScreen(newGame);
+        FuriMessageQueue* newFuriMessageQueue = furi_message_queue_alloc(8, sizeof(PluginEvent));
+        Gui* newGui = furi_record_open("gui");
+        ViewPort* newViewPort = view_port_alloc();
+        view_port_draw_callback_set(newViewPort, render_callback, newGame);
+        view_port_input_callback_set(newViewPort, input_callback, newFuriMessageQueue);
+        gui_add_view_port(newGui, newViewPort, GuiLayerFullscreen);
+        PluginEvent tempPluginEvent;
+        for(bool tempProcessing = true; tempProcessing;) {
+            FuriStatus tempFuriStatus =
+                furi_message_queue_get(newFuriMessageQueue, &tempPluginEvent, 100);
+            if(tempFuriStatus == FuriStatusOk) //otherwise, event timed out
+            {
+                if(tempPluginEvent.type == EventTypeKey) {
+                    if(tempPluginEvent.input.type == InputTypeShort) //short press
+                    {
+                        switch(tempPluginEvent.input.key) {
+                        case InputKeyUp:
+                            newGame->myCursorY -= 1;
+                            clampCursor(newGame);
+                            break;
+                        case InputKeyDown:
+                            newGame->myCursorY += 1;
+                            clampCursor(newGame);
+                            break;
+                        case InputKeyRight:
+                            newGame->myCursorX += 1;
+                            clampCursor(newGame);
+                            break;
+                        case InputKeyLeft:
+                            newGame->myCursorX -= 1;
+                            clampCursor(newGame);
+                            break;
+                        case InputKeyOk:
+                            gameToggleSquare(newGame, getCursorSquareIndex(newGame));
+                            newGame->myNumToggles += 1;
+                            break;
+                        case InputKeyBack:
+                            tempProcessing = false;
+                            tempContinueGame = false;
+                            break;
+                        case InputKeyMAX:
+                            break;
+                        default:
+                            break;
+                        }
+                    } else if(tempPluginEvent.input.type == InputTypeLong) //long press
+                    {
+                        switch(tempPluginEvent.input.key) {
+                        case InputKeyUp:
+                        case InputKeyDown:
+                        case InputKeyRight:
+                        case InputKeyLeft:
+                            break;
+                        case InputKeyOk:
+                            //test win condition
+                            ///newGame->myWin=true;
+                            ///tempProcessing=false;
+                            ///tempContinueGame=false;
+                            break;
+                        case InputKeyBack:
+                            tempProcessing = false;
+                            tempContinueGame = false;
+                            break;
+                        case InputKeyMAX:
+                            break;
+                        default:
+                            break;
+                        }
+                    }
+                }
+                if(gameCheckWinLevel(newGame) == true) {
+                    tempLevel += 1;
+                    if(tempLevel > MAX_LEVELS) {
+                        newGame->myWin = true;
+                        tempContinueGame = false;
+                    }
+                    tempProcessing = false;
+                }
+            }
+            view_port_update(newViewPort);
+        }
+        view_port_enabled_set(newViewPort, false);
+        gui_remove_view_port(newGui, newViewPort);
+        view_port_free(newViewPort);
+        furi_record_close("gui");
+        furi_message_queue_free(newFuriMessageQueue);
+    }
+    showExitScreen(newGame);
+    free(newGame);
+    return 0;
+}

BIN
non_catalog_apps/secret_toggle/secret_toggle_icon.png


+ 17 - 0
non_catalog_apps/secret_toggle/util.c

@@ -0,0 +1,17 @@
+#include "util.h"
+
+void utilShowDialog(
+    const char* paramTitle,
+    const char* paramMessage,
+    const char* paramConfirmButtonText) {
+    DialogsApp* newDialogsApp = furi_record_open(RECORD_DIALOGS);
+    DialogMessage* newDialogMessage = dialog_message_alloc();
+    dialog_message_set_header(newDialogMessage, paramTitle, 64, 3, AlignCenter, AlignTop);
+    dialog_message_set_text(newDialogMessage, paramMessage, 64, 32, AlignCenter, AlignCenter);
+    dialog_message_set_buttons(newDialogMessage, NULL, paramConfirmButtonText, NULL);
+    dialog_message_set_icon(newDialogMessage, NULL, 0, 10);
+    dialog_message_show(newDialogsApp, newDialogMessage);
+    dialog_message_free(newDialogMessage);
+    furi_record_close(RECORD_DIALOGS);
+    return;
+}

+ 17 - 0
non_catalog_apps/secret_toggle/util.h

@@ -0,0 +1,17 @@
+#ifndef UTIL_H
+#define UTIL_H
+
+#include <dialogs/dialogs.h>
+#include <furi.h>
+#include <furi_hal.h>
+#include <gui/gui.h>
+#include <input/input.h>
+#include <notification/notification_messages.h>
+#include <stdlib.h>
+
+void utilShowDialog(
+    const char* paramTitle,
+    const char* paramMessage,
+    const char* paramConfirmButtonText);
+
+#endif

+ 25 - 0
non_catalog_apps/wire_tester/LICENSE

@@ -0,0 +1,25 @@
+BSD 2-Clause License
+
+Copyright (c) 2023, Blaine Murphy
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 20 - 0
non_catalog_apps/wire_tester/README.md

@@ -0,0 +1,20 @@
+# Flipper Wire Tester
+This is a simple Flipper Zero app that beeps if a wire is continuous.
+
+![Screenshot](screen_1.png)
+
+## Installation
+Copy the `wire_tester` directory to the `applications_user` directory of your
+favorite firmware. Run `./fbt launch APPSRC=applications_user/wire_tester` to
+install and start the application on your Flipper.
+
+
+## Usage
+Find the app under `Apps` -> `GPIO` -> `[GPIO] Wire Tester` and launch it. Test
+a wire by connecting it to pins 6 and 8. If the wire is continuous, you will
+see the LED turn green and the flipper will beep.
+
+
+## Licensing
+Source in this repository is licensed under the 2-clause BSD license, see
+`LICENSE` for details.

+ 15 - 0
non_catalog_apps/wire_tester/application.fam

@@ -0,0 +1,15 @@
+App(
+    appid="wire_tester",
+    name="[GPIO] Wire Tester",
+    apptype=FlipperAppType.EXTERNAL,
+    entry_point="app_main",
+    requires=["gui"],
+    stack_size=1 * 1024,
+    fap_icon="icon.png",
+    fap_icon_assets="assets",
+    fap_category="GPIO",
+    fap_author="@unixispower",
+    fap_weburl="https://gitlab.com/unixispower/flipper-wire-tester",
+    fap_version="1.0",
+    fap_description="Beeps if a wire is continuous",
+)

BIN
non_catalog_apps/wire_tester/assets/background_128x64.png


BIN
non_catalog_apps/wire_tester/icon.png


+ 111 - 0
non_catalog_apps/wire_tester/wire_tester.c

@@ -0,0 +1,111 @@
+#include <furi.h>
+#include <furi_hal.h>
+#include <gui/gui.h>
+#include <input/input.h>
+#include <notification/notification.h>
+#include <notification/notification_messages.h>
+
+#include <stdlib.h>
+
+#include "wire_tester_icons.h"
+
+
+//#define TAG "wire_tester"
+
+
+static const uint32_t EVENT_PERIOD_MS = 10; // check for input changes often
+static const float BEEP_FREQ = 2400.0f; // louder than other frequencies
+static const float BEEP_VOL = 0.8f;
+static const GpioPin* const INPUT_PIN = &gpio_ext_pb2; // pin 6
+
+
+static void start_feedback(NotificationApp* notifications) {
+    // set LED to green
+    notification_message_block(notifications, &sequence_set_only_green_255);
+
+    // start beep
+    if (furi_hal_speaker_acquire(1000)) {
+         furi_hal_speaker_start(BEEP_FREQ, BEEP_VOL);
+    }
+}
+
+static void stop_feedback(NotificationApp* notifications) {
+    // clear LED
+    notification_message_block(notifications, &sequence_reset_rgb);
+
+    // stop beep
+    if (furi_hal_speaker_is_mine()) {
+        furi_hal_speaker_stop();
+        furi_hal_speaker_release();
+    }
+}
+
+static void draw_callback(Canvas* canvas, void* ctx) {
+    furi_assert(ctx);
+    canvas_clear(canvas);
+    canvas_draw_icon(canvas, 0, 0, &I_background_128x64);
+}
+
+static void input_callback(InputEvent* input_event, void* ctx) {
+    furi_assert(ctx);
+    FuriMessageQueue* event_queue = ctx;
+    furi_message_queue_put(event_queue, input_event, FuriWaitForever);
+}
+
+int32_t app_main(void* p) {
+    UNUSED(p);
+    FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
+
+    // force backlight on because our hands will be busy with wires
+    NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
+    notification_message_block(notifications, &sequence_display_backlight_enforce_on);
+
+    ViewPort* view_port = view_port_alloc();
+    view_port_draw_callback_set(view_port, draw_callback, view_port);
+    view_port_input_callback_set(view_port, input_callback, event_queue);
+
+    Gui* gui = furi_record_open(RECORD_GUI);
+    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
+    view_port_update(view_port);
+
+    stop_feedback(notifications);
+
+    // set input to be normally high; it will be low when shorted to ground
+    furi_hal_gpio_init(INPUT_PIN, GpioModeInput, GpioPullUp, GpioSpeedLow);
+
+    bool alarming = false;
+    bool running = true;
+    while (running) {
+        // start and stop feedback on the transition
+        bool continuous = !furi_hal_gpio_read(INPUT_PIN);
+        if (continuous && !alarming) {
+            start_feedback(notifications);
+        } else if (!continuous && alarming) {
+            stop_feedback(notifications);
+        }
+        alarming = continuous;
+
+        // exit on back key
+        InputEvent event;
+        if (furi_message_queue_get(event_queue, &event, EVENT_PERIOD_MS) == FuriStatusOk) {
+            if ((event.type == InputTypePress || event.type == InputTypeRepeat)
+                    && event.key == InputKeyBack) {
+                running = false;
+            }
+        }
+    }
+
+    // return control of the LED, beeper, and backlight
+    stop_feedback(notifications);
+    notification_message_block(notifications, &sequence_display_backlight_enforce_auto);
+
+    view_port_enabled_set(view_port, false);
+    gui_remove_view_port(gui, view_port);
+    view_port_free(view_port);
+
+    furi_message_queue_free(event_queue);
+    furi_record_close(RECORD_GUI);
+    furi_record_close(RECORD_NOTIFICATION);
+
+    return 0;
+}

Неке датотеке нису приказане због велике количине промена