Felícito Manzano
/
DTK_Guaria2_ABInBev
Proyecto ABInBev para la tarjeta Guaria 1/2.
Diff: main.cpp
- Revision:
- 6:f4907ba89e16
- Parent:
- 5:07720e3f99d2
- Child:
- 7:01141979e5f2
--- a/main.cpp Mon Jul 04 22:28:16 2022 -0600 +++ b/main.cpp Mon Jul 04 23:15:31 2022 -0600 @@ -43,13 +43,20 @@ * en base a la tarjeta para la que se compilará. Se tiene soporte para * las tarjetas NUCLEO F303K8, NUCLEO F091RC, ICS3 e ICS5. */ -#define M_DEBUG 1 +#define M_DEBUG 1 +#define MAIN_FINGER_GT521 1 +extern const bool external_eeprom; #if (ICS_BOARD_ID == 11) // Serial BufferedSerial avl_uart(BLE_TX, BLE_RX, 1024, 2); //! UART TTL para enlace con el equipo Teltonika FMU130. BufferedSerial voice_uart(TTL_VOICE_TX, TTL_VOICE_RX); //! UART TTL para comunicación con el módulo de voz JQ8400. - BufferedSerial fingerprint(TTL_TX, TTL_RX); + + #if MAIN_FINGER_GT521 == 1 + BufferedSerial fingerprint(TTL_TX, TTL_RX); + #else + + #endif #ifdef M_DEBUG USBSerial myPC_debug; #endif @@ -97,10 +104,10 @@ #define DATA_32 ((uint32_t)0x12345678) // VOICE -queue colaPlaylist(10); +queue colaPlaylist(10); // HAL BASED -static IWDG_HandleTypeDef my_iwdg; +static IWDG_HandleTypeDef my_iwdg; // FUNCIONALIDADES @@ -201,7 +208,6 @@ int incoming_bytes; int temp_JQ8400_Volume; - /** * HUELLAS: * Se definen las variables para el procesamiento del módulo lector de @@ -214,7 +220,6 @@ char fingerprint_asc[499]; char fingerprint_cmd[4]; - /** * EVENTOS_TELTONIKA: * Se definen las variables para el procesamiento de Tramas del equipo @@ -225,18 +230,6 @@ int avl_fmu130_id; int avl_fmu130_status; -/** - * SENSOR DE LLUVIA RG9: - * Se definen las variables para el procesamiento de tramas del sensor - * de lluvia HYDREON RG9. - - bool rg9_raining; - char rg9_payload[64]; - int rg9_weather_id; - int rg9_weather_id_prev; - int rg9_count_noAnser = 0; - */ - // Inicialización de variables de Velocidad int wet_Speed_Warning; int wet_Speed_Limit; @@ -245,7 +238,6 @@ char wet_Speed_CMD[30]; char dry_Speed_CMD[30]; - // Fingerprint Override int fp_override_limit; // Limite de lecturas fallidas antes de autorizar int fp_unauthorized_count = 0; @@ -310,7 +302,11 @@ * interface Bluetooth. */ avl_uart.baud(115200); - fingerprint.baud(9600); + #if MAIN_FINGER_GT521 == 1 + fingerprint.baud(9600); + #else + + #endif voice_uart.baud(9600); in1_ignition.mode(PullDown); in2_pilot.mode(PullDown); @@ -324,11 +320,15 @@ out4_gt521fx = 0; mybutton.fall(&pressed); - //Flash + //Load Flash boot_message(); - load_eepromVar(); + if (external_eeprom) { + eeprom_size = ep.getSize(); + load_eepromVar(); + } else { + readFlash_Booting(); + } - // Configuración Inicial de Nivel de volumen. jq8400_iniVol(temp_JQ8400_Volume, &voice_uart); @@ -359,9 +359,6 @@ my_iwdg.Init.Prescaler = IWDG_PRESCALER_32; my_iwdg.Init.Reload = 0x0FFF; HAL_IWDG_Init(&my_iwdg); - - // Inicializar la EEPROM - eeprom_size = ep.getSize(); while (true) { @@ -376,7 +373,11 @@ //! Verificar si debe activarse el lector de huellas. if (flag_fingerprint_query) { HAL_IWDG_Refresh(&my_iwdg); - identify_fingerPrint(); + #if MAIN_FINGER_GT521 == 1 + identify_fingerPrint(); + #else + + #endif } //! Verificar si se debe apagar el lector de huellas.