You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
/*
|
|
* multi-splitflap.c
|
|
*
|
|
* Created on: 07.10.2022
|
|
* Author: jonas
|
|
*/
|
|
|
|
#include "multi-splitflap.h"
|
|
#include "fsl_debug_console.h"
|
|
|
|
static dict_t **flapDict;
|
|
static uint8_t amountOfFlaps = 0;
|
|
|
|
void MultiSplitFlap_Init(void){
|
|
amountOfFlaps = 0;
|
|
flapDict = dictAlloc();
|
|
((dict_t*)flapDict)->key=NULL;
|
|
((dict_t*)flapDict)->value=NULL;
|
|
((dict_t*)flapDict)->next=NULL;
|
|
}
|
|
|
|
void MultiSplitFlap_Deinit(void){
|
|
dictDealoc(flapDict);
|
|
amountOfFlaps = 0;
|
|
}
|
|
|
|
uint8_t MultiSplitFlap_GetAmountOfSplitFlaps(void){
|
|
return amountOfFlaps;
|
|
}
|
|
|
|
void MultiSplitFlap_AddFlap(SF_Handle_t splitflap){
|
|
PRINTF("Adding split flap to multi splitflap combination:\n");
|
|
addItem(flapDict, (char*)&amountOfFlaps, (SF_Handle_t*)splitflap);
|
|
//TODO probably starting with 0 does not work since its a pointer to the number 0
|
|
PRINTF("Added flap nr. %i. There are now %i flaps.\n", amountOfFlaps, ++amountOfFlaps);
|
|
}
|
|
|
|
void MultiSplitFlap_Display(char* sentence[]){
|
|
SF_Handle_t* sfHandle0 = (SF_Handle_t*)(getItem(*flapDict, (char*)0));
|
|
SF_Handle_t* sfHandle1 = (SF_Handle_t*)(getItem(*flapDict, (char*)1));
|
|
SF_t* sf0 = (SF_t*)sfHandle0;
|
|
SF_t* sf1 = (SF_t*)sfHandle1;
|
|
int32_t test = McuULN2003_GetPos(sf1->motor);
|
|
}
|
|
|
|
|
|
|