mirror of https://github.com/rusefi/bldc.git
Merge branch 'vedderb:master' into master
This commit is contained in:
commit
ce2fb18167
|
@ -23,6 +23,7 @@
|
||||||
* Added recv-to with a timeout argument.
|
* Added recv-to with a timeout argument.
|
||||||
* Added remote message extensions.
|
* Added remote message extensions.
|
||||||
* Added phase-hall extension.
|
* Added phase-hall extension.
|
||||||
|
* Added loopwhile-thd.
|
||||||
* Hall sensors improvements:
|
* Hall sensors improvements:
|
||||||
* Smooth transition to sensorless.
|
* Smooth transition to sensorless.
|
||||||
* Bug fix in interpolation.
|
* Bug fix in interpolation.
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define FW_VERSION_MAJOR 6
|
#define FW_VERSION_MAJOR 6
|
||||||
#define FW_VERSION_MINOR 05
|
#define FW_VERSION_MINOR 05
|
||||||
// Set to 0 for building a release and iterate during beta test builds
|
// Set to 0 for building a release and iterate during beta test builds
|
||||||
#define FW_TEST_VERSION_NUMBER 12
|
#define FW_TEST_VERSION_NUMBER 13
|
||||||
|
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
|
|
||||||
|
|
|
@ -3146,6 +3146,38 @@ f
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
#### loopwhile-thd
|
||||||
|
|
||||||
|
| Platforms | Firmware |
|
||||||
|
|---|---|
|
||||||
|
| ESC, Express | 6.05+ |
|
||||||
|
|
||||||
|
```clj
|
||||||
|
(loopwhile-thd stack cond body)
|
||||||
|
```
|
||||||
|
|
||||||
|
While-loop that starts in a new thread. The argument stack is the stack-size of the thread, cond is the condition that has the be true for the loop to continue running and body is the code to execute each iteration. The difference from the regular loopwhile is that the evaluator will continue running the code after this one before this one finishes, as this loop is evaluated in a new thread.
|
||||||
|
|
||||||
|
Example that forever prints "Hello World" every two seconds:
|
||||||
|
|
||||||
|
```clj
|
||||||
|
; Note: This example uses the curly backet for progn for convenience
|
||||||
|
|
||||||
|
(loopwhile-thd 100 t {
|
||||||
|
(print "Hello World")
|
||||||
|
(sleep 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
; The above is equivalent to the following code
|
||||||
|
|
||||||
|
(spawn 100 (fn () (loopwhile t {
|
||||||
|
(print "Hello World")
|
||||||
|
(sleep 2)
|
||||||
|
})))
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
#### break
|
#### break
|
||||||
|
|
||||||
| Platforms | Firmware |
|
| Platforms | Firmware |
|
||||||
|
|
|
@ -87,6 +87,7 @@ static const char* macros[] = {
|
||||||
"(define loopwhile (macro (cnd body) (me-loopwhile cnd body)))",
|
"(define loopwhile (macro (cnd body) (me-loopwhile cnd body)))",
|
||||||
"(define looprange (macro (it start end body) (me-looprange it start end body)))",
|
"(define looprange (macro (it start end body) (me-looprange it start end body)))",
|
||||||
"(define loopforeach (macro (it lst body) (me-loopforeach it lst body)))",
|
"(define loopforeach (macro (it lst body) (me-loopforeach it lst body)))",
|
||||||
|
"(define loopwhile-thd (macro (stk cnd body) `(spawn ,stk (fn () (loopwhile ,cnd ,body)))))",
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool strmatch(const char *str1, const char *str2) {
|
static bool strmatch(const char *str1, const char *str2) {
|
||||||
|
|
Loading…
Reference in New Issue