Release 4.5a - 16th January 2024
Adjust memory for Arduino Uno R4 Minima; add Tab feature for line editor.
This commit is contained in:
parent
e7a1450afe
commit
97e61151df
|
@ -1,5 +1,5 @@
|
||||||
/* uLisp ARM Release 4.5 - www.ulisp.com
|
/* uLisp ARM Release 4.5a - www.ulisp.com
|
||||||
David Johnson-Davies - www.technoblogy.com - 8th July 2023
|
David Johnson-Davies - www.technoblogy.com - 16th January 2024
|
||||||
|
|
||||||
Licensed under the MIT license: https://opensource.org/licenses/MIT
|
Licensed under the MIT license: https://opensource.org/licenses/MIT
|
||||||
*/
|
*/
|
||||||
|
@ -225,7 +225,7 @@ const char LispLibrary[] PROGMEM = "";
|
||||||
#define CPU_RP2040
|
#define CPU_RP2040
|
||||||
|
|
||||||
#elif defined(ARDUINO_MINIMA)
|
#elif defined(ARDUINO_MINIMA)
|
||||||
#define WORKSPACESIZE (2160-SDSIZE) /* Objects (8*bytes) was 2160 */
|
#define WORKSPACESIZE (2032-SDSIZE) /* Objects (8*bytes) */
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
#define EEPROMFLASH
|
#define EEPROMFLASH
|
||||||
#define FLASHSIZE 8192 /* Bytes */
|
#define FLASHSIZE 8192 /* Bytes */
|
||||||
|
@ -236,7 +236,7 @@ const char LispLibrary[] PROGMEM = "";
|
||||||
#define SDCARD_SS_PIN 10
|
#define SDCARD_SS_PIN 10
|
||||||
|
|
||||||
#elif defined(ARDUINO_UNOWIFIR4)
|
#elif defined(ARDUINO_UNOWIFIR4)
|
||||||
#define WORKSPACESIZE (1700-SDSIZE) /* Objects (8*bytes) was 2160 */
|
#define WORKSPACESIZE (1700-SDSIZE) /* Objects (8*bytes) */
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
#include "WiFiS3.h"
|
#include "WiFiS3.h"
|
||||||
#define EEPROMFLASH
|
#define EEPROMFLASH
|
||||||
|
@ -7108,7 +7108,7 @@ void loadfromlibrary (object *env) {
|
||||||
|
|
||||||
// For line editor
|
// For line editor
|
||||||
const int TerminalWidth = 80;
|
const int TerminalWidth = 80;
|
||||||
volatile int WritePtr = 0, ReadPtr = 0;
|
volatile int WritePtr = 0, ReadPtr = 0, LastWritePtr = 0;
|
||||||
const int KybdBufSize = 333; // 42*8 - 3
|
const int KybdBufSize = 333; // 42*8 - 3
|
||||||
char KybdBuf[KybdBufSize];
|
char KybdBuf[KybdBufSize];
|
||||||
volatile uint8_t KybdAvailable = 0;
|
volatile uint8_t KybdAvailable = 0;
|
||||||
|
@ -7162,7 +7162,7 @@ void processkey (char c) {
|
||||||
if (c == '\n' || c == '\r') {
|
if (c == '\n' || c == '\r') {
|
||||||
pserial('\n');
|
pserial('\n');
|
||||||
KybdAvailable = 1;
|
KybdAvailable = 1;
|
||||||
ReadPtr = 0;
|
ReadPtr = 0; LastWritePtr = WritePtr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (c == 8 || c == 0x7f) { // Backspace key
|
if (c == 8 || c == 0x7f) { // Backspace key
|
||||||
|
@ -7171,6 +7171,9 @@ void processkey (char c) {
|
||||||
Serial.write(8); Serial.write(' '); Serial.write(8);
|
Serial.write(8); Serial.write(' '); Serial.write(8);
|
||||||
if (WritePtr) c = KybdBuf[WritePtr-1];
|
if (WritePtr) c = KybdBuf[WritePtr-1];
|
||||||
}
|
}
|
||||||
|
} else if (c == 9) { // tab or ctrl-I
|
||||||
|
for (int i = 0; i < LastWritePtr; i++) Serial.write(KybdBuf[i]);
|
||||||
|
WritePtr = LastWritePtr;
|
||||||
} else if (WritePtr < KybdBufSize) {
|
} else if (WritePtr < KybdBufSize) {
|
||||||
KybdBuf[WritePtr++] = c;
|
KybdBuf[WritePtr++] = c;
|
||||||
Serial.write(c);
|
Serial.write(c);
|
||||||
|
@ -7417,13 +7420,14 @@ void initgfx () {
|
||||||
// Entry point from the Arduino IDE
|
// Entry point from the Arduino IDE
|
||||||
void setup () {
|
void setup () {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
delay(2000);
|
||||||
int start = millis();
|
int start = millis();
|
||||||
while ((millis() - start) < 5000) { if (Serial) break; }
|
while ((millis() - start) < 5000) { if (Serial) break; }
|
||||||
initworkspace();
|
initworkspace();
|
||||||
initenv();
|
initenv();
|
||||||
initsleep();
|
initsleep();
|
||||||
initgfx();
|
initgfx();
|
||||||
pfstring(PSTR("uLisp 4.5 "), pserial); pln(pserial);
|
pfstring(PSTR("uLisp 4.5a "), pserial); pln(pserial);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read/Evaluate/Print loop
|
// Read/Evaluate/Print loop
|
||||||
|
|
Loading…
Reference in New Issue