diff --git a/README.md b/README.md index 73e3f99c..f26a910e 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,11 @@ and is automatically generated. Here is a quick summary of config variables: |`edge_menu_lock`|Boolean|false|Deny access to menu starting in the edging session.| |`post_orgasm_menu_lock`|Boolean|false|Deny access to menu starting after orgasm detected.| |`max_clench_duration_ms`|Int|3000|Duration the clench detector can raise arousal if clench detector turned on in edging session.| +|`use_denial_count_in_sensitivity`|Boolean|false|Use denial count to increase sensitivity to edging. Reduces to risk of Oups over time.| |`clench_time_threshold_ms`|Int|900|Threshold variable that is milliseconds counts to detect the start of clench.| + \* AzureFang refers to a common wireless technology that is blue and involves chewing face-rocks. However, the trademark holders of this technology require the name to be licensed, so we're totally just using AzureFang. diff --git a/include/assets/config_help.h b/include/assets/config_help.h index b46c84d3..82752529 100644 --- a/include/assets/config_help.h +++ b/include/assets/config_help.h @@ -56,6 +56,7 @@ extern "C" { #define EDGE_MENU_LOCK_HELP _HELPSTR("Deny access to menu starting in the edging session.") #define POST_ORGASM_MENU_LOCK_HELP _HELPSTR("Deny access to menu starting after orgasm detected.") #define MAX_CLENCH_DURATION_MS_HELP _HELPSTR("Duration the clench detector can raise arousal if clench detector turned on in edging session.") +#define USE_DENIAL_COUNT_IN_SENSITIVITY_HELP _HELPSTR("Use denial count to increase sensitivity to edging. Reduces to risk of Oups over time.") #define CLENCH_TIME_THRESHOLD_MS_HELP _HELPSTR("Threshold variable that is milliseconds counts to detect the start of clench.") #ifdef __cplusplus diff --git a/include/config.h b/include/config.h index 1f9227b4..fbcb98f8 100644 --- a/include/config.h +++ b/include/config.h @@ -121,7 +121,8 @@ struct config { uint8_t sensor_sensitivity; // Use average values when calculating arousal. This smooths noisy data. bool use_average_values; - + // Use denial count to increase sensitivity to edging. Reduces to risk of Oups over time + bool use_denial_count_in_sensitivity; //= Vibration Output Mode // Vibration Mode for main vibrator control. diff --git a/src/config.c b/src/config.c index 94f79904..8bc753db 100644 --- a/src/config.c +++ b/src/config.c @@ -47,7 +47,9 @@ CONFIG_DEFS { CFG_NUMBER(motor_ramp_time_s, 30); CFG_NUMBER(update_frequency_hz, 50); CFG_NUMBER(sensor_sensitivity, 128); + CFG_BOOL(use_denial_count_in_sensitivity, false); CFG_BOOL(use_average_values, false); + // Vibration Settings CFG_ENUM(vibration_mode, vibration_mode_t, RampStop); diff --git a/src/menus/edging_settings_menu.c b/src/menus/edging_settings_menu.c index 602b4a20..998d62ed 100644 --- a/src/menus/edging_settings_menu.c +++ b/src/menus/edging_settings_menu.c @@ -111,6 +111,11 @@ static const ui_input_byte_t SENSOR_SENSITIVITY_INPUT = { .chart_getter = get_sensor_reading }; +static const ui_input_toggle_t USE_DENIAL_COUNT_IN_SENSITIVITY_INPUT = { + ToggleInputValues("Use Denial Count in Sensitivity", &Config.use_denial_count_in_sensitivity, on_config_save), + .input.help = USE_DENIAL_COUNT_IN_SENSITIVITY_HELP +}; + static void on_open(const ui_menu_t* m, UI_MENU_ARG_TYPE arg) { ui_menu_add_input(m, (ui_input_t*)&VIBRATION_MODE_INPUT); ui_menu_add_input(m, (ui_input_t*)&MOTOR_MAX_SPEED_INPUT); @@ -121,6 +126,7 @@ static void on_open(const ui_menu_t* m, UI_MENU_ARG_TYPE arg) { ui_menu_add_input(m, (ui_input_t*)&MINIMUM_ON_TIME_INPUT); ui_menu_add_input(m, (ui_input_t*)&AROUSAL_LIMIT_INPUT); ui_menu_add_input(m, (ui_input_t*)&SENSOR_SENSITIVITY_INPUT); + ui_menu_add_input(m, (ui_input_t*)&USE_DENIAL_COUNT_IN_SENSITIVITY_INPUT); } DYNAMIC_MENU(EDGING_SETTINGS_MENU, "Edging Settings", on_open); diff --git a/src/orgasm_control.c b/src/orgasm_control.c index fcf9cbe7..71dbec79 100644 --- a/src/orgasm_control.c +++ b/src/orgasm_control.c @@ -247,7 +247,8 @@ static void orgasm_control_updateMotorSpeed() { if (!time_out_over) { orgasm_control_twitch_detect(); - } else if (arousal_state.arousal > Config.sensitivity_threshold && + } else if (arousal_state.arousal > + (Config.sensitivity_threshold - ( Config.use_denial_count_in_sensitivity * arousal_state.denial_count)) && output_state.motor_speed > 0 && on_time > Config.minimum_on_time) { // The motor_speed check above, btw, is so we only hit this once per peak. // Set the motor speed to 0, set stop time, and determine the new additional random time.