Skip to content

Commit 4ef9a80

Browse files
committed
v3.2.0 - xs-code preparations
1 parent 1fc1721 commit 4ef9a80

File tree

2 files changed

+1
-73
lines changed

2 files changed

+1
-73
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
### Cooperative multitasking for Arduino, ESPx, STM32 and other microcontrollers
33
#### Version 3.2.0: 2020-08-16 [Latest updates](https://github.com/arkhipenko/TaskScheduler/wiki/Latest-Updates)
44

5-
[![arduino-library-badge](https://www.ardu-badge.com/badge/TaskScheduler.svg?)](https://www.ardu-badge.com/TaskScheduler)
5+
[![arduino-library-badge](https://www.ardu-badge.com/badge/TaskScheduler.svg?)](https://www.ardu-badge.com/TaskScheduler)[![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/arkhipenko/TaskScheduler)
66

77
### OVERVIEW:
88
A lightweight implementation of cooperative multitasking (task scheduling) supporting:

src/TaskSchedulerSleepMethods.h

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -21,78 +21,6 @@ void SleepMethod( unsigned long aDuration ) {
2121
}
2222
// ARDUINO_ARCH_AVR
2323

24-
25-
#elif defined( CORE_TEENSY )
26-
void SleepMethod( unsigned long aDuration ) {
27-
asm("wfi");
28-
}
29-
//CORE_TEENSY
30-
31-
32-
#elif defined( ARDUINO_ARCH_ESP8266 )
33-
34-
#ifndef _TASK_ESP8266_DLY_THRESHOLD
35-
#define _TASK_ESP8266_DLY_THRESHOLD 200L
36-
#endif
37-
extern "C" {
38-
#include "user_interface.h"
39-
}
40-
41-
void SleepMethod( unsigned long aDuration ) {
42-
// to do: find suitable sleep function for esp8266
43-
if ( aDuration < _TASK_ESP8266_DLY_THRESHOLD) delay(1); // ESP8266 implementation of delay() uses timers and yield
44-
}
45-
// ARDUINO_ARCH_ESP8266
46-
47-
48-
#elif defined( ARDUINO_ARCH_ESP32 )
49-
50-
#include <esp_sleep.h>
51-
52-
#ifndef _TASK_ESP32_DLY_THRESHOLD
53-
#define _TASK_ESP32_DLY_THRESHOLD 200L
54-
#endif
55-
extern unsigned long tStart, tFinish;
56-
const unsigned long tRem = 1000-_TASK_ESP32_DLY_THRESHOLD;
57-
58-
void SleepMethod( unsigned long aDuration ) {
59-
if ( aDuration < tRem ) {
60-
esp_sleep_enable_timer_wakeup((uint64_t) (1000 - aDuration));
61-
esp_light_sleep_start();
62-
}
63-
}
64-
// ARDUINO_ARCH_ESP32
65-
66-
67-
#elif defined( ARDUINO_ARCH_STM32F1 )
68-
69-
#include <libmaple/pwr.h>
70-
#include <libmaple/scb.h>
71-
72-
void SleepMethod( unsigned long aDuration ) {
73-
// Now go into stop mode, wake up on interrupt.
74-
// Systick interrupt will run every 1 milliseconds.
75-
asm(" wfi");
76-
}
77-
// ARDUINO_ARCH_STM32
78-
79-
80-
#elif defined( ENERGIA_ARCH_MSP432 )
81-
82-
void SleepMethod( unsigned long aDuration ) {
83-
delay(1);
84-
}
85-
// ENERGIA_ARCH_MSP432
86-
87-
88-
#elif defined( ENERGIA_ARCH_MSP430 )
89-
90-
void SleepMethod( unsigned long aDuration ) {
91-
sleep(1);
92-
}
93-
// ENERGIA_ARCH_MSP430
94-
95-
9624
#else
9725
void SleepMethod( unsigned long aDuration ) {
9826
}

0 commit comments

Comments
 (0)