Skip to content

Commit b033a77

Browse files
committed
fix: precommit
1 parent f499d4e commit b033a77

19 files changed

+432
-496
lines changed

ModbusApp/Modbus.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "scenes_config/app_scene_functions.h"
2121

22-
2322
#define PATHAPP "apps_data/modbus"
2423
#define PATHAPPEXT EXT_PATH(PATHAPP)
2524
#define PATHLOGS PATHAPPEXT "/logs"
@@ -155,4 +154,4 @@ extern const char* parityValues[];
155154
extern const char* saveLOGValues[];
156155
extern const char* outputFormatValues[];
157156
extern const char* functionNames[];
158-
extern const char* exceptionCodes[];
157+
extern const char* exceptionCodes[];

ModbusApp/modbus_ring_buffer/modbus_ring_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ void writeRingBuffer(RingBuffer* rb, uint8_t* buf, size_t len) {
2121
}
2222
}
2323
rb->delimiterIdx++;
24-
}
24+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#pragma once
1+
#pragma once
22

33
#include <furi.h>
44

55
#include "../Modbus.h"
66

77
RingBuffer* ring_buffer_alloc();
88
void ring_buffer_free(RingBuffer* buffer);
9-
void writeRingBuffer(RingBuffer* rb, uint8_t* buf, size_t len);
9+
void writeRingBuffer(RingBuffer* rb, uint8_t* buf, size_t len);

ModbusApp/modbus_sender/modbus_sender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ void ModbusSender(void* context) {
1616
furi_hal_gpio_write(&gpio_ext_pc1, false);
1717
app->modbus->slave = true;
1818
furi_timer_start(app->timer, app->uart->cfg->timeout * TIMEOUT_SCALER);
19-
}
19+
}

ModbusApp/modbus_sender/modbus_sender.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
#include "../Modbus.h"
66

7-
void ModbusSender(void* context);
7+
void ModbusSender(void* context);

ModbusApp/modbus_storage/modbus_storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ bool OpenLogFile(App* app) {
5959
furi_string_free(selected_filepath);
6060
furi_string_free(predefined_filepath);
6161
return true;
62-
}
62+
}

ModbusApp/modbus_storage/modbus_storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ char* sequential_file_resolve_path(
1010
const char* prefix,
1111
const char* extension);
1212
bool OpenLogFile(App* app);
13-
void makePaths(App* app);
13+
void makePaths(App* app);

ModbusApp/modbus_uart/modbus_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ int32_t uart_worker(void* context) {
124124
}
125125

126126
return 0;
127-
}
127+
}

ModbusApp/modbus_uart/modbus_uart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ void Serial_Begin(FuriHalSerialHandle* handle, LL_USART_InitTypeDef USART_InitSt
99
int32_t uart_worker(void* context);
1010
void timerDone(void* context);
1111
void serial_deinit(Uart* uart);
12-
void serial_init(Uart* uart, uint8_t uart_ch);
12+
void serial_init(Uart* uart, uint8_t uart_ch);

ModbusApp/scenes/byte_input_scene.c

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,52 @@
22

33
////////////////////////// ByteInput Scene ////////////////////////
44
void SetValue(void* context) {
5-
App* app = context;
6-
scene_manager_handle_back_event(app->sceneManager);
5+
App* app = context;
6+
scene_manager_handle_back_event(app->sceneManager);
77
}
88
void app_scene_byte_input_on_enter(void* context) {
9-
App* app = context;
10-
uint8_t* buf = app->msgBuf;
11-
uint8_t offset =
12-
scene_manager_get_scene_state(app->sceneManager, app_scene_byte_input);
13-
switch (scene_manager_get_scene_state(app->sceneManager, app_scene_byte_input)) {
9+
App* app = context;
10+
uint8_t* buf = app->msgBuf;
11+
uint8_t offset = scene_manager_get_scene_state(app->sceneManager, app_scene_byte_input);
12+
switch(scene_manager_get_scene_state(app->sceneManager, app_scene_byte_input)) {
1413
case 0:
15-
byte_input_set_header_text(app->byteInput, "Set Slave");
16-
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app,
17-
&SLAVE, 1);
18-
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
19-
break;
14+
byte_input_set_header_text(app->byteInput, "Set Slave");
15+
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app, &SLAVE, 1);
16+
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
17+
break;
2018
case 1:
21-
byte_input_set_header_text(app->byteInput, "Set Function");
22-
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app,
23-
&FUNCTION, 1);
24-
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
25-
break;
19+
byte_input_set_header_text(app->byteInput, "Set Function");
20+
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app, &FUNCTION, 1);
21+
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
22+
break;
2623
case 2:
27-
byte_input_set_header_text(app->byteInput, "Set Address");
28-
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app,
29-
&buf[2], 2);
30-
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
31-
break;
24+
byte_input_set_header_text(app->byteInput, "Set Address");
25+
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app, &buf[2], 2);
26+
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
27+
break;
3228
case 3:
33-
byte_input_set_header_text(app->byteInput, "Set value or quantity");
34-
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app,
35-
&buf[4], 2);
36-
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
37-
break;
29+
byte_input_set_header_text(app->byteInput, "Set value or quantity");
30+
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app, &buf[4], 2);
31+
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
32+
break;
3833
default:
39-
if (FUNCTION == 0x0F)
40-
offset += 2;
41-
else
42-
offset += offset - 3;
43-
byte_input_set_header_text(app->byteInput, "Set x value");
44-
byte_input_set_result_callback(app->byteInput, SetValue, NULL, app,
45-
&buf[offset], FUNCTION == 0x0F ? 1 : 2);
46-
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
47-
break;
48-
}
34+
if(FUNCTION == 0x0F)
35+
offset += 2;
36+
else
37+
offset += offset - 3;
38+
byte_input_set_header_text(app->byteInput, "Set x value");
39+
byte_input_set_result_callback(
40+
app->byteInput, SetValue, NULL, app, &buf[offset], FUNCTION == 0x0F ? 1 : 2);
41+
view_dispatcher_switch_to_view(app->viewDispatcher, ByteInput_View);
42+
break;
43+
}
4944
}
5045
bool app_scene_byte_input_on_event(void* context, SceneManagerEvent event) {
51-
UNUSED(context);
52-
UNUSED(event);
53-
return false;
46+
UNUSED(context);
47+
UNUSED(event);
48+
return false;
5449
}
5550
void app_scene_byte_input_on_exit(void* context) {
56-
App* app = context;
57-
UNUSED(app);
58-
}
51+
App* app = context;
52+
UNUSED(app);
53+
}

0 commit comments

Comments
 (0)