Added capabilties memory allocation.
This commit is contained in:
@ -128,7 +128,7 @@ $(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN)
|
|||||||
|
|
||||||
ARDUINO_BOOT = common/boot.fs common/vocabulary.fs \
|
ARDUINO_BOOT = common/boot.fs common/vocabulary.fs \
|
||||||
arduino/arduino.fs arduino/arduino_highlevel.fs \
|
arduino/arduino.fs arduino/arduino_highlevel.fs \
|
||||||
arduino/hide_io.fs common/highlevel.fs \
|
arduino/bindings.fs common/highlevel.fs \
|
||||||
common/filetools.fs common/utils.fs \
|
common/filetools.fs common/utils.fs \
|
||||||
common/tasks.fs common/streams.fs arduino/arduino_server.fs \
|
common/tasks.fs common/streams.fs arduino/arduino_server.fs \
|
||||||
arduino/esp_camera.fs common/blocks.fs \
|
arduino/esp_camera.fs common/blocks.fs \
|
||||||
|
|||||||
@ -24,12 +24,6 @@ forth definitions
|
|||||||
2 constant OUTPUT
|
2 constant OUTPUT
|
||||||
2 constant LED
|
2 constant LED
|
||||||
|
|
||||||
( WiFi Modes )
|
|
||||||
0 constant WIFI_MODE_NULL
|
|
||||||
1 constant WIFI_MODE_STA
|
|
||||||
2 constant WIFI_MODE_AP
|
|
||||||
3 constant WIFI_MODE_APSTA
|
|
||||||
|
|
||||||
( Startup Setup )
|
( Startup Setup )
|
||||||
-1 echo !
|
-1 echo !
|
||||||
115200 Serial.begin
|
115200 Serial.begin
|
||||||
|
|||||||
@ -42,10 +42,14 @@
|
|||||||
#define PUSH(v) (DUP, tos = (cell_t) (v))
|
#define PUSH(v) (DUP, tos = (cell_t) (v))
|
||||||
|
|
||||||
#define PLATFORM_OPCODE_LIST \
|
#define PLATFORM_OPCODE_LIST \
|
||||||
/* Allocation and Strings */ \
|
/* Memory Allocation */ \
|
||||||
X("MALLOC", MALLOC, tos = (cell_t) malloc(tos)) \
|
X("MALLOC", MALLOC, tos = (cell_t) malloc(tos)) \
|
||||||
X("SYSFREE", FREE, free((void *) tos); DROP) \
|
X("SYSFREE", FREE, free((void *) tos); DROP) \
|
||||||
X("REALLOC", REALLOC, tos = (cell_t) realloc((void *) *sp, tos); --sp) \
|
X("REALLOC", REALLOC, tos = (cell_t) realloc((void *) *sp, tos); --sp) \
|
||||||
|
X("heap_caps_malloc", HEAP_CAPS_MALLOC, tos = (cell_t) heap_caps_malloc(*sp, tos); --sp) \
|
||||||
|
X("heap_caps_free", HEAP_CAPS_FREE, heap_caps_free((void *) tos); DROP) \
|
||||||
|
X("heap_caps_realloc", HEAP_CAPS_REALLOC, \
|
||||||
|
tos = (cell_t) heap_caps_realloc((void *) sp[-1], *sp, tos); sp -= 2) \
|
||||||
/* Serial */ \
|
/* Serial */ \
|
||||||
X("Serial.begin", SERIAL_BEGIN, Serial.begin(tos); DROP) \
|
X("Serial.begin", SERIAL_BEGIN, Serial.begin(tos); DROP) \
|
||||||
X("Serial.end", SERIAL_END, Serial.end()) \
|
X("Serial.end", SERIAL_END, Serial.end()) \
|
||||||
|
|||||||
@ -102,7 +102,7 @@ window.onload = function() {
|
|||||||
variable webserver
|
variable webserver
|
||||||
20000 constant out-size
|
20000 constant out-size
|
||||||
200 stream input-stream
|
200 stream input-stream
|
||||||
out-size dup stream output-stream
|
out-size stream output-stream
|
||||||
create out-string out-size 1+ allot align
|
create out-string out-size 1+ allot align
|
||||||
|
|
||||||
: handle-index
|
: handle-index
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
( Migrate various words to separate vocabularies )
|
( Migrate various words to separate vocabularies, and constants )
|
||||||
|
|
||||||
vocabulary Wire Wire definitions
|
vocabulary Wire Wire definitions
|
||||||
transfer{
|
transfer{
|
||||||
Wire.begin Wire.setClock Wire.getClock
|
Wire.begin Wire.setClock Wire.getClock
|
||||||
@ -25,6 +26,7 @@ transfer{
|
|||||||
forth definitions
|
forth definitions
|
||||||
|
|
||||||
vocabulary WiFi WiFi definitions
|
vocabulary WiFi WiFi definitions
|
||||||
|
|
||||||
transfer{
|
transfer{
|
||||||
WiFi.config
|
WiFi.config
|
||||||
WiFi.begin WiFi.disconnect
|
WiFi.begin WiFi.disconnect
|
||||||
@ -32,8 +34,14 @@ transfer{
|
|||||||
WiFi.macAddress WiFi.localIP
|
WiFi.macAddress WiFi.localIP
|
||||||
WiFi.mode
|
WiFi.mode
|
||||||
WiFi.setTxPower WiFi.getTxPower
|
WiFi.setTxPower WiFi.getTxPower
|
||||||
WIFI_MODE_APSTA WIFI_MODE_AP WIFI_MODE_STA WIFI_MODE_NULL
|
|
||||||
}transfer
|
}transfer
|
||||||
|
|
||||||
|
( WiFi Modes )
|
||||||
|
0 constant WIFI_MODE_NULL
|
||||||
|
1 constant WIFI_MODE_STA
|
||||||
|
2 constant WIFI_MODE_AP
|
||||||
|
3 constant WIFI_MODE_APSTA
|
||||||
|
|
||||||
forth definitions
|
forth definitions
|
||||||
|
|
||||||
vocabulary SD_MMC SD_MMC definitions
|
vocabulary SD_MMC SD_MMC definitions
|
||||||
@ -92,6 +100,21 @@ forth definitions
|
|||||||
internals definitions
|
internals definitions
|
||||||
transfer{
|
transfer{
|
||||||
malloc sysfree realloc
|
malloc sysfree realloc
|
||||||
|
heap_caps_malloc heap_caps_free heap_caps_realloc
|
||||||
}transfer
|
}transfer
|
||||||
|
|
||||||
|
( Heap Capabilities )
|
||||||
|
binary
|
||||||
|
0001 constant MALLOC_CAP_EXEC
|
||||||
|
0010 constant MALLOC_CAP_32BIT
|
||||||
|
0100 constant MALLOC_CAP_8BIT
|
||||||
|
1000 constant MALLOC_CAP_DMA
|
||||||
|
: MALLOC_CAP_PID ( n -- ) 10000 over 11 ( 3 ) - for 2* next ;
|
||||||
|
000010000000000 constant MALLOC_CAP_SPIRAM
|
||||||
|
000100000000000 constant MALLOC_CAP_INTERNAL
|
||||||
|
001000000000000 constant MALLOC_CAP_DEFAULT
|
||||||
|
010000000000000 constant MALLOC_CAP_IRAM_8BIT
|
||||||
|
010000000000000 constant MALLOC_CAP_RETENTION
|
||||||
|
decimal
|
||||||
forth definitions
|
forth definitions
|
||||||
|
|
||||||
Reference in New Issue
Block a user