slviajero / tinybasic

A BASIC interpreter for Arduino, ESP, RP2040, STM32, Infineon XMC and POSIX with IoT and microcontroller features.
GNU General Public License v3.0
199 stars 31 forks source link

Various issues encountered #34

Closed brentdcarlson closed 1 year ago

brentdcarlson commented 1 year ago

Several issues I have encountered:

run num doesn't work

@S doesn't report end of file for file read

open "filename",2 - doesn't append to an existing file

delete "filename" doesn't work

display scrolling doesn't update colors properly when text is not updated

slviajero commented 1 year ago

Thank you for the report.

As to RUN num: this should work but doesn’t any more. Probably a bug coming from the command line code. You can use GOTO num from the command line as a workaround. GOTO num doesn’t CLR but starts the program. I will look into this.

The filesystem related things are probably coming from the filesystem implementation of the platform. The SD libraries of different cores are often very different. If I have the e xact configuration I can rebuild it. Can you give me more details, please? Which platform and which hardware-settings? I would need the hardware-arduino.h hardware settings file.

Display: The reason for this is that the display driver is not really color aware. It only has a text buffer. This is because the code does not hardware scroll but redraw the text instead. It is a works as designed type of thing. Never thought of it. Will look into it now as I am about to rewrite the display driver.

Am 09.11.2022 um 20:46 schrieb brentdcarlson @.***>:

Several issues I have encountered:

run num doesn't work

@s https://github.com/s doesn't report end of file for file read

open "filename",2 - doesn't append to an existing file

delete "filename" doesn't work

display scrolling doesn't update colors properly when text is not updated

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56B5UI5CAJOOCJDWVOTWHP5SXANCNFSM6AAAAAAR3ZLQ7Q. You are receiving this because you are subscribed to this thread.

slviajero commented 1 year ago

Run NUM is fixed now for all platforms

Am 09.11.2022 um 20:46 schrieb brentdcarlson @.***>:

Several issues I have encountered:

run num doesn't work

@s https://github.com/s doesn't report end of file for file read

open "filename",2 - doesn't append to an existing file

delete "filename" doesn't work

display scrolling doesn't update colors properly when text is not updated

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56B5UI5CAJOOCJDWVOTWHP5SXANCNFSM6AAAAAAR3ZLQ7Q. You are receiving this because you are subscribed to this thread.

brentdcarlson commented 1 year ago

Thanks for the quick response. I'm enjoying working with your platform.

Using Arduino IDE 2.0.1, "DOIT ESP32 DEVKIT V1", 3.5" display, ILI9488 controller with SD card for file storage, BMP280, DHT22, DS3231 RTC

undef USESPICOSERIAL

define ARDUINOPS2

undef ARDUINOUSBKBD

undef ARDUINOZX81KBD

undef ARDUINOPRT

define DISPLAYCANSCROLL

undef ARDUINOLCDI2C

undef ARDUINONOKIA51

define ARDUINOILI9488

undef ARDUINOSSD1306

undef ARDUINOMCUFRIEND

undef ARDUINOGRAPHDUMMY

undef LCDSHIELD

undef ARDUINOTFT

undef ARDUINOVGA

undef ARDUINOEEPROM

undef ARDUINOI2CEEPROM

undef ARDUINOEFS

define ARDUINOSD

undef ESPSPIFFS

undef RP2040LITTLEFS

define ARDUINORTC

define ARDUINOWIRE

undef ARDUINOWIRESLAVE

undef ARDUINORF24

undef ARDUINOETH

define ARDUINOMQTT

define ARDUINOSENSORS

undef ARDUINOSPIRAM

undef STANDALONE

slviajero commented 1 year ago

Super, thank you! ESP32. I thought so. One of the platforms that is a little different. I could reproduce the EOF bug. Looks like ESP32 does not return an EOF character at end of file. Will try to fix this now.

Am 10.11.2022 um 14:00 schrieb brentdcarlson @.***>:

Thanks for the quick response. I'm enjoying working with your platform.

Using Arduino IDE 2.0.1, "DOIT ESP32 DEVKIT V1", 3.5" display, ILI9488 controller with SD card for file storage, BMP280, DHT22, DS3231 RTC

undef USESPICOSERIAL

define ARDUINOPS2

undef ARDUINOUSBKBD

undef ARDUINOZX81KBD

