From 1ecec3620aeb9dfdd3c15dca79724f029d95ac61 Mon Sep 17 00:00:00 2001 From: Arnold Jonas jarnold Date: Tue, 6 Dec 2022 10:12:49 +0100 Subject: [PATCH] Update ADIS_ESP32_Eclipse/main/splitflap_wrapper.c --- ADIS_ESP32_Eclipse/main/splitflap_wrapper.c | 32 ++++++++++----------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c b/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c index 42770e5..7a5587b 100644 --- a/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c +++ b/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c @@ -10,7 +10,6 @@ #include "splitflap_wrapper.h" #include "McuUtility.h" #include "McuShell.h" -#include "rs485.h" #define RS_CMD_PREFIX "rs sendcmd SplitFlap " #define BUF_SIZE 50 @@ -22,33 +21,32 @@ bool SplitFlap_Wrapper_MoveAllToZeroPosition(void){ unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX; McuUtility_strcat(cmd, sizeof(cmd), "initAll"); - McuShell_SendStr(buf, SHELL_GetStdio()->stdOut); - //old RS485_ParseCommand(cmd); + McuShell_SendStr(buf, McuShell_GetStdio()->stdOut); return true; } /* display a sentence on the splitflap combination * splitflaps must be initialized to be able to display something! * returns true when all movements finished */ -bool SplitFlap_Wrapper_Display(char sentence[]){ - char cmd[BUF_SIZE] = RS_CMD_PREFIX; - //McuUtility_strcat(cmd, sizeof cmd, "Display "); - //McuUtility_strcat(cmd, sizeof cmd, sentence); - //RS485_ParseCommand(cmd); TODO +bool SplitFlap_Wrapper_Display(char *sentence){ + unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX; + McuUtility_strcat(cmd, sizeof(cmd), "Display "); + McuUtility_strcat(cmd, sizeof(cmd), sentence); + McuShell_SendStr(buf, McuShell_GetStdio()->stdOut); return true; } /* sets the hardware identifier of a splitflap with in the combination * returns true when successful, false when not (e.g. split flap with given id not available) */ bool SplitFlap_Wrapper_SetHardwareIdentifier(uint8_t id, uint8_t hwId){ - char cmd[BUF_SIZE] = RS_CMD_PREFIX; - char setupId_str[4] = {0}; char hardwareId_str[4] = {0}; - //McuUtility_Num8uToStr(setupId_str, sizeof setupId_str, id); - //McuUtility_Num8uToStr(hardwareId_str, sizeof hardwareId_str, hwId); - //McuUtility_strcat(cmd, sizeof cmd, "setId "); - //McuUtility_strcat(cmd, sizeof cmd, setupId_str); - //McuUtility_strcat(cmd, sizeof cmd, " "); - //McuUtility_strcat(cmd, sizeof cmd, hardwareId_str); - //RS485_ParseCommand(cmd); TODO + unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX; + unsigned char setupId_str[4] = {0}; unsigned char hardwareId_str[4] = {0}; + McuUtility_Num8uToStr(setupId_str, sizeof(setupId_str), id); + McuUtility_Num8uToStr(hardwareId_str, sizeof(hardwareId_str), hwId); + McuUtility_strcat(cmd, sizeof(cmd), "setId "); + McuUtility_strcat(cmd, sizeof(cmd), setupId_str); + McuUtility_strcat(cmd, sizeof(cmd), " "); + McuUtility_strcat(cmd, sizeof(cmd), hardwareId_str); + McuShell_SendStr(buf, McuShell_GetStdio()->stdOut); return true; }