diff --git a/components/badge23/Kconfig b/components/badge23/Kconfig index cc2007431a7e0d625187687bad981061cccb1fd9..8fe87d4d74fa2c5855d712efd3d91d55b195bae8 100644 --- a/components/badge23/Kconfig +++ b/components/badge23/Kconfig @@ -28,4 +28,18 @@ menu "Badge23 Config" - Sticker with B6xx (xx being arbitrary digits) on the back bool "Prototype 6" endchoice + + choice BADGE23_TOP_BOARD_STYLE + prompt "Badge23 top board style (mainly for proto6)" + default BADGE23_TOP_BOARD_SPIKES + config BADGE23_TOP_BOARD_SPIKES + help + Spikes between captouch pads + bool "Spikes" + config BADGE23_TOP_BOARD_SPIRALS + help + Spirals between captouch pads + bool "Spirals" + endchoice + endmenu diff --git a/components/badge23/captouch.c b/components/badge23/captouch.c index 6163b0103e8c024a1d363f6557eb3e9af8ad4b15..053986283bcc092cf5f568558ad4354b469d1ad2 100644 --- a/components/badge23/captouch.c +++ b/components/badge23/captouch.c @@ -291,6 +291,7 @@ static void captouch_init_petals(){ int32_t captouch_get_petal_rad(uint8_t petal){ if(petal > 9) petal = 9; uint8_t cf = petals[petal].config_mask; + #if defined(CONFIG_BADGE23_TOP_BOARD_SPIKES) if(cf == 0b1110){ //CCW, CW, BASE int32_t left = petals[petal].cdc_values[PETAL_PAD_CCW]; left -= petals[petal].amb_values[PETAL_PAD_CCW]; @@ -300,6 +301,9 @@ int32_t captouch_get_petal_rad(uint8_t petal){ base -= petals[petal].amb_values[PETAL_PAD_BASE]; return (left + right)/2 - base; } + #elif defined(CONFIG_BADGE23_TOP_BOARD_SPIRALS) + #error captouch_get_petal_rad not implemented for spirals + #endif if(cf == 0b111){ //CCW, CW, TIP int32_t left = petals[petal].cdc_values[PETAL_PAD_CCW]; left -= petals[petal].amb_values[PETAL_PAD_CCW]; @@ -327,6 +331,7 @@ int32_t captouch_get_petal_rad(uint8_t petal){ int32_t captouch_get_petal_phi(uint8_t petal){ if(petal > 9) petal = 9; uint8_t cf = petals[petal].config_mask; + #if defined(CONFIG_BADGE23_TOP_BOARD_SPIKES) if((cf == 0b1110) || (cf == 0b110) || (cf == 0b111)){ //CCW, CW, (BASE) int32_t left = petals[petal].cdc_values[PETAL_PAD_CCW]; left -= petals[petal].amb_values[PETAL_PAD_CCW]; @@ -334,6 +339,9 @@ int32_t captouch_get_petal_phi(uint8_t petal){ right -= petals[petal].amb_values[PETAL_PAD_CW]; return left - right; } + #elif defined(CONFIG_BADGE23_TOP_BOARD_SPIRALS) + #error captouch_get_petal_phi not implemented for spirals + #endif return 0; } diff --git a/idf_ext.py b/idf_ext.py index f4a31d7b894efae6ab46f5eb5cec30cdb69308c1..df7432b87cf082153b93e9c3182af7df721b4d4d 100644 --- a/idf_ext.py +++ b/idf_ext.py @@ -18,6 +18,7 @@ def action_extensions(base_actions, project_path=os.getcwd()): 'p3': ['proto3'], 'p4': ['proto4'], 'p6': ['proto6'], + 'p6spiral': ['proto6-spiral'], } def generation_callback(ctx, global_args, tasks): @@ -60,7 +61,7 @@ def action_extensions(base_actions, project_path=os.getcwd()): extensions = { 'global_options': [{ 'names': ['-g', '--generation'], - 'help': 'Specify badge generation to build for (one of: proto1, proto3, proto4). Defaults to proto4.', + 'help': 'Specify badge generation to build for (one of: proto1, proto3, proto4, proto6, proto6-spiral). Defaults to proto4.', 'scope': 'shared', 'multiple': False, }], diff --git a/sdkconfig.p6 b/sdkconfig.p6 index 4f1324ff0953fb007b18224ba137a5fd004fd32e..f8297878d40d22d1b0df1be10c8fa5014f9813ee 100644 --- a/sdkconfig.p6 +++ b/sdkconfig.p6 @@ -40,3 +40,4 @@ CONFIG_LWIP_PPP_SUPPORT=y CONFIG_LWIP_PPP_PAP_SUPPORT=y CONFIG_LWIP_PPP_CHAP_SUPPORT=y CONFIG_BADGE23_HW_GEN_P6=y +CONFIG_BADGE23_TOP_BOARD_SPIKES=y diff --git a/sdkconfig.p6spiral b/sdkconfig.p6spiral new file mode 100644 index 0000000000000000000000000000000000000000..4d8098e0a2786e98eeb1410699e3786e8cd22383 --- /dev/null +++ b/sdkconfig.p6spiral @@ -0,0 +1,43 @@ +CONFIG_APP_EXCLUDE_PROJECT_VER_VAR=y +CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR=y +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_ESPTOOLPY_NO_STUB=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +CONFIG_ESPTOOLPY_AFTER_NORESET=y +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="micropython/ports/esp32/partitions-8MiB.csv" +CONFIG_COMPILER_OPTIMIZATION_PERF=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4 +CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y +CONFIG_ESP32S3_DATA_CACHE_64KB=y +CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=65536 +CONFIG_PM_ENABLE=y +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y +# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set +# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 is not set +# CONFIG_ESP32_WIFI_IRAM_OPT is not set +# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set +CONFIG_FATFS_LFN_HEAP=y +CONFIG_FATFS_API_ENCODING_UTF_8=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=2 +CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP=y +CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y +CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y +CONFIG_LOG_DEFAULT_LEVEL_ERROR=y +CONFIG_LWIP_PPP_SUPPORT=y +CONFIG_LWIP_PPP_PAP_SUPPORT=y +CONFIG_LWIP_PPP_CHAP_SUPPORT=y +CONFIG_BADGE23_HW_GEN_P6=y +CONFIG_BADGE23_TOP_BOARD_SPIRALS=y