资源简介
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 驱动
相关资源
- 马哥Linux2016全套视频教程及随堂笔记
- cqsjh5资源和搭建教程.docx
- 传奇h5源码云盘地址加教程.docx
-
EffectPla
yer.rar - code.zip
- 广陵散ssh.txt
- 70myeclipse-ci-2018.8.0.txt
- C2J.exe
- Kotlin打造完整电商APP模块化MVP主流框
- 《爬虫入门到精通课程》视频课件.
- 计算机毕业论文.doc
- LED屏.rar
- 测试用例模板.xlsx
- 视频地址.txt
- 详见里面的内容.txt
- 网盘地址.rar
- 30781mpvue-citypicker.rar
- 即时通信.zip
- 北京大学数字电路实验电路仿真数字
- hws.dll
- Burp_suite_Pro_v2.1.txt
- CC2530原理图元件库.zip
- 最优化导论答案.txt
- 计算机组成原理课后答案.pdf
- 百度云链接.rar
- 4.8-接插件-脚距3.96.SchLib
- meanshift算法实现.rar
- 换行插件.rar
- BC35.rar
- AnalysationofTrafficParaments.rar
评论
共有 条评论