资源简介
Arduino多任务同时进行.rar

代码片段和文件信息
/*****************************************************************************/
/* SCOOP LIBRARY / AUTHOR FABRICE OUDERT / GNU GPL V3 */
/* https://code.google.com/p/arduino-scoop-cooperative-scheduler-arm-avr/ */
/* VERSION 1.2 NEW YEAR PACK 10/1/2013 */
/* ENJOY AND USE AT YOUR OWN RISK :) */
/* SHOULD READ USER GUIDE FIRST (@\_/@) */
/*****************************************************************************/
#include “SCoop.h“
#define SCINM SCoopInstanceNickName
/********* GLOBAL VARIABLE *******/
SCoopEvent* SCoopFirstItem = NULL; // has to be initialized here. hold a pointer on the whole list of task/event/timer...
SCoopEvent* SCoopFirstTaskItem = NULL; // has to be initialized here. points to the first of all tasks registered in the list
uint8_t SCoopNumberTask = 0; // hold the number of task registered. used to calculate quantum in start(xxx)
SCoop SCoopInstanceNickName; // then we can use the library in the main sketch directly
#define SCINM SCoopInstanceNickName // just a local nickname...
#if SCoopANDROIDMODE >= 1
SCoop& ArduinoSchedulerNickName = SCINM; // this will create another identifier for the same object instance
#endif
/********* ASSEMBLY / LETS GET STARTED WITH THE COMPLEX THINGS **********/
// original idea for switching stack pointer taken out from ChibiOS.
// Credit to the author. now slightly modified.
// http://forum.pjrc.com/threads/540-ChibiOS-RTand-FreeRTOS-for-Teensy-3-0
//
// original idea for micros() optimization taken from CORE_TEENSY
// credit to Paul http://www.pjrc.com/teensy/
//************************************************************************/
#if defined(SCoop_ARM) && (SCoop_ARM == 1)
static void SCoopSwitch(uint8_t **newSP uint8_t **oldSP) __attribute__((nakednoinline)) ;
static void SCoopSwitch(uint8_t **newSP uint8_t **oldSP)
{ asm volatile (“push {r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 lr}“ : : : “memory“);
asm volatile (“str sp [%[oldsp] #0] \n\t“
“ldr sp [%[newsp] #0]“ : : [newsp] “r“ (newSP) [oldsp] “r“ (oldSP));
asm volatile (“pop {r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 pc}“ : : : “memory“);
};
static inline uint32_t SCoopGetSP() __attribute__ ((always_inline)) ;
uint32_t SCoopGetSP() { register uint32_t val; asm (“mov %[temp]sp“ : [temp] “=r“ (val)); return val; }
#define ARM_ATOMIC ASM_ATOMIC
#define AVR_ATOMIC
#define SCoopMicros() ((micros_t)micros()) // overloading the standard micros()
#endif
#if defined(SCoop_AVR) && (SCoop_AVR == 1)
static void SCoopSwitch(void *newSP void *oldSP) __attribute__((nakednoinline));
static void SCoopSwitch(void *newSP void *oldSP)
{ asm volatile (“push r2 \n\t push r3 \n\t push r4 \n\t push r5 \n\t push r6 \n\t push r7 \n\t push
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 854 2013-01-10 19:23 Arduino多任务同时进行\SCoop\examples\example1\example1.ino
文件 6086 2013-01-11 08:43 Arduino多任务同时进行\SCoop\examples\example2\example2.ino
文件 1108 2013-01-10 22:57 Arduino多任务同时进行\SCoop\examples\example3\example3.ino
文件 2223 2013-01-10 19:23 Arduino多任务同时进行\SCoop\examples\example4\example4.ino
文件 1893 2013-01-10 19:23 Arduino多任务同时进行\SCoop\examples\example5\example5.ino
文件 2305 2013-01-10 21:08 Arduino多任务同时进行\SCoop\examples\Multiplebl
文件 2426 2013-01-10 21:06 Arduino多任务同时进行\SCoop\examples\Multiplebl
文件 4646 2013-01-10 23:11 Arduino多任务同时进行\SCoop\examples\performance1\performance1.ino
文件 718 2012-12-10 11:14 Arduino多任务同时进行\SCoop\keywords.txt
文件 165 2012-12-14 09:02 Arduino多任务同时进行\SCoop\readme.txt
文件 8462 2013-01-10 19:36 Arduino多任务同时进行\SCoop\scoop change log.txt
文件 39140 2013-01-11 08:17 Arduino多任务同时进行\SCoop\SCoop.cpp
文件 34483 2013-01-11 08:44 Arduino多任务同时进行\SCoop\SCoop.h
文件 14044 2018-11-21 20:57 Arduino多任务同时进行\多任务同时进行.docx
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\example1
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\example2
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\example3
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\example4
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\example5
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\Multiplebl
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\Multiplebl
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop\examples\performance1
目录 0 2015-03-18 13:34 Arduino多任务同时进行\SCoop\examples
目录 0 2018-11-21 21:00 Arduino多任务同时进行\SCoop
目录 0 2018-11-21 21:00 Arduino多任务同时进行
----------- --------- ---------- ----- ----
118553 25
- 上一篇:深度神经网络LSTM序列分类应用
- 下一篇:TSM12 驱动
相关资源
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
- 联想启天M4350 BIOS升级文件
- 操作系统教程课后答案华中科技大学
评论
共有 条评论