Commit c963c748 authored by jdelange's avatar jdelange

* po-hi-c/include/drivers/po_hi_driver_keyboard.h

   po-hi-c/include/drivers/po_hi_driver_rasta_serial.h
   po-hi-c/include/drivers/po_hi_driver_sockets.h
   po-hi-c/include/drivers/po_hi_driver_rasta_spacewire.h
   po-hi-c/include/drivers/configuration/1553.h
   po-hi-c/include/drivers/configuration/serial.h
   po-hi-c/include/drivers/configuration/spacewire.h
   po-hi-c/include/drivers/configuration/ip.h
   po-hi-c/include/drivers/po_hi_driver_leon_serial.h
   po-hi-c/include/drivers/po_hi_driver_linux_serial.h
   po-hi-c/src/drivers/po_hi_driver_rasta_serial.c
   po-hi-c/src/drivers/po_hi_driver_sockets.c
   po-hi-c/src/drivers/po_hi_driver_rasta_spacewire.c
   po-hi-c/src/drivers/po_hi_driver_leon_serial.c
   po-hi-c/src/drivers/configuration/serial.asn
   po-hi-c/src/drivers/configuration/serial.c
   po-hi-c/src/drivers/configuration/spacewire.c
   po-hi-c/src/drivers/configuration/ip.c
   po-hi-c/src/drivers/configuration/1553.c
   po-hi-c/src/drivers/po_hi_driver_linux_serial.c
   po-hi-c/src/drivers/po_hi_driver_keyboard.c
   - Adapt existing drivers with the new
     required signature: add a __po_hi_device_id
     argument to poller subprograms.

 * po-hi-c/share/make/Makefile.common
   - Give the priority to user-defined LDFLAGS



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@2702 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent ca3195bd
......@@ -2,8 +2,8 @@
#define _INC_1553_H
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:46
Date was: 6/22/2011
Time was: 11:00:14
*/
#include "asn1crt.h"
......
......@@ -2,8 +2,8 @@
#define _INC_IP_H
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:47
Date was: 6/22/2011
Time was: 11:00:14
*/
#include "asn1crt.h"
......
......@@ -2,8 +2,8 @@
#define _INC_SERIAL_H
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:47
Date was: 6/22/2011
Time was: 11:00:15
*/
#include "asn1crt.h"
......@@ -70,10 +70,10 @@ typedef struct {
} exist;
} __po_hi_c_serial_conf_t;
#define __po_hi_c_serial_conf_t_REQUIRED_BYTES_FOR_ENCODING 21
#define __po_hi_c_serial_conf_t_REQUIRED_BITS_FOR_ENCODING 166
#define __po_hi_c_serial_conf_t_REQUIRED_BYTES_FOR_ACN_ENCODING 24
#define __po_hi_c_serial_conf_t_REQUIRED_BITS_FOR_ACN_ENCODING 186
#define __po_hi_c_serial_conf_t_REQUIRED_BYTES_FOR_ENCODING 23
#define __po_hi_c_serial_conf_t_REQUIRED_BITS_FOR_ENCODING 180
#define __po_hi_c_serial_conf_t_REQUIRED_BYTES_FOR_ACN_ENCODING 25
#define __po_hi_c_serial_conf_t_REQUIRED_BITS_FOR_ACN_ENCODING 200
#ifndef ERR___po_hi_c_serial_conf_t_devname
#define ERR___po_hi_c_serial_conf_t_devname 1002 /* (SIZE (1..20)) */
......@@ -82,7 +82,7 @@ typedef struct {
#define ERR___po_hi_c_serial_conf_t_bits 1003 /* (7..8) */
#endif
#ifndef ERR___po_hi_c_serial_conf_t_sending_wait
#define ERR___po_hi_c_serial_conf_t_sending_wait 1004 /* (0..1000) */
#define ERR___po_hi_c_serial_conf_t_sending_wait 1004 /* (0..9000000) */
#endif
void __po_hi_c_serial_conf_t_Initialize(__po_hi_c_serial_conf_t* pVal);
......
......@@ -2,8 +2,8 @@
#define _INC_SPACEWIRE_H
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:48
Date was: 6/22/2011
Time was: 11:00:16
*/
#include "asn1crt.h"
......
......@@ -13,7 +13,7 @@
#ifdef __PO_HI_NEED_DRIVER_GENERIC_KEYBOARD
void __po_hi_driver_generic_keyboard_poller (int* key_pressed);
void __po_hi_driver_generic_keyboard_poller (const __po_hi_device_id dev_id, int* key_pressed);
void __po_hi_driver_generic_keyboard_init (__po_hi_device_id id);
......
......@@ -14,7 +14,7 @@
#ifdef __PO_HI_NEED_DRIVER_SERIAL_LEON
void __po_hi_c_driver_serial_leon_poller (void);
void __po_hi_c_driver_serial_leon_poller (const __po_hi_device_id dev_id);
void __po_hi_c_driver_serial_leon_init (__po_hi_device_id id);
......
......@@ -15,7 +15,7 @@
#ifdef __PO_HI_NEED_DRIVER_SERIAL_LINUX
void __po_hi_c_driver_serial_linux_poller (void);
void __po_hi_c_driver_serial_linux_poller (const __po_hi_device_id dev_id);
void __po_hi_c_driver_serial_linux_init (__po_hi_device_id id);
......
......@@ -13,7 +13,7 @@
#ifdef __PO_HI_NEED_DRIVER_SERIAL_RASTA
void __po_hi_c_driver_serial_rasta_poller (void);
void __po_hi_c_driver_serial_rasta_poller (const __po_hi_device_id dev_id);
void __po_hi_c_driver_serial_rasta_init (__po_hi_device_id id);
......
......@@ -3,7 +3,7 @@
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* Copyright (C) 2010, European Space Agency
* Copyright (C) 2010-2011, European Space Agency
*/
#include <deployment.h>
......@@ -27,7 +27,7 @@ typedef struct {
unsigned char data[__PO_HI_DRIVER_RASTA_SPACEWIRE_PKTSIZE];
}__po_hi_c_driver_spacewire_pkt_hdr_t;
void __po_hi_c_driver_spacewire_rasta_poller (void);
void __po_hi_c_driver_spacewire_rasta_poller (const __po_hi_device_id dev_id);
void __po_hi_c_driver_spacewire_rasta_init (__po_hi_device_id id);
......
......@@ -3,7 +3,7 @@
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* Copyright (C) 2010, European Space Agency
* Copyright (C) 2010-2011, European Space Agency
*/
#include <deployment.h>
......@@ -71,7 +71,7 @@ void* __po_hi_sockets_receiver_task (void);
* and dispatch it in po-hi-c queues
*/
void* __po_hi_sockets_poller (void);
void* __po_hi_sockets_poller (const __po_hi_device_id dev_id);
/*
* Generic poller for PO-HI-C protocol.
*/
......
......@@ -41,7 +41,7 @@ endif
GCC=$(CC)
CFLAGS=$(USER_CFLAGS) $(TARGET_CFLAGS)
CPPFLAGS=$(CFLAGS) $(USER_CPPFLAGS)
LDFLAGS=$(TARGET_LDFLAGS) $(USER_LDFLAGS)
LDFLAGS=$(USER_LDFLAGS) $(TARGET_LDFLAGS)
ifdef USE_GPROF
CFLAGS+=-D__PO_HI_USE_GPROF -pg
......
#if (defined (__PO_HI_NEED_DRIVER_1553_RASTA))\n
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:46
Date was: 6/22/2011
Time was: 11:00:14
*/
#include <string.h>
#include <math.h>
......
#if (defined (__PO_HI_NEED_DRIVER_SOCKETS) || defined (__PO_HI_NEED_DRIVER_RTEMS_NE2000_SOCKETS))\n
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:47
Date was: 6/22/2011
Time was: 11:00:15
*/
#include <string.h>
#include <math.h>
......
......@@ -15,7 +15,7 @@ Serial-Conf-T ::= SEQUENCE {
speed Baudrate-T OPTIONAL,
parity Parity-T OPTIONAL,
bits INTEGER (7 .. 8) OPTIONAL,
sending-wait INTEGER (0 .. 100000) OPTIONAL,
sending-wait INTEGER (0 .. 9000000) OPTIONAL,
use-paritybit BOOLEAN OPTIONAL
}
......
#if (defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_RECEIVER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_RASTA) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_RECEIVER))\n
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:47
Date was: 6/22/2011
Time was: 11:00:15
*/
#include <string.h>
#include <math.h>
......@@ -92,7 +92,7 @@ flag __po_hi_c_serial_conf_t_IsConstraintValid(const __po_hi_c_serial_conf_t* pV
}
}
if (pVal->exist.sending_wait) {
if ( !(((pVal->sending_wait>=0) && (pVal->sending_wait<=1000))) ) {
if ( !(((pVal->sending_wait>=0) && (pVal->sending_wait<=9000000))) ) {
*pErrCode = ERR___po_hi_c_serial_conf_t_sending_wait;
return FALSE;
}
......
#if (defined (__PO_HI_NEED_DRIVER_SPACEWIRE_RASTA))\n
/*
Code automatically generated by asn1scc tool
Date was: 6/21/2011
Time was: 18:14:48
Date was: 6/22/2011
Time was: 11:00:16
*/
#include <string.h>
#include <math.h>
......
......@@ -26,8 +26,9 @@
#include <po_hi_debug.h>
void __po_hi_driver_generic_keyboard_poller (int* key_pressed)
void __po_hi_driver_generic_keyboard_poller (const __po_hi_device_id dev_id, int* key_pressed)
{
(void) dev_id;
int key;
__DEBUGMSG ("POLL THE KEYBOARD\n");
key = getch ();
......
......@@ -41,12 +41,14 @@ int po_hi_c_driver_leon_serial_fd_write;
#if defined (__PO_HI_NEED_DRIVER_SERIAL_LEON) || \
defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_RECEIVER)
void __po_hi_c_driver_serial_leon_poller (void)
void __po_hi_c_driver_serial_leon_poller (const __po_hi_device_id dev_id)
{
int n;
int ts;
int tr;
(void) dev_id;
__po_hi_msg_t msg;
__po_hi_request_t request;
......
......@@ -44,8 +44,9 @@ uint32_t po_hi_c_driver_serial_sending_wait;
#if defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX) || \
defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_RECEIVER)
void __po_hi_c_driver_serial_linux_poller (void)
void __po_hi_c_driver_serial_linux_poller (const __po_hi_device_id dev_id)
{
(void) dev_id;
int n;
int ts;
......@@ -341,6 +342,7 @@ int __po_hi_c_driver_serial_linux_sender (__po_hi_task_id task_id, __po_hi_port
if (po_hi_c_driver_serial_sending_wait != 0)
{
printf("Wait %u between two sends\n", po_hi_c_driver_serial_sending_wait);
for (n = 0 ; n < __PO_HI_MESSAGES_MAX_SIZE ; n++)
{
write (po_hi_c_driver_serial_fd_write, &(msg.content[n]), 1);
......
......@@ -46,9 +46,9 @@ int po_hi_c_driver_rasta_serial_fd_write;
__po_hi_msg_t __po_hi_c_driver_rasta_serial_msg;
__po_hi_request_t __po_hi_c_driver_rasta_serial_request;
void __po_hi_c_driver_serial_rasta_poller (void)
void __po_hi_c_driver_serial_rasta_poller (const __po_hi_device_id dev_id)
{
(void) dev_id;
int n;
int ts;
uint8_t* ptr;
......
......@@ -71,7 +71,7 @@ void po_hi_c_driver_rasta_spacewire_init_pkt(__po_hi_c_driver_spacewire_pkt_hdr_
}
void __po_hi_c_driver_spacewire_rasta_poller (void)
void __po_hi_c_driver_spacewire_rasta_poller (const __po_hi_device_id dev_id)
{
int len;
int j;
......
......@@ -163,8 +163,9 @@ int __po_hi_driver_sockets_send (__po_hi_task_id task_id,
}
void* __po_hi_sockets_poller (void)
void* __po_hi_sockets_poller (const __po_hi_device_id dev_id)
{
(void) dev_id;
__DEBUGMSG ("Poller launched, device-id=%d\n", socket_device_id);
socklen_t socklen = sizeof (struct sockaddr);
/* See ACCEPT (2) for details on initial value of socklen */
......
Markdown is supported
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