Просмотр исходного кода

Squashed 'tama_p1/' changes from 9de12dc4c..54a49e98d

54a49e98d move apps
REVERT: 9de12dc4c slightly more stability
REVERT: 13fb316ff Did I fix it?
REVERT: 8d19fb8fc more cleaning
REVERT: 037054fe7 cleaning, vacuuming up bugs
REVERT: c39e4e45e More optimized, but code is a mess
REVERT: e7eb3edf7 GUI design is my passion
REVERT: 6d5040b9c fix merge conflicts
REVERT: 32de41f12 Merge branch 'menu' of https://github.com/Smileycathy1128/flipperzero-tamagotch-p1 into menu
REVERT: c0df21bc4 Add alternate fap icons
REVERT: 3cd9f58d9 Add alternate fap icons
REVERT: 42e0fd263 Add files via upload
REVERT: 23f7cbdad Made the readme and menu pretty
REVERT: a5abc73d1 reorganizing
REVERT: f169abf83 Clean up
REVERT: 15563a42c Added "Big Landscape". Rename it to full screen?
REVERT: 9ebba0b5f move menu items by 1 pixel
REVERT: 9542f6464 add "Save & Exit" to menu
REVERT: 6fa50b95a done
REVERT: 84fa146bc testing alternate portrait
REVERT: 0b508b74e use left and right buttons on some menu options
REVERT: 6133a0bc3 Return to 1x speed with the back button, bug fixes
REVERT: 6370a4043 Update README.md
REVERT: c107d29eb added fast-forward option in menu
REVERT: 2869022ea added fast-forward option in menu
REVERT: 8fdaf225e insignificant changes
REVERT: ad6211a62 branch cleaning before branching
REVERT: ccf8929ae code clean up
REVERT: 8297db118 more fixes
REVERT: d13c5adde bug fixing
REVERT: f03d2e9a7 missed some things again
REVERT: 1fab4dd0f Added a basic menu
REVERT: 7a18aeadd between portrait and landscape with the mode's Up
REVERT: c51cd95b0 Update README.md
REVERT: bcfef988a Update README.md
REVERT: 5be97c3ce Update README.md
REVERT: 8e3803ae0 Update readme again
REVERT: ca7cf7760 Update controls; Check readme
REVERT: 3d4dcfd4a Update README.md
REVERT: a3b1c777f cleanup and change mute shortcut to up
REVERT: 126f603a1 fixed icon layout
REVERT: 863f27348 Update README.md
REVERT: da6cdff29 Add to readme
REVERT: 251104368 Older icon setup
REVERT: 5cbd514dd Oops... forgot to put variables in all caps
REVERT: 92e7223e0 correct typos; add button combo to correct c file
REVERT: 1185c4dee Merge branch 'sav' into test
REVERT: bf9e24029 Map pause/mute button combos to up/down buttons
REVERT: dbf7eb7fe Screen scale increase, relocation of icons
REVERT: 91e7d68db Saving gamestate after exit
REVERT: f0e09ee9b Updated Readme
REVERT: e732f088a Updated Readme
REVERT: 51b302961 Added Readme
REVERT: b6a334bab Saving Emulator state and Upgrading to latest FW
REVERT: eaa8a6612 Fix wrong format specifier
REVERT: 147103f35 Add missing entry in manifest
REVERT: 4d1c54d1a Initial commit as standalone repo

git-subtree-dir: tama_p1
git-subtree-split: 54a49e98dfa8747ddaaa37cb7f4786f55afb89a3
Willy-JL 2 лет назад
Родитель
Сommit
251fe7f557
9 измененных файлов с 18 добавлено и 14 удалено
  1. 4 4
      README.md
  2. 4 4
      application.fam
  3. 1 1
      hal.c
  4. 0 1
      tama.h
  5. BIN
      tamaIcon1.png
  6. BIN
      tamaIcon2.png
  7. BIN
      tamaIcon3.png
  8. BIN
      tamaIcon4.png
  9. 9 4
      tama_p1.c

+ 4 - 4
README.md

@@ -23,17 +23,17 @@ Rename this to `rom.bin`.
 
 
 Building
 Building
 --------
 --------
-Move this folder into flippers `applications_user/TAMA-P1`. 
+Move this folder into flippers `applications/plugins/tama_p1`. 
 
 
 
 
 Launching the app, directly from console to flipper: 
 Launching the app, directly from console to flipper: 
 ```
 ```
-./fbt launch_app APPSRC=applications_user/TAMA-P1
+./fbt launch_app APPSRC=applications/plugins/tama_p1
 ```
 ```
 
 
 Run the following to compile icons:
 Run the following to compile icons:
 ```
 ```
-scripts/assets.py icons applications_user/TAMA-P1/icons applications_user/TAMA-P1/compiled
+scripts/assets.py icons applications/plugins/tama_p1/icons applications/plugins/tama_p1/compiled
 ```
 ```
 
 
 Note: you may also need to add `-Wno-unused-parameter` to `CCFLAGS` in
 Note: you may also need to add `-Wno-unused-parameter` to `CCFLAGS` in
@@ -46,7 +46,7 @@ it is easy to add direct logging after running the application:
 ```
 ```
 `python .\serial_logger.py`
 `python .\serial_logger.py`
 
 
