Skip to content

Commit

Permalink
Merge pull request #12 from ElectronicCats/dev
Browse files Browse the repository at this point in the history
Patch to get the messages from the ECU
  • Loading branch information
sabas1080 authored Nov 1, 2024
2 parents a85ca9d + f2adc35 commit b62d16f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Canbus_app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ dist/*
.editorconfig
.env
.ufbt

# Ignore the makefile
Makefile
4 changes: 2 additions & 2 deletions Canbus_app/libraries/mcp_can_2515.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,10 @@ ERROR_CAN send_can_message(FuriHalSpiBusHandle* spi, CANFRAME* frame, uint8_t tx

furi_hal_spi_release(spi);

read_register(spi, free_buffer - 1, &is_send_it);
furi_delay_us(1);
if(is_send_it == 0) res = ERROR_OK;

} while((res != ERROR_OK) && ((furi_get_tick() - time_waiting) < 1));
} while((res != ERROR_OK) && ((furi_get_tick() - time_waiting) < 5));

if(is_send_it) return res;

Expand Down
2 changes: 1 addition & 1 deletion Canbus_app/libraries/pid_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ bool read_frames(MCP2515* CAN, CANFRAME* frame) {
uint32_t time_delay = 0;

do {
if(read_can_message(CAN, frame)) {
if(read_can_message(CAN, frame) == ERROR_OK) {
if(frame->canId == 0x7e8) return true;
}
furi_delay_us(1);
Expand Down
2 changes: 1 addition & 1 deletion Canbus_app/scenes/AboutUs.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void draw_can_app_view(App* app) {
widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignCenter, FontPrimary, "CANBUS APP");
widget_add_string_element(
app->widget, 65, 35, AlignCenter, AlignCenter, FontSecondary, "v1.2");
app->widget, 65, 35, AlignCenter, AlignCenter, FontSecondary, "v1.1.3");

widget_add_button_element(app->widget, GuiButtonTypeRight, "Next", button_callback, app);
widget_add_button_element(app->widget, GuiButtonTypeLeft, "Prev", button_callback, app);
Expand Down
4 changes: 2 additions & 2 deletions Canbus_app/scenes/Obd2Options/manualPIDSenderOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ void app_scene_manual_sender_pid_on_enter(void* context) {
furi_string_reset(text);
furi_string_cat_printf(text, "0x%x", service_to_send);
item = variable_item_list_add(
app->varList, "Service", 96, callback_manual_pid_sender_options, app);
app->varList, "Service", 11, callback_manual_pid_sender_options, app);
variable_item_set_current_value_index(item, service_to_send);
variable_item_set_current_value_text(item, furi_string_get_cstr(text));

// Third item COUNT OF BYTES [2]
furi_string_reset(text);
furi_string_cat_printf(text, "%u", count_of_bytes);
item = variable_item_list_add(
app->varList, "Count Bytes", 7, callback_manual_pid_sender_options, app);
app->varList, "Count Bytes", 3, callback_manual_pid_sender_options, app);
variable_item_set_current_value_index(item, 0);
variable_item_set_current_value_text(item, furi_string_get_cstr(text));
variable_item_set_current_value_index(item, count_of_bytes);
Expand Down

0 comments on commit b62d16f

Please sign in to comment.