undef ARDUINOPRT

define DISPLAYCANSCROLL

undef ARDUINOLCDI2C

undef ARDUINONOKIA51

define ARDUINOILI9488

undef ARDUINOSSD1306

undef ARDUINOMCUFRIEND

undef ARDUINOGRAPHDUMMY

undef LCDSHIELD

undef ARDUINOTFT

undef ARDUINOVGA

undef ARDUINOEEPROM

undef ARDUINOI2CEEPROM

undef ARDUINOEFS

define ARDUINOSD

undef ESPSPIFFS

undef RP2040LITTLEFS

define ARDUINORTC

define ARDUINOWIRE

undef ARDUINOWIRESLAVE

undef ARDUINORF24

undef ARDUINOETH

define ARDUINOMQTT

define ARDUINOSENSORS

undef ARDUINOSPIRAM

undef STANDALONE

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310244844, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56CCFLP26MOUM2DROE3WHTWXXANCNFSM6AAAAAAR3ZLQ7Q. You are receiving this because you commented.

brentdcarlson commented 1 year ago

I used:

230 IF(A$(1,1))=255 THEN PRINT "End of file reached"

On Thu, Nov 10, 2022 at 12:32 PM Stefan Lenz @.***> wrote:

Super, thank you! ESP32. I thought so. One of the platforms that is a little different. I could reproduce the EOF bug. Looks like ESP32 does not return an EOF character at end of file. Will try to fix this now.

Am 10.11.2022 um 14:00 schrieb brentdcarlson @.***>:

Thanks for the quick response. I'm enjoying working with your platform.

Using Arduino IDE 2.0.1, "DOIT ESP32 DEVKIT V1", 3.5" display, ILI9488 controller with SD card for file storage, BMP280, DHT22, DS3231 RTC

undef USESPICOSERIAL

define ARDUINOPS2

undef ARDUINOUSBKBD

undef ARDUINOZX81KBD

undef ARDUINOPRT

define DISPLAYCANSCROLL

undef ARDUINOLCDI2C

undef ARDUINONOKIA51

define ARDUINOILI9488

undef ARDUINOSSD1306

undef ARDUINOMCUFRIEND

undef ARDUINOGRAPHDUMMY

undef LCDSHIELD

undef ARDUINOTFT

undef ARDUINOVGA

undef ARDUINOEEPROM

undef ARDUINOI2CEEPROM

undef ARDUINOEFS

define ARDUINOSD

undef ESPSPIFFS

undef RP2040LITTLEFS

define ARDUINORTC

define ARDUINOWIRE

undef ARDUINOWIRESLAVE

undef ARDUINORF24

undef ARDUINOETH

define ARDUINOMQTT

define ARDUINOSENSORS

undef ARDUINOSPIRAM

undef STANDALONE

— Reply to this email directly, view it on GitHub < https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310244844>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACSY56CCFLP26MOUM2DROE3WHTWXXANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310735480, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZZWBVLZHQPQEKVPISKO5TWHU5VPANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you authored the thread.Message ID: @.***>

slviajero commented 1 year ago

Just working on it. Looks like the ESP32 FS.cpp which is the base class of all the file systems on ESP somehow handles available() incorrectly but I could be wrong.

Am 10.11.2022 um 19:45 schrieb brentdcarlson @.***>:

I used:

230 IF(A$(1,1))=255 THEN PRINT "End of file reached"

On Thu, Nov 10, 2022 at 12:32 PM Stefan Lenz @.***> wrote:

Super, thank you! ESP32. I thought so. One of the platforms that is a little different. I could reproduce the EOF bug. Looks like ESP32 does not return an EOF character at end of file. Will try to fix this now.

Am 10.11.2022 um 14:00 schrieb brentdcarlson @.***>:

Thanks for the quick response. I'm enjoying working with your platform.

Using Arduino IDE 2.0.1, "DOIT ESP32 DEVKIT V1", 3.5" display, ILI9488 controller with SD card for file storage, BMP280, DHT22, DS3231 RTC

undef USESPICOSERIAL

define ARDUINOPS2

undef ARDUINOUSBKBD

undef ARDUINOZX81KBD

undef ARDUINOPRT

define DISPLAYCANSCROLL

undef ARDUINOLCDI2C

undef ARDUINONOKIA51

