1613 views|1 replies

3180

Posts

0

Resources
The OP
 

"Playing with the board" + Zhou Hangci's book Chapter 8, Example 4 [Copy link]

 




This content is originally created by EEWORLD forum user chenbingjy . If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source.
Chapter 8: Data Communication

In many cases, the party sending the message is the ISR, which requires special attention:

If the local variable of ISR is used to save the message, the party receiving the message cannot obtain the real message.

When the recipient of the message obtains the message pointer, the ISR has ended and its local variables disappear as well.

There are three ways for ISR to reliably send messages:

1. Save the message in a global variable;

2. Save the message in a static local variable of the ISR;

3. Send the message content as a pointer.

Now consider the first case. The disadvantage of this case is that the variable definition is separated from the ISR code, and the program readability decreases.

Partial schematic diagram:







The button 5 used in the program, the sensor is DS18B20.

Part of the code:

Rendering:

Latest reply

  Details Published on 2020-3-17 11:13
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 
 

661

Posts

18

Resources
2
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list