Update ADIS_ESP32_Eclipse/main/splitflap_wrapper.c

main
Arnold Jonas jarnold 4 years ago
parent 33e72f0348
commit 1ecec3620a
  1. 32
      ADIS_ESP32_Eclipse/main/splitflap_wrapper.c

@ -10,7 +10,6 @@
#include "splitflap_wrapper.h" #include "splitflap_wrapper.h"
#include "McuUtility.h" #include "McuUtility.h"
#include "McuShell.h" #include "McuShell.h"
#include "rs485.h"
#define RS_CMD_PREFIX "rs sendcmd SplitFlap " #define RS_CMD_PREFIX "rs sendcmd SplitFlap "
#define BUF_SIZE 50 #define BUF_SIZE 50
@ -22,33 +21,32 @@
bool SplitFlap_Wrapper_MoveAllToZeroPosition(void){ bool SplitFlap_Wrapper_MoveAllToZeroPosition(void){
unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX; unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX;
McuUtility_strcat(cmd, sizeof(cmd), "initAll"); McuUtility_strcat(cmd, sizeof(cmd), "initAll");
McuShell_SendStr(buf, SHELL_GetStdio()->stdOut); McuShell_SendStr(buf, McuShell_GetStdio()->stdOut);
//old RS485_ParseCommand(cmd);
return true; return true;
} }
/* display a sentence on the splitflap combination /* display a sentence on the splitflap combination
* splitflaps must be initialized to be able to display something! * splitflaps must be initialized to be able to display something!
* returns true when all movements finished */ * returns true when all movements finished */
bool SplitFlap_Wrapper_Display(char sentence[]){ bool SplitFlap_Wrapper_Display(char *sentence){
char cmd[BUF_SIZE] = RS_CMD_PREFIX; unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX;
//McuUtility_strcat(cmd, sizeof cmd, "Display "); McuUtility_strcat(cmd, sizeof(cmd), "Display ");
//McuUtility_strcat(cmd, sizeof cmd, sentence); McuUtility_strcat(cmd, sizeof(cmd), sentence);
//RS485_ParseCommand(cmd); TODO McuShell_SendStr(buf, McuShell_GetStdio()->stdOut);
return true; return true;
} }
/* sets the hardware identifier <hwId> of a splitflap with <id> in the combination /* sets the hardware identifier <hwId> of a splitflap with <id> in the combination
* returns true when successful, false when not (e.g. split flap with given id not available) */ * 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){ bool SplitFlap_Wrapper_SetHardwareIdentifier(uint8_t id, uint8_t hwId){
char cmd[BUF_SIZE] = RS_CMD_PREFIX; unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX;
char setupId_str[4] = {0}; char hardwareId_str[4] = {0}; unsigned char setupId_str[4] = {0}; unsigned char hardwareId_str[4] = {0};
//McuUtility_Num8uToStr(setupId_str, sizeof setupId_str, id); McuUtility_Num8uToStr(setupId_str, sizeof(setupId_str), id);
//McuUtility_Num8uToStr(hardwareId_str, sizeof hardwareId_str, hwId); McuUtility_Num8uToStr(hardwareId_str, sizeof(hardwareId_str), hwId);
//McuUtility_strcat(cmd, sizeof cmd, "setId "); McuUtility_strcat(cmd, sizeof(cmd), "setId ");
//McuUtility_strcat(cmd, sizeof cmd, setupId_str); McuUtility_strcat(cmd, sizeof(cmd), setupId_str);
//McuUtility_strcat(cmd, sizeof cmd, " "); McuUtility_strcat(cmd, sizeof(cmd), " ");
//McuUtility_strcat(cmd, sizeof cmd, hardwareId_str); McuUtility_strcat(cmd, sizeof(cmd), hardwareId_str);
//RS485_ParseCommand(cmd); TODO McuShell_SendStr(buf, McuShell_GetStdio()->stdOut);
return true; return true;
} }

Loading…
Cancel
Save