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

pokemon: Clean up includes

No longer relying fully on transitive includes except where
appropriate.
Kris Bahnsen пре 2 година
родитељ
комит
56aceaae20
6 измењених фајлова са 56 додато и 66 уклоњено
  1. 4 1
      pokemon_app.cpp
  2. 1 4
      pokemon_app.h
  3. 3 1
      views/select_pokemon.cpp
  4. 1 6
      views/select_pokemon.hpp
  5. 47 2
      views/trade.cpp
  6. 0 52
      views/trade.hpp

+ 4 - 1
pokemon_app.cpp

@@ -1,6 +1,9 @@
-#include "pokemon_app.h"
+#include <furi_hal_light.h>
+#include <pokemon_icons.h>
+
 #include "views/trade.hpp"
 #include "views/select_pokemon.hpp"
+#include "pokemon_app.h"
 
 const PokemonTable pokemon_table[] = {
     {"Bulbasaur", &I_bulbasaur, 0x99},

+ 1 - 4
pokemon_app.h

@@ -2,13 +2,10 @@
 #define POKEMON_APP_H
 
 #pragma once
-#include <furi.h>
-#include <furi_hal_light.h>
-#include <gui/gui.h>
+
 #include <gui/view.h>
 #include <gui/view_dispatcher.h>
 #include <gui/icon.h>
-#include <pokemon_icons.h>
 
 #include "pokemon_data.h"
 

+ 3 - 1
views/select_pokemon.cpp

@@ -1,5 +1,7 @@
+#include <gui/elements.h>
+#include <pokemon_icons.h>
+
 #include "../pokemon_app.h"
-#include "select_pokemon.hpp"
 
 static void select_pokemon_render_callback(Canvas* canvas, void* model) {
     PokemonFap* pokemon_fap = *(PokemonFap**)model;

+ 1 - 6
views/select_pokemon.hpp

@@ -2,13 +2,8 @@
 #define SELECCT_POKEMON_HPP
 
 #pragma once
-#include <furi.h>
-#include <gui/view.h>
-#include <gui/view_dispatcher.h>
-
-#include <gui/elements.h>
-#include <string>
 
+#include <gui/view.h>
 #include "../pokemon_app.h"
 
 View* select_pokemon_alloc(PokemonFap* pokemon_fap);

+ 47 - 2
views/trade.cpp

@@ -1,7 +1,52 @@
+#include <furi_hal_light.h>
+#include <gui/view.h>
+#include <pokemon_icons.h>
+
 #include "../pokemon_app.h"
-#include "trade.hpp"
 
-#include "../pokemon_data.h"
+#define GAME_BOY_CLK gpio_ext_pb2
+#define GAME_BOY_SI gpio_ext_pc3
+#define GAME_BOY_SO gpio_ext_pb3
+
+#define DELAY_MICROSECONDS 15
+#define PKMN_BLANK 0x00
+
+#define ITEM_1_HIGHLIGHTED 0xD0
+#define ITEM_2_HIGHLIGHTED 0xD1
+#define ITEM_3_HIGHLIGHTED 0xD2
+#define ITEM_1_SELECTED 0xD4
+#define ITEM_2_SELECTED 0xD5
+#define ITEM_3_SELECTED 0xD6
+
+#define PKMN_MASTER 0x01
+#define PKMN_SLAVE 0x02
+#define PKMN_CONNECTED 0x60
+#define PKMN_WAIT 0x7F
+
+#define PKMN_ACTION 0x60
+
+#define PKMN_TRADE_CENTRE ITEM_1_SELECTED
+#define PKMN_COLOSSEUM ITEM_2_SELECTED
+#define PKMN_BREAK_LINK ITEM_3_SELECTED
+
+#define TRADE_CENTRE_WAIT 0xFD
+
+typedef unsigned char byte;
+typedef enum { NOT_CONNECTED, CONNECTED, TRADE_CENTRE, COLOSSEUM } connection_state_t;
+typedef enum {
+    INIT,
+    READY_TO_GO,
+    SEEN_FIRST_WAIT,
+    SENDING_RANDOM_DATA,
+    WAITING_TO_SEND_DATA,
+    START_SENDING_DATA,
+    SENDING_DATA,
+    DATA_SENT,
+    SENDING_PATCH_DATA,
+    TRADE_PENDING,
+    TRADE_CONFIRMATION,
+    DONE
+} trade_centre_state_t;
 
 /* TODO: Convert all of these to be maintained in a struct in the Trade context */
 uint8_t out_data = 0;

+ 0 - 52
views/trade.hpp

@@ -3,63 +3,11 @@
 
 #pragma once
 
-#include <furi.h>
-#include <furi_hal.h>
-#include <furi_hal_light.h>
 #include <gui/view.h>
-#include <gui/view_dispatcher.h>
-
 #include "../pokemon_app.h"
 
-#define GAME_BOY_CLK gpio_ext_pb2
-#define GAME_BOY_SI gpio_ext_pc3
-#define GAME_BOY_SO gpio_ext_pb3
-
-#define DELAY_MICROSECONDS 15
-#define PKMN_BLANK 0x00
-
-#define ITEM_1_HIGHLIGHTED 0xD0
-#define ITEM_2_HIGHLIGHTED 0xD1
-#define ITEM_3_HIGHLIGHTED 0xD2
-#define ITEM_1_SELECTED 0xD4
-#define ITEM_2_SELECTED 0xD5
-#define ITEM_3_SELECTED 0xD6
-
-#define PKMN_MASTER 0x01
-#define PKMN_SLAVE 0x02
-#define PKMN_CONNECTED 0x60
-#define PKMN_WAIT 0x7F
-
-#define PKMN_ACTION 0x60
-
-#define PKMN_TRADE_CENTRE ITEM_1_SELECTED
-#define PKMN_COLOSSEUM ITEM_2_SELECTED
-#define PKMN_BREAK_LINK ITEM_3_SELECTED
-
-#define TRADE_CENTRE_WAIT 0xFD
-
-typedef unsigned char byte;
-typedef enum { NOT_CONNECTED, CONNECTED, TRADE_CENTRE, COLOSSEUM } connection_state_t;
-typedef enum {
-    INIT,
-    READY_TO_GO,
-    SEEN_FIRST_WAIT,
-    SENDING_RANDOM_DATA,
-    WAITING_TO_SEND_DATA,
-    START_SENDING_DATA,
-    SENDING_DATA,
-    DATA_SENT,
-    SENDING_PATCH_DATA,
-    TRADE_PENDING,
-    TRADE_CONFIRMATION,
-    DONE
-} trade_centre_state_t;
-
 View* trade_alloc(PokemonFap* pokemon_fap);
 
 void trade_free(PokemonFap* pokemon_fap);
 
-extern unsigned char INPUT_BLOCK[405];
-extern unsigned char* DATA_BLOCK;
-
 #endif /* TRADE_HPP */