-`./fbt launch_app APPSRC=applications_user\TAMA-P1;  python .\serial_logger.py`
+`./fbt launch_app APPSRC=applications/plugins/tama_p1; python .\serial_logger.py`
 ```
 ```
 Alternatively, follow the directions here: https://flipper.atmanos.com/docs/debugging/viewing/
 Alternatively, follow the directions here: https://flipper.atmanos.com/docs/debugging/viewing/
 
 

+ 4 - 4
application.fam

@@ -1,12 +1,12 @@
 App(
 App(
-    appid="TAMA_P1",
+    appid="tama_p1",
     name="TAMA P1",
     name="TAMA P1",
     apptype=FlipperAppType.EXTERNAL,
     apptype=FlipperAppType.EXTERNAL,
     entry_point="tama_p1_app",
     entry_point="tama_p1_app",
     cdefines=["APP_TAMA_P1"],
     cdefines=["APP_TAMA_P1"],
     requires=["gui", "storage"],
     requires=["gui", "storage"],
-    stack_size= 2 * 1024,
-    order = 215,
-    fap_icon="tamaIcon2.png",
+    stack_size=2 * 1024,
+    order=215,
+    fap_icon="tamaIcon.png",
     fap_category="Games",
     fap_category="Games",
 )
 )

+ 1 - 1
hal.c

@@ -40,7 +40,7 @@ static void tama_p1_hal_log(log_level_t level, char* buff, ...) {
     va_list args;
     va_list args;
     va_start(args, buff);
     va_start(args, buff);
     furi_string_cat_vprintf(string, buff, args);
     furi_string_cat_vprintf(string, buff, args);
-    va_end(args); 
+    va_end(args);
 
 
     switch(level) {
     switch(level) {
     case LOG_ERROR:
     case LOG_ERROR:

+ 0 - 1
tama.h

@@ -13,7 +13,6 @@
 #define STATE_FILE_VERSION 2
 #define STATE_FILE_VERSION 2
 #define TAMA_SAVE_PATH EXT_PATH("tama_p1/save.bin")
 #define TAMA_SAVE_PATH EXT_PATH("tama_p1/save.bin")
 
 
-
 typedef struct {
 typedef struct {
     FuriThread* thread;
     FuriThread* thread;
     hal_t hal;
     hal_t hal;





+ 9 - 4
tama_p1.c

@@ -1,4 +1,5 @@
 #include <furi.h>
 #include <furi.h>
+#include <furi_hal_bus.h>
 #include <gui/gui.h>
 #include <gui/gui.h>
 #include <input/input.h>
 #include <input/input.h>
 #include <storage/storage.h>
 #include <storage/storage.h>
@@ -750,6 +751,9 @@ static void tama_p1_init(TamaApp* const ctx) {
     if(ctx->rom != NULL) {
     if(ctx->rom != NULL) {
         // Init TIM2
         // Init TIM2
         // 64KHz
         // 64KHz
+
+        furi_hal_bus_enable(FuriHalBusTIM2);
+
         LL_TIM_InitTypeDef tim_init = {
         LL_TIM_InitTypeDef tim_init = {
             .Prescaler = 999,
             .Prescaler = 999,
             .CounterMode = LL_TIM_COUNTERMODE_UP,
             .CounterMode = LL_TIM_COUNTERMODE_UP,
@@ -782,6 +786,7 @@ static void tama_p1_deinit(TamaApp* const ctx) {
     if(ctx->rom != NULL) {
     if(ctx->rom != NULL) {
         tamalib_release();
         tamalib_release();
         furi_thread_free(ctx->thread);
         furi_thread_free(ctx->thread);
+        furi_hal_bus_disable(FuriHalBusTIM2);
         free(ctx->rom);
         free(ctx->rom);
     }
     }
 }
 }
@@ -830,9 +835,9 @@ int32_t tama_p1_app(void* p) {
                 btn_state_t tama_btn_state = 0; // BTN_STATE_RELEASED is 0
                 btn_state_t tama_btn_state = 0; // BTN_STATE_RELEASED is 0
 
 
                 if(in_menu) {
                 if(in_menu) {
-                    // if(menu_cursor >= 2 &&
-                    //    (event.input.key == InputKeyUp || event.input.key == InputKeyDown)) {
-                    //     tama_btn_state = BTN_STATE_RELEASED;
+                    // if(menu_cursor == 2 &&
+                    // (event.input.key == InputKeyUp || event.input.key == InputKeyDown)) {
+                    // tama_btn_state = BTN_STATE_RELEASED;
                     // }
                     // }
                     if(event.input.key == InputKeyBack) {
                     if(event.input.key == InputKeyBack) {
                         tama_btn_state = BTN_STATE_RELEASED;
                         tama_btn_state = BTN_STATE_RELEASED;
@@ -1128,7 +1133,7 @@ int32_t tama_p1_app(void* p) {
                             break;
                             break;
                         }
                         }
                     }
                     }
-                } else { // out of menu
+                } else { // out of menu // TODO: clean up code -.-
                     if(event.input.key == InputKeyBack && event.input.type == InputTypeLong) {
                     if(event.input.key == InputKeyBack && event.input.type == InputTypeLong) {
                         if(speed != 1) {
                         if(speed != 1) {
                             speed = 1;
                             speed = 1;