Skip to content
Snippets Groups Projects
Commit ee83ffca authored by q3k's avatar q3k
Browse files

*: kill p6 spike/spirals difference

We're going with spirals for the production model, and the code fork
doesn't make much sense anyway, as it all ended up being the same (so
far). Whenever the behaviour between spiral/spikes changes, we should
just drop support for spikes.
parent d8680698
No related branches found
No related tags found
No related merge requests found
...@@ -272,7 +272,6 @@ static void captouch_init_petals(){ ...@@ -272,7 +272,6 @@ static void captouch_init_petals(){
int32_t captouch_get_petal_rad(uint8_t petal){ int32_t captouch_get_petal_rad(uint8_t petal){
if(petal > 9) petal = 9; if(petal > 9) petal = 9;
uint8_t cf = petals[petal].config_mask; uint8_t cf = petals[petal].config_mask;
#if defined(CONFIG_FLOW3R_TOP_BOARD_SPIKES)
if(cf == 0b1110){ //CCW, CW, BASE if(cf == 0b1110){ //CCW, CW, BASE
int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc; int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc;
left -= petals[petal].pads[PETAL_PAD_CCW].amb; left -= petals[petal].pads[PETAL_PAD_CCW].amb;
...@@ -282,17 +281,6 @@ int32_t captouch_get_petal_rad(uint8_t petal){ ...@@ -282,17 +281,6 @@ int32_t captouch_get_petal_rad(uint8_t petal){
base -= petals[petal].pads[PETAL_PAD_BASE].amb; base -= petals[petal].pads[PETAL_PAD_BASE].amb;
return (left + right)/2 - base; return (left + right)/2 - base;
} }
#elif defined(CONFIG_FLOW3R_TOP_BOARD_SPIRALS)
if(cf == 0b1110){ //CCW, CW, BASE
int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc;
left -= petals[petal].pads[PETAL_PAD_CCW].amb;
int32_t right = petals[petal].pads[PETAL_PAD_CW].cdc;
right -= petals[petal].pads[PETAL_PAD_CW].amb;
int32_t base = petals[petal].pads[PETAL_PAD_BASE].cdc;
base -= petals[petal].pads[PETAL_PAD_BASE].amb;
return (left + right)/2 - base;
}
#endif
if(cf == 0b111){ //CCW, CW, TIP if(cf == 0b111){ //CCW, CW, TIP
int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc; int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc;
left -= petals[petal].pads[PETAL_PAD_CCW].amb; left -= petals[petal].pads[PETAL_PAD_CCW].amb;
...@@ -320,15 +308,6 @@ int32_t captouch_get_petal_rad(uint8_t petal){ ...@@ -320,15 +308,6 @@ int32_t captouch_get_petal_rad(uint8_t petal){
int32_t captouch_get_petal_phi(uint8_t petal){ int32_t captouch_get_petal_phi(uint8_t petal){
if(petal > 9) petal = 9; if(petal > 9) petal = 9;
uint8_t cf = petals[petal].config_mask; uint8_t cf = petals[petal].config_mask;
#if defined(CONFIG_FLOW3R_TOP_BOARD_SPIKES)
if((cf == 0b1110) || (cf == 0b110) || (cf == 0b111)){ //CCW, CW, (BASE)
int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc;
left -= petals[petal].pads[PETAL_PAD_CCW].amb;
int32_t right = petals[petal].pads[PETAL_PAD_CW].cdc;
right -= petals[petal].pads[PETAL_PAD_CW].amb;
return left - right;
}
#elif defined(CONFIG_FLOW3R_TOP_BOARD_SPIRALS)
if((cf == 0b1110) || (cf == 0b110) || (cf == 0b111)){ //CCW, CW, (BASE) if((cf == 0b1110) || (cf == 0b110) || (cf == 0b111)){ //CCW, CW, (BASE)
int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc; int32_t left = petals[petal].pads[PETAL_PAD_CCW].cdc;
left -= petals[petal].pads[PETAL_PAD_CCW].amb; left -= petals[petal].pads[PETAL_PAD_CCW].amb;
...@@ -336,7 +315,6 @@ int32_t captouch_get_petal_phi(uint8_t petal){ ...@@ -336,7 +315,6 @@ int32_t captouch_get_petal_phi(uint8_t petal){
right -= petals[petal].pads[PETAL_PAD_CW].amb; right -= petals[petal].pads[PETAL_PAD_CW].amb;
return left - right; return left - right;
} }
#endif
return 0; return 0;
} }
......
...@@ -24,19 +24,6 @@ menu "Flow3r Config" ...@@ -24,19 +24,6 @@ menu "Flow3r Config"
bool "Prototype 6" bool "Prototype 6"
endchoice endchoice
choice FLOW3R_TOP_BOARD_STYLE
prompt "Badge23 top board style (mainly for proto6)"
default FLOW3R_TOP_BOARD_SPIRALS
config FLOW3R_TOP_BOARD_SPIKES
help
Spikes between captouch pads
bool "Spikes"
config FLOW3R_TOP_BOARD_SPIRALS
help
Spirals between captouch pads
bool "Spirals"
endchoice
config FLOW3R_ESP32S3 config FLOW3R_ESP32S3
bool bool
......
...@@ -17,7 +17,6 @@ def action_extensions(base_actions, project_path=os.getcwd()): ...@@ -17,7 +17,6 @@ def action_extensions(base_actions, project_path=os.getcwd()):
'p3': ['proto3'], 'p3': ['proto3'],
'p4': ['proto4'], 'p4': ['proto4'],
'p6': ['proto6'], 'p6': ['proto6'],
'p6spike': ['proto6-spike'],
} }
def generation_callback(ctx, global_args, tasks): def generation_callback(ctx, global_args, tasks):
...@@ -51,11 +50,7 @@ def action_extensions(base_actions, project_path=os.getcwd()): ...@@ -51,11 +50,7 @@ def action_extensions(base_actions, project_path=os.getcwd()):
sdkconfig_defaults_path = os.path.join(project_path, 'sdkconfig.defaults') sdkconfig_defaults_path = os.path.join(project_path, 'sdkconfig.defaults')
sdkconfig_generated_path = os.path.join(project_path, '.sdkconfig.defaults.generated') sdkconfig_generated_path = os.path.join(project_path, '.sdkconfig.defaults.generated')
with open(sdkconfig_generated_path, 'w') as f: with open(sdkconfig_generated_path, 'w') as f:
if name == 'p6spike': f.write(f'CONFIG_FLOW3R_HW_GEN_{name.upper()}=y\n')
f.write('CONFIG_FLOW3R_HW_GEN_P6=y\n')
f.write('CONFIG_FLOW3R_TOP_BOARD_SPIKES=y\n')
else:
f.write(f'CONFIG_FLOW3R_HW_GEN_{name.upper()}=y\n')
with open(sdkconfig_defaults_path) as f2: with open(sdkconfig_defaults_path) as f2:
f.write(f2.read()) f.write(f2.read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment