1414 views|0 replies

3191

Posts

0

Resources
The OP
 

"Playing with the board" + Zhou Hangci's book Chapter 7, 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 7: Resource Synchronization

7.1.2: Ensuring Data Integrity

Global variables are the simplest shared resources. Many shared resources have more complex structures, such as structures, arrays, data blocks, etc.

At this time, the integrity of shared resource data is more easily damaged.

Let's look at a calendar clock program: We define a global structure for the PCF8563 clock (including year, month, day, hour, minute, and second).

If a task (such as a display task) needs to display the current time data, it can be read from the calendar clock structure

We use a key task to represent the task that requires calendar clock data. Each time a key is pressed, the time of the key press is displayed.

Contents of the calendar clock.

Partial schematic diagram:






Part of the code:

Effect picture:

Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 
 

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