define ARDUINOILI9488

undef ARDUINOSSD1306

undef ARDUINOMCUFRIEND

undef ARDUINOGRAPHDUMMY

undef LCDSHIELD

undef ARDUINOTFT

undef ARDUINOVGA

undef ARDUINOEEPROM

undef ARDUINOI2CEEPROM

undef ARDUINOEFS

define ARDUINOSD

undef ESPSPIFFS

undef RP2040LITTLEFS

define ARDUINORTC

define ARDUINOWIRE

undef ARDUINOWIRESLAVE

undef ARDUINORF24

undef ARDUINOETH

define ARDUINOMQTT

define ARDUINOSENSORS

undef ARDUINOSPIRAM

undef STANDALONE

— Reply to this email directly, view it on GitHub < https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310244844>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACSY56CCFLP26MOUM2DROE3WHTWXXANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310735480, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZZWBVLZHQPQEKVPISKO5TWHU5VPANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310747616, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56HSPJG3BZLKSDPVBK3WHU7EDANCNFSM6AAAAAAR3ZLQ7Q. You are receiving this because you commented.

slviajero commented 1 year ago

Found it!

char in ESP32 is unsigned char hence 255 is EOF while in other platforms it is signed char hence -1 is EOF.

In my BASIC char is always signed char, hence 255 = -1. This goes deep in the code. Need to take a careful look.

Am 10.11.2022 um 19:45 schrieb brentdcarlson @.***>:

I used:

230 IF(A$(1,1))=255 THEN PRINT "End of file reached"

On Thu, Nov 10, 2022 at 12:32 PM Stefan Lenz @.***> wrote:

Super, thank you! ESP32. I thought so. One of the platforms that is a little different. I could reproduce the EOF bug. Looks like ESP32 does not return an EOF character at end of file. Will try to fix this now.

Am 10.11.2022 um 14:00 schrieb brentdcarlson @.***>:

Thanks for the quick response. I'm enjoying working with your platform.

Using Arduino IDE 2.0.1, "DOIT ESP32 DEVKIT V1", 3.5" display, ILI9488 controller with SD card for file storage, BMP280, DHT22, DS3231 RTC

undef USESPICOSERIAL

define ARDUINOPS2

undef ARDUINOUSBKBD

undef ARDUINOZX81KBD

undef ARDUINOPRT

define DISPLAYCANSCROLL

undef ARDUINOLCDI2C

undef ARDUINONOKIA51

define ARDUINOILI9488

undef ARDUINOSSD1306

undef ARDUINOMCUFRIEND

undef ARDUINOGRAPHDUMMY

undef LCDSHIELD

undef ARDUINOTFT

undef ARDUINOVGA

undef ARDUINOEEPROM

undef ARDUINOI2CEEPROM

undef ARDUINOEFS

define ARDUINOSD

undef ESPSPIFFS

undef RP2040LITTLEFS

define ARDUINORTC

define ARDUINOWIRE

undef ARDUINOWIRESLAVE

undef ARDUINORF24

undef ARDUINOETH

define ARDUINOMQTT

define ARDUINOSENSORS

undef ARDUINOSPIRAM

undef STANDALONE

— Reply to this email directly, view it on GitHub < https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310244844>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACSY56CCFLP26MOUM2DROE3WHTWXXANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310735480, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZZWBVLZHQPQEKVPISKO5TWHU5VPANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310747616, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56HSPJG3BZLKSDPVBK3WHU7EDANCNFSM6AAAAAAR3ZLQ7Q. You are receiving this because you commented.

slviajero commented 1 year ago

Bug fix is checked in @s and EOF is now handled correctly. I still left chars as unsigned chars on ESP.

Am 10.11.2022 um 19:45 schrieb brentdcarlson @.***>:

I used:

230 IF(A$(1,1))=255 THEN PRINT "End of file reached"

On Thu, Nov 10, 2022 at 12:32 PM Stefan Lenz @.***> wrote:

Super, thank you! ESP32. I thought so. One of the platforms that is a little different. I could reproduce the EOF bug. Looks like ESP32 does not return an EOF character at end of file. Will try to fix this now.

Am 10.11.2022 um 14:00 schrieb brentdcarlson @.***>:

Thanks for the quick response. I'm enjoying working with your platform.

