优化了队列的实现,减少空间占用.完成message center的文档

This commit is contained in:
NeoZng
2022-12-01 16:06:11 +08:00
parent 063203bd68
commit 5ad8f57a79
13 changed files with 328 additions and 110 deletions

View File

@@ -65,13 +65,7 @@ void MX_FREERTOS_Init(void);
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
typedef struct
{
float a;
uint8_t b;
uint32_t c;
/* data */
}good;
/* USER CODE END 0 */
/**
@@ -120,17 +114,7 @@ int main(void)
RobotInit();
good asdf;
good asdfsadf;
good pub={.a=1,.b=2,.c=3};
Subscriber_t* s=SubRegister("test\0",sizeof(good));
Subscriber_t* ss=SubRegister("test\0",sizeof(good));
Publisher_t* p=PubRegister("test\0",sizeof(asdf));
PubPushMessage(p,&pub);
PubPushMessage(p,&pub);
volatile uint8_t d= SubGetMessage(s,&asdf);
d=SubGetMessage(s,&asdf);
d=SubGetMessage(ss,&asdfsadf);
/* USER CODE END 2 */
/* Call init function for freertos objects (in freertos.c) */