From 1d26bfeaa6ad1760e867b1534bcca634dcd3973a Mon Sep 17 00:00:00 2001 From: Stefan Lenz Date: Wed, 1 May 2024 11:17:49 +0200 Subject: [PATCH] Settings for RaspPi corrected --- Basic2/Posix/basic.c | 2 +- Basic2/Posix/basic.h | 2 +- Basic2/Posix/runtime.c | 13 +++++++++---- Basic2/RaspPi/basic.c | 2 +- Basic2/RaspPi/runtime.c | 13 +++++++++---- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Basic2/Posix/basic.c b/Basic2/Posix/basic.c index c16ad6c..06c8c22 100755 --- a/Basic2/Posix/basic.c +++ b/Basic2/Posix/basic.c @@ -392,7 +392,7 @@ const bworkfunction_t workfunctions[] PROGMEM = { /* errors and messages */ const char mfile[] PROGMEM = "file.bas"; const char mprompt[] PROGMEM = "> "; -const char mgreet[] PROGMEM = "Stefan's Basic 2.0alpha"; +const char mgreet[] PROGMEM = "Stefan's Basic 2.0"; const char mline[] PROGMEM = "LINE"; const char mnumber[] PROGMEM = "NUMBER"; const char mvariable[] PROGMEM = "VARIABLE"; diff --git a/Basic2/Posix/basic.h b/Basic2/Posix/basic.h index 7f9e0ab..b2cd8e0 100755 --- a/Basic2/Posix/basic.h +++ b/Basic2/Posix/basic.h @@ -15,7 +15,7 @@ */ /* - * A few of the buffers and vars come from hardware.h. + * A few of the buffers and vars come from hardware.h. These are * * #define BUFSIZE * #define STACKSIZE diff --git a/Basic2/Posix/runtime.c b/Basic2/Posix/runtime.c index 91ccbb3..98c60b6 100755 --- a/Basic2/Posix/runtime.c +++ b/Basic2/Posix/runtime.c @@ -534,9 +534,14 @@ void wiringbegin() { #endif #ifdef POSIXPIGPIO pigpio_pi=pigpio_start("localhost","8888"); - printf("** GPIO started with result %d\n", pigpio_pi); - printf("** pigpio version %d.\n", get_pigpio_version(pigpio_pi)); - printf("** Hardware revision %d.\n", get_hardware_revision(pigpio_pi)); + if (pigpio_pi == 0) { + printf("GPIO started with result %d\n", pigpio_pi); + printf("pigpio version %d.\n", get_pigpio_version(pigpio_pi)); + printf("Hardware revision %d.\n", get_hardware_revision(pigpio_pi)); + } else { + printf("GPIO failed to start with result %d\n", pigpio_pi); + printf("** Does pigpiod run? "); + } #endif } @@ -682,7 +687,7 @@ void vgabegin() { printf("** error reading screen information \n"); return; } - printf("** detected screen %dx%d, %dbpp \n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel); + printf("Detected screen %dx%d, %dbpp \n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel); /* BASIC currently does 24 bit color only */ memcpy(&orig_vinfo, &vinfo, sizeof(struct fb_var_screeninfo)); diff --git a/Basic2/RaspPi/basic.c b/Basic2/RaspPi/basic.c index c16ad6c..06c8c22 100755 --- a/Basic2/RaspPi/basic.c +++ b/Basic2/RaspPi/basic.c @@ -392,7 +392,7 @@ const bworkfunction_t workfunctions[] PROGMEM = { /* errors and messages */ const char mfile[] PROGMEM = "file.bas"; const char mprompt[] PROGMEM = "> "; -const char mgreet[] PROGMEM = "Stefan's Basic 2.0alpha"; +const char mgreet[] PROGMEM = "Stefan's Basic 2.0"; const char mline[] PROGMEM = "LINE"; const char mnumber[] PROGMEM = "NUMBER"; const char mvariable[] PROGMEM = "VARIABLE"; diff --git a/Basic2/RaspPi/runtime.c b/Basic2/RaspPi/runtime.c index 91ccbb3..98c60b6 100755 --- a/Basic2/RaspPi/runtime.c +++ b/Basic2/RaspPi/runtime.c @@ -534,9 +534,14 @@ void wiringbegin() { #endif #ifdef POSIXPIGPIO pigpio_pi=pigpio_start("localhost","8888"); - printf("** GPIO started with result %d\n", pigpio_pi); - printf("** pigpio version %d.\n", get_pigpio_version(pigpio_pi)); - printf("** Hardware revision %d.\n", get_hardware_revision(pigpio_pi)); + if (pigpio_pi == 0) { + printf("GPIO started with result %d\n", pigpio_pi); + printf("pigpio version %d.\n", get_pigpio_version(pigpio_pi)); + printf("Hardware revision %d.\n", get_hardware_revision(pigpio_pi)); + } else { + printf("GPIO failed to start with result %d\n", pigpio_pi); + printf("** Does pigpiod run? "); + } #endif } @@ -682,7 +687,7 @@ void vgabegin() { printf("** error reading screen information \n"); return; } - printf("** detected screen %dx%d, %dbpp \n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel); + printf("Detected screen %dx%d, %dbpp \n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel); /* BASIC currently does 24 bit color only */ memcpy(&orig_vinfo, &vinfo, sizeof(struct fb_var_screeninfo));