Using Arduino IDE 2.0.1, "DOIT ESP32 DEVKIT V1", 3.5" display, ILI9488 controller with SD card for file storage, BMP280, DHT22, DS3231 RTC

undef USESPICOSERIAL

define ARDUINOPS2

undef ARDUINOUSBKBD

undef ARDUINOZX81KBD

undef ARDUINOPRT

define DISPLAYCANSCROLL

undef ARDUINOLCDI2C

undef ARDUINONOKIA51

define ARDUINOILI9488

undef ARDUINOSSD1306

undef ARDUINOMCUFRIEND

undef ARDUINOGRAPHDUMMY

undef LCDSHIELD

undef ARDUINOTFT

undef ARDUINOVGA

undef ARDUINOEEPROM

undef ARDUINOI2CEEPROM

undef ARDUINOEFS

define ARDUINOSD

undef ESPSPIFFS

undef RP2040LITTLEFS

define ARDUINORTC

define ARDUINOWIRE

undef ARDUINOWIRESLAVE

undef ARDUINORF24

undef ARDUINOETH

define ARDUINOMQTT

define ARDUINOSENSORS

undef ARDUINOSPIRAM

undef STANDALONE

— Reply to this email directly, view it on GitHub < https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310244844>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACSY56CCFLP26MOUM2DROE3WHTWXXANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310735480, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZZWBVLZHQPQEKVPISKO5TWHU5VPANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310747616, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56HSPJG3BZLKSDPVBK3WHU7EDANCNFSM6AAAAAAR3ZLQ7Q. You are receiving this because you commented.

slviajero commented 1 year ago

ESP32 FS bugs are fixed now, delete works and also file append.

Am 10.11.2022 um 19:45 schrieb brentdcarlson @.***>:

I used:

230 IF(A$(1,1))=255 THEN PRINT "End of file reached"

On Thu, Nov 10, 2022 at 12:32 PM Stefan Lenz @.***> wrote:

Super, thank you! ESP32. I thought so. One of the platforms that is a little different. I could reproduce the EOF bug. Looks like ESP32 does not return an EOF character at end of file. Will try to fix this now.

Am 10.11.2022 um 14:00 schrieb brentdcarlson @.***>:

Thanks for the quick response. I'm enjoying working with your platform.

Using Arduino IDE 2.0.1, "DOIT ESP32 DEVKIT V1", 3.5" display, ILI9488 controller with SD card for file storage, BMP280, DHT22, DS3231 RTC

undef USESPICOSERIAL

define ARDUINOPS2

undef ARDUINOUSBKBD

undef ARDUINOZX81KBD

undef ARDUINOPRT

define DISPLAYCANSCROLL

undef ARDUINOLCDI2C

undef ARDUINONOKIA51

define ARDUINOILI9488

undef ARDUINOSSD1306

undef ARDUINOMCUFRIEND

undef ARDUINOGRAPHDUMMY

undef LCDSHIELD

undef ARDUINOTFT

undef ARDUINOVGA

undef ARDUINOEEPROM

undef ARDUINOI2CEEPROM

undef ARDUINOEFS

define ARDUINOSD

undef ESPSPIFFS

undef RP2040LITTLEFS

define ARDUINORTC

define ARDUINOWIRE

undef ARDUINOWIRESLAVE

undef ARDUINORF24

undef ARDUINOETH

define ARDUINOMQTT

define ARDUINOSENSORS

undef ARDUINOSPIRAM

undef STANDALONE

— Reply to this email directly, view it on GitHub < https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310244844>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACSY56CCFLP26MOUM2DROE3WHTWXXANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310735480, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZZWBVLZHQPQEKVPISKO5TWHU5VPANCNFSM6AAAAAAR3ZLQ7Q . You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/34#issuecomment-1310747616, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56HSPJG3BZLKSDPVBK3WHU7EDANCNFSM6AAAAAAR3ZLQ7Q. You are receiving this because you commented.

slviajero commented 1 year ago

Issue closed, all bugs fixed except the scrolling part. This requires a redesign of the display driver code. It is to some degree "works as designed" as the display driver was meant to be monochrome from the beginning. Will add this to the documentation and then work on it. Will be a backlog item in the project.

slviajero commented 1 year ago

Just a final remark on the issues: color support on scroll is now added. Limited to VGA colors to save buffer space.