I am new to z88dk and i want to use the rs232 port in a Zx Spectrum +2.
I has started with the rs232 example.
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <rs232.h>
char byte[1];
int f;
int main()
{
printf ("%cChecking basic RS232 capabilities...\n",12);
if (rs232_params(RS_BAUD_1200, RS_PAR_NONE) == RS_ERR_OK)
printf (" 1200 baud, N, 8, 1\n");
if (rs232_params(RS_BAUD_2400, RS_PAR_NONE) == RS_ERR_OK)
printf (" 2400 baud, N, 8, 1\n");
if (rs232_params(RS_BAUD_4800, RS_PAR_NONE) == RS_ERR_OK)
printf (" 4800 baud, N, 8, 1\n");
if (rs232_params(RS_BAUD_9600, RS_PAR_NONE) == RS_ERR_OK)
printf (" 9600 baud, N, 8, 1\n");
if (rs232_params(RS_BAUD_19200, RS_PAR_NONE) == RS_ERR_OK)
printf (" 19200 baud, N, 8, 1\n");
printf ("\nInitializing at 1200 baud:");
if (rs232_params(RS_BAUD_1200, RS_PAR_NONE) != RS_ERR_OK) {
printf (" Error setting baud rate. Exiting...\n");
exit(0);
}
if (rs232_init() != RS_ERR_OK) {
printf (" Initialization error. Exiting...\n");
exit(0);
}
printf (" Done.\n");
rs232_put('-');
rs232_put('>');
printf ("\nEchoing 10 bytes to console: ");
for (f=0; f<10; f++) {
while (rs232_get(&byte[0]) != RS_ERR_OK);
//printf ("%c",byte[0]);
fputc_cons (byte[0]);
}
rs232_put('.');
printf ("\n\nClosing RS232 port:\n");
if (rs232_close() != RS_ERR_OK) {
printf (" Error. Exiting...\n");
exit(0);
}
}
zcc +zx -lp3 -ndos -lm -create-app serial.c>build.txt
And get this error
Code: Select all
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_INIT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PUT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PUT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_GET'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PUT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_CLOSE'
12 errors occurred during assembly
Key to filenames:
serial.o = serial.c
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PARAMS'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_INIT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PUT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PUT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_GET'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_PUT'
Error at file 'serial.asm' module 'SERIAL': Symbol not defined in expression 'RS232_CLOSE'