Minor code cleanup

This commit is contained in:
Julian Frohmüller
2026-07-23 13:02:33 +02:00
parent 31201025de
commit 3afb045fbd
3 changed files with 16 additions and 12 deletions
+1 -4
View File
@@ -154,6 +154,7 @@ static int asclepius_setup_tty(void)
}
tcflush(asclepius_serial_port, TCIOFLUSH);
return 0;
}
@@ -330,10 +331,6 @@ int asclepius_get_status(void)
return 0;
}
// -----------------------------------------------------------------------
// Ext UART (secondary serial port)
// -----------------------------------------------------------------------
static int asclepius_ext_baud_to_constant(int baud)
{
switch (baud)
+14 -7
View File
@@ -13,11 +13,6 @@
#include <termios.h>
#include <unistd.h>
extern char asclepius_tty_device_ccc[256];
extern char asclepius_ext_tty_device_ccc[256];
extern int asclepius_ext_baud_rate_ccc;
extern bool asclepius_ext_connected;
extern int asclepius_ext_serial_port;
#define ASCLEPIUS_BAUDRATE B115200
#define ASCLEPIUS_STATUS_IOCMD 1
@@ -30,14 +25,22 @@ extern int asclepius_ext_serial_port;
#define ASCLEPIUS_MOLEX 4
#define ASCLEPIUS_ALL 5
#define ASCLEPIUS_STATUS_PACKET_SIZE 28
#define ASCLEPIUS_UI_UPDATE_TIMER 500
extern char asclepius_tty_device_ccc[256];
extern char asclepius_ext_tty_device_ccc[256];
extern int asclepius_ext_baud_rate_ccc;
extern bool asclepius_ext_connected;
extern int asclepius_ext_serial_port;
struct
{
uint8_t command;
uint8_t channel;
} asclepius_command;
#define ASCLEPIUS_STATUS_PACKET_SIZE 28
struct
{
bool main12v_ocp;
@@ -66,9 +69,13 @@ int asclepius_disable_channel(uint8_t channel);
int asclepius_get_status(void);
int asclepius_ext_open(void);
void asclepius_ext_close(void);
int asclepius_ext_send(const char *data, size_t len);
int asclepius_ext_read(char *buffer, size_t max_len);
int asclepius_parse_escapes(const char *input, char *output, size_t max);
// Function pointer set by GUI to capture serial output to the terminal textview
+1 -1
View File
@@ -555,7 +555,7 @@ int start_gtk_ccc(int argc, char **argv, char *title, char *version)
write_config_file_with_name_ccc(filename);
}
gdk_threads_add_timeout(500, display_status_update_asclepius_action, NULL);
gdk_threads_add_timeout(ASCLEPIUS_UI_UPDATE_TIMER, display_status_update_asclepius_action, NULL);
asclepius_connect();
if(asclepius_get_connection_status())