Skip to content
Snippets Groups Projects
Commit a5e59148 authored by dx's avatar dx
Browse files

Spirals win and become the new default for proto6

parent bbe070e7
No related branches found
No related tags found
No related merge requests found
Pipeline #5650 passed
......@@ -31,7 +31,7 @@ menu "Badge23 Config"
choice BADGE23_TOP_BOARD_STYLE
prompt "Badge23 top board style (mainly for proto6)"
default BADGE23_TOP_BOARD_SPIKES
default BADGE23_TOP_BOARD_SPIRALS
config BADGE23_TOP_BOARD_SPIKES
help
Spikes between captouch pads
......
......@@ -302,7 +302,15 @@ int32_t captouch_get_petal_rad(uint8_t petal){
return (left + right)/2 - base;
}
#elif defined(CONFIG_BADGE23_TOP_BOARD_SPIRALS)
#error captouch_get_petal_rad not implemented for spirals
if(cf == 0b1110){ //CCW, CW, BASE
int32_t left = petals[petal].cdc_values[PETAL_PAD_CCW];
left -= petals[petal].amb_values[PETAL_PAD_CCW];
int32_t right = petals[petal].cdc_values[PETAL_PAD_CW];
right -= petals[petal].amb_values[PETAL_PAD_CW];
int32_t base = petals[petal].cdc_values[PETAL_PAD_BASE];
base -= petals[petal].amb_values[PETAL_PAD_BASE];
return (left + right)/2 - base;
}
#endif
if(cf == 0b111){ //CCW, CW, TIP
int32_t left = petals[petal].cdc_values[PETAL_PAD_CCW];
......@@ -340,7 +348,13 @@ int32_t captouch_get_petal_phi(uint8_t petal){
return left - right;
}
#elif defined(CONFIG_BADGE23_TOP_BOARD_SPIRALS)
#error captouch_get_petal_phi not implemented for spirals
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];
int32_t right = petals[petal].cdc_values[PETAL_PAD_CW];
right -= petals[petal].amb_values[PETAL_PAD_CW];
return left - right;
}
#endif
return 0;
}
......
......@@ -18,7 +18,7 @@ def action_extensions(base_actions, project_path=os.getcwd()):
'p3': ['proto3'],
'p4': ['proto4'],
'p6': ['proto6'],
'p6spiral': ['proto6-spiral'],
'p6spike': ['proto6-spike'],
}
def generation_callback(ctx, global_args, tasks):
......@@ -52,9 +52,9 @@ def action_extensions(base_actions, project_path=os.getcwd()):
sdkconfig_defaults_path = os.path.join(project_path, 'sdkconfig.defaults')
sdkconfig_generated_path = os.path.join(project_path, '.sdkconfig.defaults.generated')
with open(sdkconfig_generated_path, 'w') as f:
if name == 'p6spiral':
if name == 'p6spike':
f.write('CONFIG_BADGE23_HW_GEN_P6=y\n')
f.write('CONFIG_BADGE23_TOP_BOARD_SPIRALS=y\n')
f.write('CONFIG_BADGE23_TOP_BOARD_SPIKES=y\n')
else:
f.write(f'CONFIG_BADGE23_HW_GEN_{name.upper()}=y\n')
with open(sdkconfig_defaults_path) as f2:
......
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