Hack-a-Day / basic-badge

2018 Hackaday Belgrade Hardware Badge
MIT License
36 stars 8 forks source link

Better error reporting in BASIC #13

Closed szczys closed 6 years ago

szczys commented 6 years ago

Basic should provide error reporting. Something like:

"Syntax Error on Line XX"

jaromir-sukuba commented 6 years ago

Since v 0.24 I implemented a bit more sensible way of reporting errors in BASIC source in form of 'Bad token x at line y' where x is token number and y is line number. The most important information is y - line number - so as the BASIC sources are usually not horrible complicated, most users probably will not need the bad token number, just line number. Leaving the token number in output can help more advanced users to spot what's wrong. So if you run program 10 print 5 20 hovercraft you get error ''Bad token 31 at line 20'

vantonic commented 6 years ago

At this moment it works fine, there is only a problem with music tone stability. For some reason, the pitch drifts and I think that OCxR and OCxRS registers are somehow affected during tone playing. Also, could the tone go OFF automatically after the last tone played, so that you don't have to reinitialize it to TONE 0,0,0,0 at the end?

I measured RUN and SLEEP currents. It consumes only 60 mA in ON state (which is surprisingly low) and 173 µA in OFF state. So we can expect that battery life will be about 33 hours of running or 3 years of sleeping.

On Mon, Apr 30, 2018 at 5:49 AM, jaromir-sukuba notifications@github.com wrote:

Since v 0.24 I implemented a bit more sensible way of reporting errors in BASIC source in form of 'Bad token x at line y' where x is token number and y is line number. The most important information is y - line number - so as the BASIC sources are usually not horrible complicated, most users probably will not need the bad token number, just line number. Leaving the token number in output can help more advanced users to spot what's wrong. So if you run program 10 print 5 20 hovercraft you get error ''Bad token 31 at line 20'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SupplyFrame/basic-badge/issues/13#issuecomment-385388893, or mute the thread https://github.com/notifications/unsubscribe-auth/ANMcl0k7NonfEs587uMSjT4Z2_jsgkrIks5ttwhqgaJpZM4Tj-Wk .

szczys commented 6 years ago

@vantonic Great news on current consumption! I'll open a wishlist ticket for TONE off automatically (this may be more involved depending on how it's currently implemented). I'll also open a bug to check drifting in tone.

Basic error reporting is implemented so I am closing this ticket.