突然想到 看這樣會不會有問題
想說看單晶片上能不能有環狀的Queue
和 LinkList 一樣 用指標去指
沒想到STM32 也能把程式存在Ram上
唯一的缺點應該就不能allocat 出來吧 ~"~
#include "stm32f10x.h"
typedef struct QueueSample
{
char context;
struct QueueSample *next;
}QueueSample;
int main(void)
{
int i;
QueueSample *head;
QueueSample QS[10];
for (i = 0; i < 10-1; i++)
{
QS[i].next = &QS[i+1];
}
QS[i].next = &QS[0];
head = &QS[0];
for (i = 0; i < 9; i++)
{
head->context = i + 0x48;
head = head->next;
}
while (1);
}
在Debug 模式下 確實可以把位址和資料抓出來
理論上應該是成功的...
全站熱搜
留言列表