3 回答
TA贡献1847条经验 获得超7个赞
typedef struct{ int command; int data; int isbusy;} MyHardwareGadget;
void SendCommand (MyHardwareGadget * gadget, int command, int data){ // wait while the gadget is busy: while (gadget->isbusy) { // do nothing here. } // set data first: gadget->data = data; // writing the command starts the action: gadget->command = command;}
void SendCommand (volatile MyHardwareGadget * gadget, int command, int data) { // wait while the gadget is busy: while (gadget->isbusy) { // do nothing here. } // set data first: gadget->data = data; // writing the command starts the action: gadget->command = command; }
TA贡献1816条经验 获得超6个赞
volatile
volatile
volatile
TA贡献1848条经验 获得超6个赞
volatile
volatile
volatile
- 3 回答
- 0 关注
- 635 浏览
添加回答
举报