fix multisplitflap, for use with rtos and setupidentifier for motors 3,4

main
Simon Frei 4 years ago
parent f1847cdf6b
commit da8afb1ff4
  1. 6
      ADIS_tinyK22_SplitFlap/source/IncludeMcuLibConfig.h
  2. 6
      ADIS_tinyK22_SplitFlap/source/application.c
  3. 2
      ADIS_tinyK22_SplitFlap/source/multi-splitflap.c
  4. 2
      ADIS_tinyK22_SplitFlap/source/multi-splitflap.h
  5. 2
      ADIS_tinyK22_SplitFlap/source/shell.c

@ -115,9 +115,9 @@ add_compile_options(-include "../config/IncludeMcuLibConfig.h")
/* ------------------- RTOS ---------------------------*/
#define McuLib_CONFIG_SDK_USE_FREERTOS (1)
/* #define configUSE_SEGGER_SYSTEM_VIEWER_HOOKS (1) */
/*#define configTOTAL_HEAP_SIZE (24*1024)*/
/* #define configUSE_HEAP_SECTION_NAME (1) */
/* #define configHEAP_SECTION_NAME_STRING ".bss.$SRAM_LOWER.FreeRTOS" */
#define configTOTAL_HEAP_SIZE (24*1024)
#define configUSE_HEAP_SECTION_NAME (1)
#define configHEAP_SECTION_NAME_STRING ".bss.$SRAM_LOWER.FreeRTOS"
/* ------------------- FatFS ---------------------------*/
#define McuLib_CONFIG_USE_FAT_FS (0)
/* ---------------------------------------------------------------------------------------*/

@ -24,7 +24,7 @@
#define LED_BLUE_PIN 2U
/* number of splitflaps that are connected / used. max 4. */
#define NUM_SF_USED 2
#define NUM_SF_USED 4
/* vars */
static McuLED_Handle_t LED_blue;
@ -271,7 +271,7 @@ void configureSplitflaps(void){
/* create config instance for splitflap 2 */
SF_Config_t sf2Config;
sf2Config.setupIdentifier = 1;
sf2Config.setupIdentifier = 2;
sf2Config.hardwareIdentifier = 20; // default value
sf2Config.magSensorConfig = magSensor2Config;
sf2Config.motorConfig = motor2Config;
@ -310,7 +310,7 @@ void configureSplitflaps(void){
/* create config instance for splitflap 3 */
SF_Config_t sf3Config;
sf3Config.setupIdentifier = 1;
sf3Config.setupIdentifier = 3;
sf3Config.hardwareIdentifier = 20; // default value
sf3Config.magSensorConfig = magSensor3Config;
sf3Config.motorConfig = motor3Config;

@ -11,6 +11,7 @@
#include "McuRTOS.h"
#include "McuLog.h"
#include "splitflap.h"
#include "McuUtility.h"
/* vars */
static dict_t **flapDict;
@ -151,6 +152,7 @@ void initFlapKeys(uint8_t numberOfFlaps){
/* get a memory place for the key */
#if SPLITFLAP_CONFIG_USE_FREERTOS_HEAP
flapKeys[i] = pvPortMalloc(sizeof(BYTES_PER_KEY));
sprintf(flapKeys[i], "%i", i);
#else
if((flapKeys[i] = malloc(BYTES_PER_KEY)) == NULL){
McuLog_error("Reserving memory for flap num. %i failed!:", i);

@ -10,7 +10,7 @@
#include "splitflap.h"
#define NUM_FLAPS 2 // Number of flaps that can be added to the combination
#define NUM_FLAPS 4 // Number of flaps that can be added to the combination
/* initialize dictionary.
* numFlaps: Amount of flaps to be used*/

@ -144,7 +144,9 @@ static const McuShell_ParseCommandCallback CmdParserTable[] =
ini_ParseCommand,
McuMinINI_ParseCommand,
NVMC_ParseCommand,
#if PL_CONFIG_USE_RS485
RS485_ParseCommand,
#endif
NULL /* Sentinel */
};

Loading…
Cancel
Save