在函数osMessageGet 只能返回一个4个字节啊。在xQueueReceive它只传了一个uint32_t v啊,只有四个字节。 那就限制了最大的数据就是四个字节了,感觉应该不会是这样啊,那么我怎么使用队列,发送一个12个字节的结构体呢? osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec) { portBASE_TYPE taskWoken; TickType_t ticks; osEvent event; ................... ............... else { if (xQueueReceive(queue_id, &event.value.v, ticks) == pdTRUE) { /* We have mail */ } return event; } typedef struct { osStatus status; ///< status code: event or error information union { uint32_t v; ///< message as 32-bit value void *p; ///< message or mail as void pointer int32_t signals; ///< signal flags } value; union { osMailQId mail_id; ///< mail id obtained by \ref osMailCreate osMessageQId message_id; ///< message id obtained by \ref osMessageCreate } def; ///< event definition |
union里有void *p,直接传指针也可以的吧?