Skip to content

Commit

Permalink
fix(fmw): precommit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xpeqex committed Nov 8, 2024
1 parent 7e3a14b commit 30519f6
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 17 deletions.
3 changes: 0 additions & 3 deletions Canbus_app/draw_functions/drawWidgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ void draw_in_development(App* app) {
widget_add_icon_element(app->widget, 41, 0, &I_WIP45x38);
widget_add_string_multiline_element(
app->widget, 65, 60, AlignCenter, AlignBottom, FontPrimary, "WORK IN\nPROGRESS");

}

// Draws device not connected
Expand All @@ -15,7 +14,6 @@ void draw_device_no_connected(App* app) {
widget_add_icon_element(app->widget, 4, 0, &I_NOC119x38);
widget_add_string_multiline_element(
app->widget, 65, 60, AlignCenter, AlignBottom, FontPrimary, "DEVICE NOT\nCONNECTED");

}

// draw when a message is not recognized
Expand All @@ -24,7 +22,6 @@ void draw_transmition_failure(App* app) {
widget_add_icon_element(app->widget, 43, 0, &I_MSGERROR41x38);
widget_add_string_multiline_element(
app->widget, 65, 60, AlignCenter, AlignBottom, FontPrimary, "TRANSMISSION\nFAILURE");

}

// draw when a message is send OK
Expand Down
20 changes: 15 additions & 5 deletions Canbus_app/scenes/Obd2Options/dtcPIDOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ static int32_t obdii_thread_dtc_on_work(void* context) {

widget_add_string_multiline_element(
app->widget, 65, 43, AlignCenter, AlignBottom, FontPrimary, "E R R O R\nCLEARING");

}
} else if(!delete_dtc && run) {
if(request_dtc(&scanner, &(count_dtc), codes)) {
Expand All @@ -119,8 +118,7 @@ static int32_t obdii_thread_dtc_on_work(void* context) {
} else {
widget_add_icon_element(app->widget, 43, 0, &I_MSGERROR41x38);
widget_add_string_multiline_element(
app->widget, 65,60, AlignCenter, AlignBottom, FontPrimary, "REQUEST\nERROR");

app->widget, 65, 60, AlignCenter, AlignBottom, FontPrimary, "REQUEST\nERROR");
}

} else {
Expand Down Expand Up @@ -149,14 +147,26 @@ static int32_t obdii_thread_dtc_on_work(void* context) {
furi_string_printf(text, "%u of %u DTC", dtc_selector + 1, count_dtc);

widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignBottom, FontSecondary, furi_string_get_cstr(text));
app->widget,
65,
20,
AlignCenter,
AlignBottom,
FontSecondary,
furi_string_get_cstr(text));

furi_string_reset(text);

furi_string_printf(text, "%s", codes[dtc_selector]);

widget_add_string_element(
app->widget, 65, 35, AlignCenter, AlignBottom, FontPrimary, furi_string_get_cstr(text));
app->widget,
65,
35,
AlignCenter,
AlignBottom,
FontPrimary,
furi_string_get_cstr(text));

past_selector = dtc_selector;
}
Expand Down
16 changes: 14 additions & 2 deletions Canbus_app/scenes/Obd2Options/getCarDataOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ static int32_t obdii_get_car_data(void* context) {
widget_add_string_element(
app->widget, 64, 36, AlignCenter, AlignCenter, FontPrimary, "VIN Number:");
widget_add_string_element(
app->widget, 64, 51, AlignCenter, AlignCenter, FontSecondary, furi_string_get_cstr(app->text));
app->widget,
64,
51,
AlignCenter,
AlignCenter,
FontSecondary,
furi_string_get_cstr(app->text));
} else {
draw_transmition_failure(app);
}
Expand All @@ -67,7 +73,13 @@ static int32_t obdii_get_car_data(void* context) {
app->widget, 65, 40, AlignCenter, AlignCenter, FontPrimary, "ECU Name:");

widget_add_string_element(
app->widget, 64, 55, AlignCenter, AlignCenter, FontSecondary, furi_string_get_cstr(app->text));
app->widget,
64,
55,
AlignCenter,
AlignCenter,
FontSecondary,
furi_string_get_cstr(app->text));
} else {
draw_transmition_failure(app);
}
Expand Down
12 changes: 9 additions & 3 deletions Canbus_app/scenes/Obd2Options/typicalPIDOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ void draw_scene(App* app, uint8_t selector, uint16_t variable) {
widget_add_icon_element(app->widget, 50, 3, &I_RPM30x23);
widget_add_string_element(
app->widget, 65, 40, AlignCenter, AlignBottom, FontPrimary, "ENGINE SPEED");

text = "RPM";

} else if(selector == 1) { // Vehicle Speed
widget_add_icon_element(app->widget, 37, 5, &I_SPD64x20);
widget_add_string_element(
app->widget, 65, 40, AlignCenter, AlignBottom, FontPrimary, "VEHICLE SPEED");

text = "km/h";

} else if(selector == 2) { // CALCULATED ENGINE LOAD
Expand All @@ -114,7 +114,13 @@ void draw_scene(App* app, uint8_t selector, uint16_t variable) {
} else if(selector == 5) { // Thortle Relative Position
widget_add_icon_element(app->widget, 46, 0, &I_THR36x24);
widget_add_string_multiline_element(
app->widget, 65, 45, AlignCenter, AlignBottom, FontPrimary, "THROTTLE\nRELATIVE POSITION");
app->widget,
65,
45,
AlignCenter,
AlignBottom,
FontPrimary,
"THROTTLE\nRELATIVE POSITION");

text = "%";
} else if(selector == 6) {
Expand Down
17 changes: 14 additions & 3 deletions Canbus_app/scenes/playLogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ void draw_message_send(App* app) {
app->widget, 62, 25, AlignCenter, AlignBottom, FontPrimary, "Sending...");

widget_add_string_element(
app->widget, 62, 40, AlignCenter, AlignBottom, FontSecondary, furi_string_get_cstr(app->text));

app->widget,
62,
40,
AlignCenter,
AlignBottom,
FontSecondary,
furi_string_get_cstr(app->text));
}

// Message sent fail
Expand All @@ -105,7 +110,13 @@ void draw_message_fail(App* app) {
app->widget, 62, 30, AlignCenter, AlignBottom, FontPrimary, "Sending Failed...");

widget_add_string_element(
app->widget, 62, 50, AlignCenter,AlignBottom, FontSecondary, furi_string_get_cstr(app->text));
app->widget,
62,
50,
AlignCenter,
AlignBottom,
FontSecondary,
furi_string_get_cstr(app->text));
}

void draw_finished(App* app) {
Expand Down
8 changes: 7 additions & 1 deletion Canbus_app/scenes/senderOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,13 @@ void app_scene_warning_log_on_enter(void* context) {
app->widget, 65, 20, AlignCenter, AlignBottom, FontPrimary, "W A R N I N G !");

widget_add_string_multiline_element(
app->widget, 65, 35, AlignCenter, AlignCenter, FontSecondary, "First go to the Sniffing option\nin the menu and get the ID's");
app->widget,
65,
35,
AlignCenter,
AlignCenter,
FontSecondary,
"First go to the Sniffing option\nin the menu and get the ID's");

view_dispatcher_switch_to_view(app->view_dispatcher, ViewWidget);
}
Expand Down

0 comments on commit 30519f6

Please sign in to comment.