How many times have you used HSerPrint and you get no output, or, you Print and all you get is a load of unrelated error messages?
These changes to the compiler will resolve these issues.
I have added new capabilities to detect missing USART and LCD setup parameters. This is two different solutions but the user experience is really improved!
LCD Error
The error was like this ....
>>> WARNINGs / ERRORs reported by Great Cow BASIC <<<
lcd.h (559): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (562): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (563): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (564): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (565): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (566): Error: SYSLCDTEMP.1 is not a valid I/O pin or port
lcd.h (567): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (964): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (1054): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (1055): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (1056): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
lcd.h (1057): Error: SYSLCDTEMP.0 is not a valid I/O pin or port
now
An error has been found:
Error: LCD Parameters not setup correctly - please correct the LCD setup
At least the user now knows to looks at the LCD setup not wading through LCD.h
USART
If you did not define the constant USART_BAUD_RATE you got NOTHING.... no errors, no assembly messages.. just nothing.
now you get a message telling you to specify the baud rate.
An error has been found:
Error: USART NOT SETUP CORRECTLY. NO BAUD RATE SPECIFIED - PLEASE CORRECT
USART SETUP
Help
LCD ERROR HANDLING
The setup of an LCD is inspected and an appropriate error message is displayed. The Compiler now controls error messages when LCD is not setup up correctly. This is hard coded into the compiler (at build 1131 or greater).
RAISING COMPILER ERROR CONDITIONS
From build 1131 or greater the compiler now supports raising a compiler error message.
The method uses the RaiseCompilerError method to pass an error message to the compilation process.
An example from USART.H/INITUSART subroutine is shown below. This example tests for the existence of one of the three supported baud rate constants. If none of the constants exist and the constant (in this example) STOPCOMPILERERRORHANDLER does not exist the RaiseCompilerError with the string will be passed to the assembler for error processing. This permits the inspect of the user program with appropriate messages to inform the user.
....#IFNDEFONEOF(USART_BAUD_RATE,USART1_BAUD_RATE,USART2_BAUD_RATE)THEN'LookforoneofthebaudratesCONSTANTS#IFNDEFSTOPCOMPILERERRORHANDLERRaiseCompilerError"USART not setup correctly. No baud rate specified - please correct USART setup"#ENDIF#ENDIF.....
The RaiseCompilerError handler can be stopped using the constant STOPCOMPILERERRORHANDLER as shown above.
The RaiseCompilerError can be used in any library or user program, The syntax is strict (as folllows).
`
RaiseCompilerError "String message - with double quotes"
RaiseCompilerError "%message.dat string%"
`
Hopefully, these changes will improve the experience of using Great Cow BASIC.
Last edit: Anobium 2022-06-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
RaiseCompilerError will be quite useful to developers and advanced users. Can be used for error trapping, debugging code, and especially in libraries to check for necessary user defined constants.
Thanks !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How many times have you used HSerPrint and you get no output, or, you Print and all you get is a load of unrelated error messages?
These changes to the compiler will resolve these issues.
I have added new capabilities to detect missing USART and LCD setup parameters. This is two different solutions but the user experience is really improved!
LCD Error
The error was like this ....
now
At least the user now knows to looks at the LCD setup not wading through LCD.h
USART
If you did not define the constant USART_BAUD_RATE you got NOTHING.... no errors, no assembly messages.. just nothing.
now you get a message telling you to specify the baud rate.
Help
LCD ERROR HANDLING
The setup of an LCD is inspected and an appropriate error message is displayed. The Compiler now controls error messages when LCD is not setup up correctly. This is hard coded into the compiler (at build 1131 or greater).
RAISING COMPILER ERROR CONDITIONS
From build 1131 or greater the compiler now supports raising a compiler error message.
The method uses the RaiseCompilerError method to pass an error message to the compilation process.
An example from USART.H/INITUSART subroutine is shown below. This example tests for the existence of one of the three supported baud rate constants. If none of the constants exist and the constant (in this example) STOPCOMPILERERRORHANDLER does not exist the RaiseCompilerError with the string will be passed to the assembler for error processing. This permits the inspect of the user program with appropriate messages to inform the user.
The RaiseCompilerError handler can be stopped using the constant STOPCOMPILERERRORHANDLER as shown above.
The RaiseCompilerError can be used in any library or user program, The syntax is strict (as folllows).
`
RaiseCompilerError "String message - with double quotes"
`
Hopefully, these changes will improve the experience of using Great Cow BASIC.
Last edit: Anobium 2022-06-25
A very nice addition.
RaiseCompilerError will be quite useful to developers and advanced users. Can be used for error trapping, debugging code, and especially in libraries to check for necessary user defined constants.
Thanks !
Hopefully, helps everyone.
Thank you.