Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial esp-lisp as it was 2015-09-22 19:19
- initial datatypes: string, atom, cons, int, prim - primitive function apply - slow but generic - lisp reader - princ writer, terpri - a version of lisp eval that only calls a primitive function - some tests for reader/writer and primitive call - ./run to compile and run on desktop and to compile for esp, run make flash to flush - ./mcu to connect to chip
- Loading branch information
Showing
8 changed files
with
517 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Simple makefile for eps-lisp | ||
PROGRAM=*.c | ||
include ../esp-open-rtos/common.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
source ../path-add-esp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* 2015-09-22 (C) Jonas S Karlsson, jsk@yesco.org */ | ||
/* "driver" for esp-open-rtos put in examples/lisp */ | ||
|
||
#include "espressif/esp_common.h" | ||
#include "espressif/sdk_private.h" | ||
#include "FreeRTOS.h" | ||
#include "task.h" | ||
#include "queue.h" | ||
|
||
#include <string.h> | ||
|
||
#include "lisp.h" | ||
|
||
void task1(void *pvParameters) | ||
{ | ||
xQueueHandle *queue = (xQueueHandle *)pvParameters; | ||
printf("Hello from task1!\r\n"); | ||
uint32_t count = 0; | ||
while(1) { | ||
vTaskDelay(300); // 3s | ||
|
||
unsigned int mem = xPortGetFreeHeapSize(); | ||
printf("free=%u\r\n", mem); | ||
lisptest(); | ||
printf("free=%u USED=%u\r\n", xPortGetFreeHeapSize(), (unsigned int)(mem-xPortGetFreeHeapSize())); | ||
|
||
xQueueSend(*queue, &count, 0); | ||
count++; | ||
} | ||
} | ||
|
||
void task2(void *pvParameters) | ||
{ | ||
printf("Hello from task 2!\r\n"); | ||
xQueueHandle *queue = (xQueueHandle *)pvParameters; | ||
while(1) { | ||
uint32_t count; | ||
if(xQueueReceive(*queue, &count, 1000)) { | ||
//printf("Got %u\n", count); | ||
putchar('.'); | ||
} else { | ||
printf("No msg :(\n"); | ||
} | ||
} | ||
} | ||
|
||
static xQueueHandle mainqueue; | ||
|
||
void user_init(void) | ||
{ | ||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200); | ||
printf("SDK version:%s\n", sdk_system_get_sdk_version()); | ||
|
||
lispinit(); | ||
|
||
mainqueue = xQueueCreate(10, sizeof(uint32_t)); | ||
xTaskCreate(task1, (signed char *)"tsk1", 256, &mainqueue, 2, NULL); | ||
xTaskCreate(task2, (signed char *)"tsk2", 256, &mainqueue, 2, NULL); | ||
} |
Oops, something went wrong.