[cc65] SERIAL.H on an Apple IIe - Problem with SER_LOAD_DRIVER

From: Daniel Werner <danielhwerner1hotmail.com>
Date: 2011-04-21 22:58:31
Hi to all.

I'm trying to create a Apple2 program that utilize the serial port, but I keep getting the same error:

'SER_ERR_CANNOT_LOAD'

I'm using the latest cc65 compiler.



Can anyone help me?



Thanks,

Daniel H. Werner





Here is the code:

//------------------------------------------------

//------------------------------------------------
#include <serial.h>
#include <conio.h>
#include <string.h>

void resolve_erro_serial(unsigned char Codigo);

char StatusConexao2[40];

void resolve_erro_serial(unsigned char Codigo)
{
   if (Codigo == SER_ERR_OK          ) strcpy(StatusConexao2, "Ok"                         );
   if (Codigo == SER_ERR_NO_DRIVER   ) strcpy(StatusConexao2, "No driver available"        );  
   if (Codigo == SER_ERR_CANNOT_LOAD ) strcpy(StatusConexao2, "Error loading driver"       );
   if (Codigo == SER_ERR_INV_DRIVER  ) strcpy(StatusConexao2, "Invalid driver"             );
   if (Codigo == SER_ERR_NO_DEVICE   ) strcpy(StatusConexao2, "Hardware device not found"  );
   if (Codigo == SER_ERR_BAUD_UNAVAIL) strcpy(StatusConexao2, "Baud rate not available"    );
   if (Codigo == SER_ERR_NO_DATA     ) strcpy(StatusConexao2, "Nothing to read"            );
   if (Codigo == SER_ERR_OVERFLOW    ) strcpy(StatusConexao2, "No room in send buffer"     );
   if (Codigo == SER_ERR_INIT_FAILED ) strcpy(StatusConexao2, "Initialization failed"      );  
   if (Codigo == SER_ERR_INV_IOCTL   ) strcpy(StatusConexao2, "IOCTL not supported"        ); 
}

void main()
{
   unsigned char Ser_Erro;


   Ser_Erro = ser_load_driver("a2e.ssc.ser");


   resolve_erro_serial(Ser_Erro);
   cprintf("\n %s \n", StatusConexao2);


   ser_unload();
}

//------------------------------------------------


//------------------------------------------------



 		 	   		  ----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Apr 21 23:00:41 2011

This archive was generated by hypermail 2.1.8 : 2011-04-21 23:00:45 CEST