update steps
This commit is contained in:
parent
ec75439cc4
commit
5534cd733e
@ -786,7 +786,7 @@ void step3(void) {
|
||||
} else if (key == KeypadKey::pound) {
|
||||
// submit
|
||||
if (entered_string != answer_string) {
|
||||
strike("Entered answer is not correct! (step 3, puzzle 7)");
|
||||
strike("Incorrect answer!");
|
||||
} else {
|
||||
solved_puzzles++;
|
||||
solved_correctly = true;
|
||||
@ -805,7 +805,7 @@ void step3(void) {
|
||||
lcd_print(&lcd, entered_string.c_str());
|
||||
}
|
||||
if (get_module_time() <= 0) {
|
||||
strike("Ran out of time! (step 3, puzzle 7)");
|
||||
strike("Ran out of time!");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -873,7 +873,7 @@ void step3(void) {
|
||||
} else if (key == KeypadKey::pound) {
|
||||
// submit
|
||||
if (entered_string != answer_num) {
|
||||
strike("Entered answer is not correct! (step 3, puzzle 7)");
|
||||
strike("Incorrect answer!");
|
||||
} else {
|
||||
solved_times++;
|
||||
}
|
||||
@ -891,7 +891,7 @@ void step3(void) {
|
||||
lcd_print(&lcd, entered_string.c_str());
|
||||
}
|
||||
if (get_module_time() <= 0) {
|
||||
strike("Ran out of time! (step 3, puzzle 7)");
|
||||
strike("Ran out of time!");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include "step4.h"
|
||||
|
||||
#define ONE_SECOND_TIME 60'000
|
||||
#define THREE_SECOND_TIME 60'000
|
||||
#define SIX_SECOND_TIME 60'000
|
||||
#define ONE_SECOND_TIME 90'000
|
||||
#define THREE_SECOND_TIME 90'000
|
||||
#define SIX_SECOND_TIME 90'000
|
||||
|
||||
static const char *TAG = "step4";
|
||||
|
||||
@ -70,31 +70,27 @@ void step4(void) {
|
||||
while (times < 4) {
|
||||
tone = tone_dist(gen);
|
||||
// tone = 2;
|
||||
while (get_pressed_button(nullptr)) vTaskDelay(pdMS_TO_TICKS(10));
|
||||
|
||||
play_raw(TONE_FILES[tone]);
|
||||
|
||||
bool correct = false;
|
||||
switch (tone % 3) {
|
||||
case 0:
|
||||
if (one_second()) {
|
||||
times++;
|
||||
clean_bomb();
|
||||
play_raw(MOUNT_POINT "/correct.pcm");
|
||||
}
|
||||
correct = one_second();
|
||||
break;
|
||||
case 1:
|
||||
if (three_second()) {
|
||||
times++;
|
||||
clean_bomb();
|
||||
play_raw(MOUNT_POINT "/correct.pcm");
|
||||
}
|
||||
correct = three_second();
|
||||
break;
|
||||
case 2:
|
||||
if (six_second()) {
|
||||
correct = six_second();
|
||||
break;
|
||||
}
|
||||
if (correct) {
|
||||
times++;
|
||||
clean_bomb();
|
||||
play_raw(MOUNT_POINT "/correct.pcm");
|
||||
}
|
||||
break;
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
}
|
||||
@ -258,6 +254,8 @@ static bool three_second() {
|
||||
|
||||
bool was_high = (tone / 3) == 1;
|
||||
|
||||
|
||||
|
||||
rng_leds();
|
||||
write_leds();
|
||||
int red_led_count = 0;
|
||||
@ -277,6 +275,9 @@ static bool three_second() {
|
||||
(lcd_number >> 1) & 1,
|
||||
(lcd_number >> 0) & 1
|
||||
);
|
||||
if (!was_high) {
|
||||
correct_switches = (~correct_switches) & 0b1111;
|
||||
}
|
||||
|
||||
uint8_t correct_button_mask = 0b1110;
|
||||
uint8_t correct_buttons = four_bit_flag(
|
||||
|
||||
@ -88,24 +88,36 @@ void step5(void) {
|
||||
int solved_times = 0;
|
||||
|
||||
new_puzzle();
|
||||
int strike_time = xTaskGetTickCount();
|
||||
bool striked = false;
|
||||
while(solved_times < 3) {
|
||||
// for every bit in the answer-
|
||||
set_module_sseg_raw(display_map);
|
||||
if (get_pressed_keypad(&key)) {
|
||||
lcd_clear(&lcd);
|
||||
char c = char_of_keypad_key(key);
|
||||
// ESP_LOGI(TAG, "Pressed: %c", c);
|
||||
if (c == answer_char) {
|
||||
play_raw(MOUNT_POINT "/correct.pcm");
|
||||
solved_times++;
|
||||
if (solved_times < 3) {
|
||||
clean_bomb();
|
||||
new_puzzle();
|
||||
} else {
|
||||
uint8_t display_tmp[4] = {0b00000000, 0b00000000, 0b00000000, 0b00000000};
|
||||
set_module_sseg_raw(display_tmp);
|
||||
}
|
||||
} else {
|
||||
strike_time = xTaskGetTickCount();
|
||||
striked = true;
|
||||
strike("Incorrect Character!");
|
||||
}
|
||||
}
|
||||
|
||||
if (xTaskGetTickCount() - strike_time > pdMS_TO_TICKS(5000)) {
|
||||
striked = false;
|
||||
lcd_clear(&lcd);
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(10));
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
#include "../drivers/wires.h"
|
||||
#include "../drivers/game_timer.h"
|
||||
#include "../drivers/leds.h"
|
||||
#include "../drivers/speaker.h"
|
||||
#include "../helper.h"
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <map>
|
||||
|
||||
@ -40,7 +40,7 @@ void step6(void) {
|
||||
if (correct) {
|
||||
return;
|
||||
} else {
|
||||
strike("Not all wires are cut!");
|
||||
strike("Not all wires cut!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
sdkconfig
16
sdkconfig
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file. DO NOT EDIT.
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.2.2 Project Configuration
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.2.1 Project Configuration
|
||||
#
|
||||
CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000
|
||||
CONFIG_SOC_MPU_REGIONS_MAX_NUM=8
|
||||
@ -331,7 +331,6 @@ CONFIG_SOC_WIFI_WAPI_SUPPORT=y
|
||||
CONFIG_SOC_WIFI_CSI_SUPPORT=y
|
||||
CONFIG_SOC_WIFI_MESH_SUPPORT=y
|
||||
CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y
|
||||
CONFIG_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND=y
|
||||
CONFIG_SOC_BLE_SUPPORTED=y
|
||||
CONFIG_SOC_BLE_MESH_SUPPORTED=y
|
||||
CONFIG_SOC_BLE_50_SUPPORTED=y
|
||||
@ -436,7 +435,6 @@ CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y
|
||||
CONFIG_ESP_ROM_USB_OTG_NUM=3
|
||||
CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=4
|
||||
CONFIG_ESP_ROM_HAS_ERASE_0_REGION_BUG=y
|
||||
CONFIG_ESP_ROM_HAS_ENCRYPTED_WRITES_USING_LEGACY_DRV=y
|
||||
CONFIG_ESP_ROM_GET_CLK_FREQ=y
|
||||
CONFIG_ESP_ROM_HAS_HAL_WDT=y
|
||||
CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y
|
||||
@ -559,7 +557,6 @@ CONFIG_APPTRACE_LOCK_ENABLE=y
|
||||
# Bluetooth
|
||||
#
|
||||
# CONFIG_BT_ENABLED is not set
|
||||
CONFIG_BT_ALARM_MAX_NUM=50
|
||||
# end of Bluetooth
|
||||
|
||||
#
|
||||
@ -747,10 +744,7 @@ CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y
|
||||
#
|
||||
# GDB Stub
|
||||
#
|
||||
CONFIG_ESP_GDBSTUB_ENABLED=y
|
||||
# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set
|
||||
CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y
|
||||
CONFIG_ESP_GDBSTUB_MAX_TASKS=32
|
||||
# end of GDB Stub
|
||||
|
||||
#
|
||||
@ -915,7 +909,6 @@ CONFIG_ESP_PHY_RF_CAL_PARTIAL=y
|
||||
# CONFIG_ESP_PHY_RF_CAL_NONE is not set
|
||||
# CONFIG_ESP_PHY_RF_CAL_FULL is not set
|
||||
CONFIG_ESP_PHY_CALIBRATION_MODE=0
|
||||
# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set
|
||||
# end of PHY
|
||||
|
||||
#
|
||||
@ -1213,7 +1206,6 @@ CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
|
||||
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1
|
||||
# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set
|
||||
# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set
|
||||
# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set
|
||||
# end of Kernel
|
||||
|
||||
#
|
||||
@ -1501,9 +1493,7 @@ CONFIG_MBEDTLS_CMAC_C=y
|
||||
CONFIG_MBEDTLS_HARDWARE_AES=y
|
||||
CONFIG_MBEDTLS_AES_USE_INTERRUPT=y
|
||||
CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0
|
||||
# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set
|
||||
CONFIG_MBEDTLS_HARDWARE_MPI=y
|
||||
# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set
|
||||
CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y
|
||||
CONFIG_MBEDTLS_MPI_INTERRUPT_LEVEL=0
|
||||
CONFIG_MBEDTLS_HARDWARE_SHA=y
|
||||
@ -1590,7 +1580,7 @@ CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y
|
||||
# CONFIG_MBEDTLS_CHACHA20_C is not set
|
||||
# CONFIG_MBEDTLS_HKDF_C is not set
|
||||
# CONFIG_MBEDTLS_THREADING_C is not set
|
||||
CONFIG_MBEDTLS_ERROR_STRINGS=y
|
||||
# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set
|
||||
# end of mbedTLS
|
||||
|
||||
#
|
||||
@ -2235,8 +2225,6 @@ CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
|
||||
# CONFIG_EVENT_LOOP_PROFILING is not set
|
||||
CONFIG_POST_EVENTS_FROM_ISR=y
|
||||
CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
|
||||
CONFIG_GDBSTUB_SUPPORT_TASKS=y
|
||||
CONFIG_GDBSTUB_MAX_TASKS=32
|
||||
# CONFIG_OTA_ALLOW_HTTP is not set
|
||||
# CONFIG_ESP_SYSTEM_PD_FLASH is not set
|
||||
CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000
|
||||
|
||||
Loading…
Reference in New Issue
Block a user