tweaks
This commit is contained in:
parent
5534cd733e
commit
a7b22343fe
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
static const char *TAG = "wires";
|
static const char *TAG = "wires";
|
||||||
|
|
||||||
|
static const uint32_t STRIKE_TIME_PENALTY = 30'000;
|
||||||
|
|
||||||
static bool button_state;
|
static bool button_state;
|
||||||
static bool button_pressed;
|
static bool button_pressed;
|
||||||
static bool button_released;
|
static bool button_released;
|
||||||
@ -79,6 +81,7 @@ void strike(char* reason) {
|
|||||||
ESP_LOGW("strike!", "%s", reason);
|
ESP_LOGW("strike!", "%s", reason);
|
||||||
lcd_set_cursor(&lcd, 0, 3);
|
lcd_set_cursor(&lcd, 0, 3);
|
||||||
lcd_print(&lcd, reason);
|
lcd_print(&lcd, reason);
|
||||||
|
set_game_time(get_game_time() - STRIKE_TIME_PENALTY);
|
||||||
uint8_t reg = 6;
|
uint8_t reg = 6;
|
||||||
ESP_ERROR_CHECK_WITHOUT_ABORT(i2c_master_write_to_device(WIRES_I2C_NUM, WIRES_I2C_ADDR, ®, 1, (100 / portTICK_PERIOD_MS)));
|
ESP_ERROR_CHECK_WITHOUT_ABORT(i2c_master_write_to_device(WIRES_I2C_NUM, WIRES_I2C_ADDR, ®, 1, (100 / portTICK_PERIOD_MS)));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
#include <driver/gpio.h>
|
#include <driver/gpio.h>
|
||||||
#include <esp_log.h>
|
#include <esp_log.h>
|
||||||
#include "drivers/char_lcd.h"
|
#include "drivers/char_lcd.h"
|
||||||
|
#include "drivers/game_timer.h"
|
||||||
|
|
||||||
#define WIRES_PIN_DELTA GPIO_NUM_2
|
#define WIRES_PIN_DELTA GPIO_NUM_2
|
||||||
#define WIRES_I2C_NUM I2C_NUM_1
|
#define WIRES_I2C_NUM I2C_NUM_1
|
||||||
|
|||||||
@ -44,7 +44,7 @@ extern "C" void app_main(void) {
|
|||||||
|
|
||||||
clean_bomb();
|
clean_bomb();
|
||||||
step0();
|
step0();
|
||||||
set_game_time(60*60*1000 + 1000);
|
set_game_time(initial_game_time + 1000);
|
||||||
start_game_timer();
|
start_game_timer();
|
||||||
clean_bomb();
|
clean_bomb();
|
||||||
if (skip_to_step <= 1) step1();
|
if (skip_to_step <= 1) step1();
|
||||||
|
|||||||
@ -327,7 +327,7 @@ void step2(void) {
|
|||||||
complete();
|
complete();
|
||||||
while (!play_game(4*60*1000, 4)) fail();
|
while (!play_game(4*60*1000, 4)) fail();
|
||||||
complete();
|
complete();
|
||||||
while (!play_game(8*60*1000, 8)) fail();
|
while (!play_game(6*60*1000, 8)) fail();
|
||||||
complete();
|
complete();
|
||||||
|
|
||||||
deinit_screen();
|
deinit_screen();
|
||||||
|
|||||||
@ -62,7 +62,7 @@ static bool six_second();
|
|||||||
|
|
||||||
void step4(void) {
|
void step4(void) {
|
||||||
// start counting down module timer immediatly
|
// start counting down module timer immediatly
|
||||||
set_module_time(20'000);
|
set_module_time(30'000);
|
||||||
start_module_timer();
|
start_module_timer();
|
||||||
|
|
||||||
while (get_module_time() > 0) vTaskDelay(pdMS_TO_TICKS(100));
|
while (get_module_time() > 0) vTaskDelay(pdMS_TO_TICKS(100));
|
||||||
@ -91,7 +91,7 @@ void step4(void) {
|
|||||||
clean_bomb();
|
clean_bomb();
|
||||||
play_raw(MOUNT_POINT "/correct.pcm");
|
play_raw(MOUNT_POINT "/correct.pcm");
|
||||||
}
|
}
|
||||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
vTaskDelay(pdMS_TO_TICKS(3000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user