Orgasmotron fixes (#304)

This commit is contained in:
Willy-JL
2023-06-20 18:18:32 +01:00
parent eb20b89f25
commit 1009fc4031

View File

@@ -16,12 +16,9 @@ void vibro_test_draw_callback(Canvas* canvas, void* ctx) {
canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 2, 10, "Vibro Modes");
canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 2, 22, "LEFT: strong / RIGHT: Soft");
canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 2, 34, "UP: Pulsed");
canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 2, 46, "DOWN Pleasure combo");
canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 2, 22, "UP: Pulsed");
canvas_draw_str(canvas, 2, 34, "LEFT: strong / RIGHT: Soft");
canvas_draw_str(canvas, 2, 46, "DOWN: Pleasure combo");
canvas_draw_str(canvas, 2, 58, "OK: Pause");
}
@@ -59,20 +56,16 @@ int32_t orgasmotron_app(void* p) {
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
InputEvent event;
//int mode = 0;
bool processing = true;
//while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
size_t i = 0;
while(processing) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 50);
furi_mutex_acquire(plugin_state->mutex, FuriWaitForever);
if(event_status == FuriStatusOk) {
if(event.key == InputKeyBack && event.type == InputTypeShort) {
//Exit Application
notification_message(notification, &sequence_reset_vibro);
notification_message(notification, &sequence_reset_green);
plugin_state->mode = 0;
processing = false;
//break;
}
if(event.key == InputKeyOk &&
(event.type == InputTypePress || event.type == InputTypeRelease)) {
@@ -80,57 +73,80 @@ int32_t orgasmotron_app(void* p) {
}
if(event.key == InputKeyLeft &&
(event.type == InputTypePress || event.type == InputTypeRelease)) {
notification_message(notification, &sequence_set_green_255);
plugin_state->mode = 1;
}
if(event.key == InputKeyRight &&
(event.type == InputTypePress || event.type == InputTypeRelease)) {
notification_message(notification, &sequence_set_green_255);
plugin_state->mode = 3;
}
if(event.key == InputKeyUp &&
(event.type == InputTypePress || event.type == InputTypeRelease)) {
notification_message(notification, &sequence_set_green_255);
plugin_state->mode = 2;
}
if(event.key == InputKeyDown &&
(event.type == InputTypePress || event.type == InputTypeRelease)) {
notification_message(notification, &sequence_set_green_255);
plugin_state->mode = 4;
}
i = 0;
}
if(plugin_state->mode == 0) {
//Stop Vibration
notification_message(notification, &sequence_reset_vibro);
notification_message(notification, &sequence_reset_green);
if(i == 0) {
notification_message(notification, &sequence_reset_vibro);
notification_message(notification, &sequence_reset_green);
i++;
}
} else if(plugin_state->mode == 1) {
//Full power
notification_message(notification, &sequence_set_vibro_on);
notification_message(notification, &sequence_set_green_255);
if(i == 0) {
notification_message(notification, &sequence_set_vibro_on);
i++;
}
} else if(plugin_state->mode == 2) {
//Pulsed Vibration
notification_message(notification, &sequence_set_vibro_on);
notification_message(notification, &sequence_set_green_255);
delay(100);
notification_message(notification, &sequence_reset_vibro);
i++;
if(i == 1) {
notification_message(notification, &sequence_set_vibro_on);
}
if(i == 3) {
notification_message(notification, &sequence_reset_vibro);
}
if(i == 4) {
i = 0;
}
} else if(plugin_state->mode == 3) {
//Soft power
notification_message(notification, &sequence_set_vibro_on);
notification_message(notification, &sequence_set_green_255);
delay(50);
notification_message(notification, &sequence_reset_vibro);
i++;
if(i == 1) {
notification_message(notification, &sequence_set_vibro_on);
}
if(i == 2) {
notification_message(notification, &sequence_reset_vibro);
i = 0;
}
} else if(plugin_state->mode == 4) {
//Special Sequence
for(int i = 0; i < 15; i++) {
notification_message(notification, &sequence_set_vibro_on);
notification_message(notification, &sequence_set_green_255);
delay(50);
i++;
if(i < 23) {
if(i % 2) {
notification_message(notification, &sequence_set_vibro_on);
} else {
notification_message(notification, &sequence_reset_vibro);
}
} else if(i < 40) {
if(i == 24 || i == 33) {
notification_message(notification, &sequence_set_vibro_on);
} else if(i == 32) {
notification_message(notification, &sequence_reset_vibro);
}
} else if(i == 41) {
notification_message(notification, &sequence_reset_vibro);
delay(50);
}
for(int i = 0; i < 2; i++) {
notification_message(notification, &sequence_set_vibro_on);
notification_message(notification, &sequence_set_green_255);
delay(400);
notification_message(notification, &sequence_reset_vibro);
delay(50);
i = 0;
}
}
furi_mutex_release(plugin_state->mutex);