Commit be6c67c6 authored by julien.delange's avatar julien.delange
Browse files

* po-hi-c/src/po_hi_gqueue.c

   - Comment useless debug message since the code can now
     be considered as stable

 * po-hi-c/src/drivers/po_hi_driver_rasta_serial.c
   - Fix the CR/LF carriage return character

 * po-hi-c/src/drivers/po_hi_driver_linux_serial.c
   - Add more debug information (vars and ports size)


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@1436 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 27b35d83
......@@ -205,19 +205,40 @@ int __po_hi_c_driver_serial_linux_sender (__po_hi_task_id task_id, __po_hi_port
__po_hi_msg_reallocate (&msg);
request->port = destination_port;
__DEBUGMSG ("REQUEST vars: |");
{
int s;
int i;
uint8_t* tmp;
tmp = (uint8_t*) &(request->vars);
s = sizeof (request->vars);
for (i = 0 ; i < s ; i++)
{
printf("%x", *tmp);
tmp++;
fflush (stdout);
}
}
__DEBUGMSG ("|\n");
__po_hi_marshall_request (request, &msg);
__po_hi_marshall_request (request, &msg);
printf ("MSG AVANT SWAP:");
__po_hi_messages_debug (&msg);
printf ("\n");
for (tmp = 0 ; tmp < __PO_HI_MESSAGES_MAX_SIZE ; tmp += 4)
{
swap_pointer = (unsigned long*) &msg.content[tmp];
swap_value = *swap_pointer;
*swap_pointer = __po_hi_swap_byte (swap_value);
}
printf ("MSG APRES SWAP:");
__po_hi_messages_debug (&msg);
printf ("\n");
n = write (po_hi_c_driver_serial_fd, &msg, __PO_HI_MESSAGES_MAX_SIZE);
__DEBUGMSG ("[LINUX SERIAL] write() returns %d\n", n);
__DEBUGMSG ("[LINUX SERIAL] write() returns %d, sizeof (port)=%d, sizeof(vars)=%d\n", n, sizeof (request->port), sizeof (request->vars));
__DEBUGMSG ("[LINUX SERIAL] Message sent: 0x");
......
......@@ -40,10 +40,11 @@
int po_hi_c_driver_rasta_serial_fd;
__po_hi_msg_t msg;
__po_hi_request_t request;
void __po_hi_c_driver_serial_rasta_poller (void)
{
__po_hi_msg_t msg;
__po_hi_request_t request;
int n;
int ts;
......@@ -53,7 +54,7 @@ void __po_hi_c_driver_serial_rasta_poller (void)
__DEBUGMSG ("[RASTA SERIAL] Hello, i'm the serial poller !\n");
ts = __PO_HI_MESSAGES_MAX_SIZE;
tr = 0;
ptr = &msg.content;
ptr = &(msg.content[0]);
while (ts > 0)
{
n = read (po_hi_c_driver_rasta_serial_fd, ptr, ts);
......@@ -81,7 +82,26 @@ void __po_hi_c_driver_serial_rasta_poller (void)
__po_hi_unmarshall_request (&request, &msg);
__DEBUGMSG ("[RASTA SERIAL] Destination port: %d\n", request.port);
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("REQUEST vars: |");
{
int s;
int i;
uint8_t* tmp;
tmp = (uint8_t*) &(request.vars);
s = sizeof (request.vars);
for (i = 0 ; i < s ; i++)
{
printf("%x", *tmp);
tmp++;
fflush (stdout);
}
}
__DEBUGMSG ("|\n");
#endif
__DEBUGMSG ("[RASTA SERIAL] Destination port: %d, sizeof(port)=%d, sizeof(vars)=%d\n", request.port, sizeof( request.port), sizeof (request.vars));
__po_hi_main_deliver (&request);
}
......@@ -99,7 +119,7 @@ void __po_hi_c_driver_serial_rasta_init (__po_hi_device_id id)
__PO_HI_DRIVERS_RTEMS_UTILS_IOCTL(po_hi_c_driver_rasta_serial_fd, APBUART_SET_BLOCKING, APBUART_BLK_RX | APBUART_BLK_TX | APBUART_BLK_FLUSH);
__PO_HI_DRIVERS_RTEMS_UTILS_IOCTL(po_hi_c_driver_rasta_serial_fd, APBUART_SET_TXFIFO_LEN, 64); /* Transmitt buffer 64 chars */
__PO_HI_DRIVERS_RTEMS_UTILS_IOCTL(po_hi_c_driver_rasta_serial_fd, APBUART_SET_RXFIFO_LEN, 256); /* Receive buffer 256 chars */
__PO_HI_DRIVERS_RTEMS_UTILS_IOCTL(po_hi_c_driver_rasta_serial_fd, APBUART_SET_ASCII_MODE, 1); /* Make \n go \n\r or \r\n */
__PO_HI_DRIVERS_RTEMS_UTILS_IOCTL(po_hi_c_driver_rasta_serial_fd, APBUART_SET_ASCII_MODE, 0); /* Make \n go \n\r or \r\n */
__PO_HI_DRIVERS_RTEMS_UTILS_IOCTL(po_hi_c_driver_rasta_serial_fd, APBUART_CLR_STATS, 0);
__PO_HI_DRIVERS_RTEMS_UTILS_IOCTL(po_hi_c_driver_rasta_serial_fd, APBUART_START, 0);
......
......@@ -406,16 +406,21 @@ rtems_id __po_hi_gqueues_barriers[__PO_HI_NB_TASKS];
sizeof (__po_hi_request_t));
}
/*
* As this part of the code is now considered as stable, we don't print debug output
*
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("Task %d get a value on port %d\n", id, port);
__DEBUGMSG ("RECEIVED Value: |");
__DEBUGMSG ("RECEIVED vars in gqueue: |");
{
int s;
int i;
unsigned int* tmp;
uint8_t* tmp;
tmp = (unsigned int*) &request->vars;
s = sizeof (request->vars);
for (i = 0 ; i < s ; i+=4)
for (i = 0 ; i < s ; i++)
{
printf("%x", *tmp);
tmp++;
......@@ -424,6 +429,7 @@ rtems_id __po_hi_gqueues_barriers[__PO_HI_NB_TASKS];
}
__DEBUGMSG ("|\n");
#endif
*/
#if defined (POSIX) || defined (RTEMS_POSIX)
pthread_mutex_unlock (&__po_hi_gqueues_mutexes[id]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment