2020-02-06 09:47发布
pic_flash 发表于 2017-12-28 09:12 慎用, 因为他不是ANSI C, 以后移植不容易, 除非不使用内建功能。 但也因为他内建的功能都优化到很好, ...
gmyu 发表于 2018-1-11 20:43 突然想问,这个CCS有没有OS部分,或者支持调度的代码。
最多设置5个标签!
突然想问,这个CCS有没有OS部分,或者支持调度的代码。
有内建RTOS
#use rtos 调出
下面是基本结构:
- // preprocessor directives
- #include <18F452.h>
- #use delay(clock=20000000)
- #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
- #use rtos(timer=0,minor_cycle=100ms)
- // function declarations
- #task(rate=1000ms,max=100ms)
- void The_first_rtos_task ( );
- #task(rate=500ms,max=100ms)
- void The_second_rtos_task ( );
- #task(rate=100ms,max=100ms)
- void The_third_rtos_task ( );
- // more function declarations
- // function implementations
- void The_first_rtos_task ( )
- {
- // task code
- }
- void The_second_rtos_task ( )
- {
- // task code
- }
- void The_third_rtos_task ( )
- {
- // task code
- }
- // more function implementations
- void main ( )
- {
- // initialization code for other resources
- rtos_run ( );
- }
复制代码版本: PCWHD_V5.076 (PIC 编译器)
百度云下载:
链接:https://pan.baidu.com/s/1pMjQ9Tp
密码:0y1y
一周热门 更多>