blk_box_tc/main/main.cpp

57 lines
1.3 KiB
C++
Executable File

#include <stdio.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_rom_gpio.h"
#include "drivers/all.h"
#include "helper.h"
#include "steps/step0.h"
#include "steps/step1.h"
#include "steps/step2.h"
#include "steps/step3.h"
#include "steps/step4.h"
#include "steps/step5.h"
#include "steps/step6.h"
static const char *TAG = "main";
uint32_t initial_game_time = 90*60*1000;
uint32_t skip_to_step = 0;
extern "C" void app_main(void) {
printf("app_main\n");
init_drivers();
// TODO: get wires out of the drivers
// TODO: generify the strike system out of wires
init_wires();
clean_bomb();
step0();
set_game_time(initial_game_time + 1000);
start_game_timer();
clean_bomb();
if (skip_to_step <= 1) step1();
clean_bomb();
if (skip_to_step <= 2) step2();
clean_bomb();
if (skip_to_step <= 3) step3();
clean_bomb();
if (skip_to_step <= 4) step4();
clean_bomb();
if (skip_to_step <= 5) step5();
clean_bomb();
if (skip_to_step <= 6) step6();
clean_bomb();
stop_game_timer();
ESP_LOGI(TAG, "Bomb has been diffused. Counter-Terrorists win.");
play_clip_wav(MOUNT_POINT "/diffuse.wav", true, false, 3, 0);
display_game_results();
}