add rs485 shell, project not working!

main
Simon Frei 4 years ago
parent bc1c129846
commit f1847cdf6b
  1. 3
      ADIS_tinyK22_SplitFlap/source/IncludeMcuLibConfig.h
  2. 8
      ADIS_tinyK22_SplitFlap/source/platform.c
  3. 2
      ADIS_tinyK22_SplitFlap/source/rs485.c
  4. 5
      ADIS_tinyK22_SplitFlap/source/shell.c
  5. 8
      ADIS_tinyK22_SplitFlap/source/shell.h
  6. 2
      ADIS_tinyK22_SplitFlap/source/splitflap.h

@ -129,6 +129,7 @@ add_compile_options(-include "../config/IncludeMcuLibConfig.h")
#define McuMinINI_CONFIG_FLASH_NVM_ADDR_START ((0+512*1024)-McuMinINI_CONFIG_FLASH_NVM_BLOCK_SIZE)
#define McuMinINI_CONFIG_FLASH_NVM_BLOCK_SIZE (0x800)
#define McuMinINI_CONFIG_FLASH_NVM_MAX_DATA_SIZE (0x800) /* must be 64, 128, 256, ... */
/* RS485 */
#define McuUart485_CONFIG_USE_RS_485 (1)
#endif /* INCLUDEMCULIBCONFIG_H_ */

@ -25,6 +25,9 @@
#include "MinIni/McuMinINI.h"
#include "minIni/McuFlash.h"
#endif
#if PL_CONFIG_USE_RS485
#include "rs485.h"
#endif
void PL_Init(void){
@ -32,6 +35,7 @@ void PL_Init(void){
CLOCK_EnableClock(kCLOCK_PortA);
CLOCK_EnableClock(kCLOCK_PortB);
CLOCK_EnableClock(kCLOCK_PortC);
CLOCK_EnableClock(kCLOCK_PortD);
/* NVMC init */
#if PL_CONFIG_USE_NVMC
@ -50,6 +54,9 @@ void PL_Init(void){
McuLED_Init();
McuULN2003_Init();
McuRTT_Init();
#if PL_CONFIG_USE_RS485
RS485_Init();
#endif
McuShell_Init();
McuShellUart_Init();
McuLog_Init();
@ -81,4 +88,5 @@ void PL_Deinit(void){
#if PL_CONFIG_USE_NVMC
NVMC_Deinit();
#endif
}

@ -20,7 +20,7 @@
#if PL_CONFIG_USE_WDT
#include "watchdog.h"
#endif
#include "stepper.h"
//#include "stepper.h"
typedef enum RS485_Response_e {
RS485_RESPONSE_CONTINUE, /* continue scanning and parsing */

@ -16,6 +16,7 @@
#include "minIni/McuMinINI.h"
#include "minIni/McuFlash.h"
#include "nvmc.h"
#include "rs485.h"
#define SHELL_CMD_ELEM_SIZE (sizeof(Shell_cmd_s))
@ -143,6 +144,7 @@ static const McuShell_ParseCommandCallback CmdParserTable[] =
ini_ParseCommand,
McuMinINI_ParseCommand,
NVMC_ParseCommand,
RS485_ParseCommand,
NULL /* Sentinel */
};
@ -182,6 +184,9 @@ void SHELL_SendString(const unsigned char *str) {
}
}
void SHELL_SendStringToIO(const unsigned char *str, McuShell_ConstStdIOType *io){
McuShell_SendStr(str, io->stdOut);
}
static void ShellTask(void *pv) {
int i;

@ -76,6 +76,14 @@ void SHELL_SendChar(unsigned char ch);
*/
uint8_t SHELL_ParseCommandIO(const unsigned char *command, McuShell_ConstStdIOType *io, bool silent);
/*!
* \brief Parses a command with a given standard I/O channel
* \param command Command to be parsed
* \param io I/O to be used. If NULL, the standard default I/O will be used
* \param silent If parsing shall be silent or not
* \return Error code, ERR_OK for no error
*/
void SHELL_SendStringToIO(const unsigned char *str, McuShell_ConstStdIOType *io);
/*!
* \brief Module de-initialization
*/

@ -16,7 +16,7 @@
#include <string.h>
/****** SETTINGS ******/
#define SPLITFLAP_CONFIG_USE_FREERTOS_HEAP 0
#define SPLITFLAP_CONFIG_USE_FREERTOS_HEAP 1
#define SPLITFLAP_STEPS_ONE_ROUND 512
#define SPLITFLAP_AMOUNT_OF_SEGMENTS (sizeof(SF_Letters)/sizeof(SF_Letters[0]))
#define SPLITFLAP_STEPS_PER_SEGMENT ((float)SPLITFLAP_STEPS_ONE_ROUND/(float)SPLITFLAP_AMOUNT_OF_SEGMENTS)

Loading…
Cancel
Save