78 lines
1.5 KiB
C++
Executable File
78 lines
1.5 KiB
C++
Executable File
#include <stdio.h>
|
|
#include "sdkconfig.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
#include "driver/uart.h"
|
|
#include "driver/i2c.h"
|
|
#include "drivers/tft.hpp"
|
|
#include "drivers/wires.h"
|
|
#include "drivers/bottom_half.h"
|
|
#include "drivers/sd.h"
|
|
#include "drivers/game_timer.h"
|
|
#include "drivers/speaker.h"
|
|
#include "drivers/char_lcd.h"
|
|
#include "esp_rom_gpio.h"
|
|
#include "drivers/leds.h"
|
|
|
|
#include "helper.h"
|
|
|
|
#include "steps/step0.hpp"
|
|
#include "steps/step1.hpp"
|
|
#include "steps/step2.hpp"
|
|
#include "steps/step3.hpp"
|
|
#include "steps/step4.hpp"
|
|
#include "steps/step5.hpp"
|
|
#include "steps/step6.hpp"
|
|
|
|
static const char *TAG = "main";
|
|
|
|
extern "C" void app_main(void) {
|
|
printf("app_main\n");
|
|
|
|
init_sd();
|
|
init_tft();
|
|
init_speaker();
|
|
init_sseg();
|
|
init_game_module_timer();
|
|
init_leds();
|
|
init_wires();
|
|
|
|
init_bottom_half();
|
|
init_char_lcd();
|
|
|
|
// create_demo_ui();
|
|
clean_bomb();
|
|
|
|
step0();
|
|
set_game_time(30000);
|
|
start_game_timer();
|
|
clean_bomb();
|
|
step1();
|
|
clean_bomb();
|
|
step2();
|
|
clean_bomb();
|
|
step3();
|
|
clean_bomb();
|
|
step4();
|
|
clean_bomb();
|
|
step5();
|
|
clean_bomb();
|
|
step6();
|
|
clean_bomb();
|
|
|
|
stop_game_timer();
|
|
ESP_LOGI(TAG, "Bomb has been diffused. Counter-Terrorists win.");
|
|
ESP_ERROR_CHECK_WITHOUT_ABORT(play_raw("/sdcard/diffused.pcm"));
|
|
|
|
|
|
|
|
// play_example();
|
|
|
|
|
|
// deinit_sd();
|
|
|
|
// set_game_timer(1234, 1);
|
|
// set_module_timer(5678, 2);
|
|
}
|
|
|