##// END OF EJS Templates
3.0.0.17
3.0.0.17

File last commit:

r265:09ea64972ca9 R3a
r268:95dc36087a62 R3a
Show More
fsw_spacewire.c
1580 lines | 59.0 KiB | text/x-c | CLexer
paul
Minor changes in .h inclusion
r45 /** Functions related to the SpaceWire interface.
*
* @file
* @author P. LEROY
*
* A group of functions to handle SpaceWire transmissions:
* - configuration of the SpaceWire link
* - SpaceWire related interruption requests processing
* - transmission of TeleMetry packets by a dedicated RTEMS task
* - reception of TeleCommands by a dedicated RTEMS task
*
*/
paul
Last commit before release 0-13...
r35 #include "fsw_spacewire.h"
paul
sequence counters management added
r56 rtems_name semq_name;
rtems_id semq_id;
paul
New version of the waveform picker packet transmission...
r172 //*****************
// waveform headers
Header_TM_LFR_SCIENCE_CWF_t headerCWF;
Header_TM_LFR_SCIENCE_SWF_t headerSWF;
Header_TM_LFR_SCIENCE_ASM_t headerASM;
paul
timecode handling modified:...
r248 unsigned char previousTimecodeCtr = 0;
unsigned int *grspwPtr = (unsigned int *) (REGS_ADDR_GRSPW + APB_OFFSET_GRSPW_TIME_REGISTER);
paul
Minor changes in .h inclusion
r45 //***********
paul
Last commit before release 0-13...
r35 // RTEMS TASK
rtems_task spiq_task(rtems_task_argument unused)
{
paul
Ignore doc files...
r46 /** This RTEMS task is awaken by an rtems_event sent by the interruption subroutine of the SpaceWire driver.
paul
Minor changes in .h inclusion
r45 *
* @param unused is the starting argument of the RTEMS task
*
*/
paul
Last commit before release 0-13...
r35 rtems_event_set event_out;
rtems_status_code status;
paul
Ignore doc files...
r46 int linkStatus;
BOOT_PRINTF("in SPIQ *** \n")
paul
Last commit before release 0-13...
r35
while(true){
rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT
paul
fsw-0-17...
r48 PRINTF("in SPIQ *** got SPW_LINKERR_EVENT\n")
paul
Last commit before release 0-13...
r35
paul
fsw-0-20...
r51 // [0] SUSPEND RECV AND SEND TASKS
paul
Minor modifications to meet Logiscope requirements
r77 status = rtems_task_suspend( Task_id[ TASKID_RECV ] );
if ( status != RTEMS_SUCCESSFUL ) {
PRINTF("in SPIQ *** ERR suspending RECV Task\n")
}
status = rtems_task_suspend( Task_id[ TASKID_SEND ] );
if ( status != RTEMS_SUCCESSFUL ) {
PRINTF("in SPIQ *** ERR suspending SEND Task\n")
}
paul
fsw-0-16...
r47
// [1] CHECK THE LINK
paul
Minor modifications to meet Logiscope requirements
r77 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status (1)
paul
Ignore doc files...
r46 if ( linkStatus != 5) {
PRINTF1("in SPIQ *** linkStatus %d, wait...\n", linkStatus)
paul
Minor modifications to meet Logiscope requirements
r77 status = rtems_task_wake_after( SY_LFR_DPU_CONNECT_TIMEOUT ); // wait SY_LFR_DPU_CONNECT_TIMEOUT 1000 ms
paul
Ignore doc files...
r46 }
paul
Last commit before release 0-13...
r35
paul
fsw-0-16...
r47 // [2] RECHECK THE LINK AFTER SY_LFR_DPU_CONNECT_TIMEOUT
paul
Snapshot resynchro rewritten, drift is measured one snapshot in two...
r253 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status (2)
paul
fsw-0-16...
r47 if ( linkStatus != 5 ) // [2.a] not in run state, reset the link
paul
Ignore doc files...
r46 {
paul
spacewire statistics management modified...
r264 spacewire_read_statistics();
paul
Snapshot resynchro rewritten, drift is measured one snapshot in two...
r253 status = spacewire_several_connect_attemps( );
paul
Ignore doc files...
r46 }
paul
fsw-0-16...
r47 else // [2.b] in run state, start the link
{
paul
Sync
r127 status = spacewire_stop_and_start_link( fdSPW ); // start the link
paul
Ignore doc files...
r46 if ( status != RTEMS_SUCCESSFUL)
{
paul
fifo occupation reported in the HK packet
r197 PRINTF1("in SPIQ *** ERR spacewire_stop_and_start_link %d\n", status)
paul
Ignore doc files...
r46 }
}
paul
Last commit before release 0-13...
r35
paul
fsw-0-16...
r47 // [3] COMPLETE RECOVERY ACTION AFTER SY_LFR_DPU_CONNECT_ATTEMPTS
if ( status == RTEMS_SUCCESSFUL ) // [3.a] the link is in run state and has been started successfully
paul
Ignore doc files...
r46 {
paul
fsw-0-17...
r48 status = rtems_task_restart( Task_id[ TASKID_SEND ], 1 );
paul
Ignore doc files...
r46 if ( status != RTEMS_SUCCESSFUL ) {
PRINTF("in SPIQ *** ERR resuming SEND Task\n")
}
paul
fsw-0-17...
r48 status = rtems_task_restart( Task_id[ TASKID_RECV ], 1 );
paul
Ignore doc files...
r46 if ( status != RTEMS_SUCCESSFUL ) {
PRINTF("in SPIQ *** ERR resuming RECV Task\n")
paul
Last commit before release 0-13...
r35 }
paul
Ignore doc files...
r46 }
paul
fsw-0-16...
r47 else // [3.b] the link is not in run state, go in STANDBY mode
paul
Ignore doc files...
r46 {
paul
enter_mode removed...
r237 status = enter_mode_standby();
paul
Snapshot resynchro rewritten, drift is measured one snapshot in two...
r253 if ( status != RTEMS_SUCCESSFUL )
{
paul
fsw-0-20...
r51 PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status)
paul
Last commit before release 0-13...
r35 }
paul
a wrong date implies the generation of a TM_LFR_TC_EXE_NOT_EXECUTABLE...
r254 {
updateLFRCurrentMode( LFR_MODE_STANDBY );
}
// wake the LINK task up to wait for the link recovery
status = rtems_event_send ( Task_id[TASKID_LINK], RTEMS_EVENT_0 );
paul
Minor modifications to meet Logiscope requirements
r77 status = rtems_task_suspend( RTEMS_SELF );
paul
Last commit before release 0-13...
r35 }
}
}
paul
Minor changes in .h inclusion
r45 rtems_task recv_task( rtems_task_argument unused )
{
/** This RTEMS task is dedicated to the reception of incoming TeleCommands.
*
* @param unused is the starting argument of the RTEMS task
*
* The RECV task blocks on a call to the read system call, waiting for incoming SpaceWire data. When unblocked:
* 1. It reads the incoming data.
* 2. Launches the acceptance procedure.
* 3. If the Telecommand is valid, sends it to a dedicated RTEMS message queue.
*
*/
int len;
ccsdsTelecommandPacket_t currentTC;
unsigned char computed_CRC[ 2 ];
unsigned char currentTC_LEN_RCV[ 2 ];
paul
Bug #596...
r68 unsigned char destinationID;
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 unsigned int estimatedPacketLength;
paul
Minor changes in .h inclusion
r45 unsigned int parserCode;
rtems_status_code status;
rtems_id queue_recv_id;
rtems_id queue_send_id;
initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes
paul
fsw-1-0...
r82 status = get_message_queue_id_recv( &queue_recv_id );
paul
Minor changes in .h inclusion
r45 if (status != RTEMS_SUCCESSFUL)
{
paul
fsw-1-0...
r82 PRINTF1("in RECV *** ERR get_message_queue_id_recv %d\n", status)
paul
Minor changes in .h inclusion
r45 }
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_send_id );
paul
Minor changes in .h inclusion
r45 if (status != RTEMS_SUCCESSFUL)
{
paul
fsw-1-0...
r82 PRINTF1("in RECV *** ERR get_message_queue_id_send %d\n", status)
paul
Minor changes in .h inclusion
r45 }
BOOT_PRINTF("in RECV *** \n")
while(1)
{
paul
Ignore doc files...
r46 len = read( fdSPW, (char*) &currentTC, CCSDS_TC_PKT_MAX_SIZE ); // the call to read is blocking
paul
Minor changes in .h inclusion
r45 if (len == -1){ // error during the read call
paul
Ignore doc files...
r46 PRINTF1("in RECV *** last read call returned -1, ERRNO %d\n", errno)
paul
Minor changes in .h inclusion
r45 }
else {
if ( (len+1) < CCSDS_TC_PKT_MIN_SIZE ) {
paul
Ignore doc files...
r46 PRINTF("in RECV *** packet lenght too short\n")
paul
Minor changes in .h inclusion
r45 }
else {
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> 8);
currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength );
paul
Minor changes in .h inclusion
r45 // CHECK THE TC
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 parserCode = tc_parser( &currentTC, estimatedPacketLength, computed_CRC ) ;
paul
fsw-0-20...
r51 if ( (parserCode == ILLEGAL_APID) || (parserCode == WRONG_LEN_PKT)
|| (parserCode == INCOR_CHECKSUM) || (parserCode == ILL_TYPE)
|| (parserCode == ILL_SUBTYPE) || (parserCode == WRONG_APP_DATA)
|| (parserCode == WRONG_SRC_ID) )
paul
Minor changes in .h inclusion
r45 { // send TM_LFR_TC_EXE_CORRUPTED
paul
Corrections:...
r107 PRINTF1("TC corrupted received, with code: %d\n", parserCode)
paul
fsw-0-20...
r51 if ( !( (currentTC.serviceType==TC_TYPE_TIME) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_TIME) )
&&
!( (currentTC.serviceType==TC_TYPE_GEN) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_INFO))
)
{
paul
Bug #596...
r68 if ( parserCode == WRONG_SRC_ID )
{
destinationID = SID_TC_GROUND;
}
else
{
destinationID = currentTC.sourceID;
}
paul
fsw-0-23...
r75 send_tm_lfr_tc_exe_corrupted( &currentTC, queue_send_id,
computed_CRC, currentTC_LEN_RCV,
paul
rev 1.0.0.2...
r104 destinationID );
paul
fsw-0-20...
r51 }
paul
Minor changes in .h inclusion
r45 }
else
{ // send valid TC to the action launcher
status = rtems_message_queue_send( queue_recv_id, &currentTC,
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 estimatedPacketLength + CCSDS_TC_TM_PACKET_OFFSET + 3);
paul
Minor changes in .h inclusion
r45 }
}
}
paul
fifo occupation reported in the HK packet
r197
update_queue_max_count( queue_recv_id, &hk_lfr_q_rv_fifo_size_max );
paul
Minor changes in .h inclusion
r45 }
}
rtems_task send_task( rtems_task_argument argument)
{
/** This RTEMS task is dedicated to the transmission of TeleMetry packets.
*
* @param unused is the starting argument of the RTEMS task
*
* The SEND task waits for a message to become available in the dedicated RTEMS queue. When a message arrives:
* - if the first byte is equal to CCSDS_DESTINATION_ID, the message is sent as is using the write system call.
* - if the first byte is not equal to CCSDS_DESTINATION_ID, the message is handled as a spw_ioctl_pkt_send. After
* analyzis, the packet is sent either using the write system call or using the ioctl call SPACEWIRE_IOCTRL_SEND, depending on the
* data it contains.
*
*/
paul
There is a message queue between AVFO and MATR...
r118 rtems_status_code status; // RTEMS status code
char incomingData[MSG_QUEUE_SIZE_SEND]; // incoming data buffer
paul
New version of the waveform picker packet transmission...
r172 ring_node *incomingRingNodePtr;
int ring_node_address;
char *charPtr;
paul
Minor changes in .h inclusion
r45 spw_ioctl_pkt_send *spw_ioctl_send;
size_t size; // size of the incoming TC packet
paul
fifo occupation reported in the HK packet
r197 rtems_id queue_send_id;
paul
TC_LFR_LOAD_KCOEFFICIENTS...
r194 unsigned int sid;
paul
bug #484 corrected
r228 unsigned char sidAsUnsignedChar;
paul
#456 #532 #532 #533 corrected, TC_LFR_UPDATE_INFO fields copied in...
r230 unsigned char type;
paul
New version of the waveform picker packet transmission...
r172
incomingRingNodePtr = NULL;
ring_node_address = 0;
charPtr = (char *) &ring_node_address;
sid = 0;
paul
bug #484 corrected
r228 sidAsUnsignedChar = 0;
paul
New version of the waveform picker packet transmission...
r172
init_header_cwf( &headerCWF );
init_header_swf( &headerSWF );
init_header_asm( &headerASM );
paul
Minor changes in .h inclusion
r45
paul
fifo occupation reported in the HK packet
r197 status = get_message_queue_id_send( &queue_send_id );
paul
Minor changes in .h inclusion
r45 if (status != RTEMS_SUCCESSFUL)
{
paul
fsw-1-0...
r82 PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status)
paul
Minor changes in .h inclusion
r45 }
BOOT_PRINTF("in SEND *** \n")
while(1)
{
paul
fifo occupation reported in the HK packet
r197 status = rtems_message_queue_receive( queue_send_id, incomingData, &size,
paul
Minor changes in .h inclusion
r45 RTEMS_WAIT, RTEMS_NO_TIMEOUT );
if (status!=RTEMS_SUCCESSFUL)
{
PRINTF1("in SEND *** (1) ERR = %d\n", status)
}
else
{
paul
New version of the waveform picker packet transmission...
r172 if ( size == sizeof(ring_node*) )
{
charPtr[0] = incomingData[0];
charPtr[1] = incomingData[1];
charPtr[2] = incomingData[2];
charPtr[3] = incomingData[3];
incomingRingNodePtr = (ring_node*) ring_node_address;
sid = incomingRingNodePtr->sid;
if ( (sid==SID_NORM_CWF_LONG_F3)
|| (sid==SID_BURST_CWF_F2 )
|| (sid==SID_SBM1_CWF_F1 )
|| (sid==SID_SBM2_CWF_F2 ))
{
spw_send_waveform_CWF( incomingRingNodePtr, &headerCWF );
}
else if ( (sid==SID_NORM_SWF_F0) || (sid== SID_NORM_SWF_F1) || (sid==SID_NORM_SWF_F2) )
{
spw_send_waveform_SWF( incomingRingNodePtr, &headerSWF );
}
else if ( (sid==SID_NORM_CWF_F3) )
{
spw_send_waveform_CWF3_light( incomingRingNodePtr, &headerCWF );
}
paul
TM_LFR_SCIENCE_NORMA_ASM_ packets modified, 32 bits values instead of 16 bits...
r196 else if (sid==SID_NORM_ASM_F0)
{
spw_send_asm_f0( incomingRingNodePtr, &headerASM );
}
else if (sid==SID_NORM_ASM_F1)
paul
New version of the waveform picker packet transmission...
r172 {
paul
TM_LFR_SCIENCE_NORMA_ASM_ packets modified, 32 bits values instead of 16 bits...
r196 spw_send_asm_f1( incomingRingNodePtr, &headerASM );
}
else if (sid==SID_NORM_ASM_F2)
{
spw_send_asm_f2( incomingRingNodePtr, &headerASM );
paul
New version of the waveform picker packet transmission...
r172 }
paul
TC_LFR_LOAD_KCOEFFICIENTS...
r194 else if ( sid==TM_CODE_K_DUMP )
{
spw_send_k_dump( incomingRingNodePtr );
}
paul
New version of the waveform picker packet transmission...
r172 else
{
paul
printf removed or replaced by PRINTF macros...
r227 PRINTF1("unexpected sid = %d\n", sid);
paul
New version of the waveform picker packet transmission...
r172 }
}
else if ( incomingData[0] == CCSDS_DESTINATION_ID ) // the incoming message is a ccsds packet
paul
Minor changes in .h inclusion
r45 {
paul
bug #484 corrected
r228 sidAsUnsignedChar = (unsigned char) incomingData[ PACKET_POS_PA_LFR_SID_PKT ];
sid = sidAsUnsignedChar;
paul
#456 #532 #532 #533 corrected, TC_LFR_UPDATE_INFO fields copied in...
r230 type = (unsigned char) incomingData[ PACKET_POS_SERVICE_TYPE ];
if (type == TM_TYPE_LFR_SCIENCE) // this is a BP packet, all other types are handled differently
paul
bug #484 corrected
r228 // SET THE SEQUENCE_CNT PARAMETER IN CASE OF BP0 OR BP1 PACKETS
{
increment_seq_counter_source_id( (unsigned char*) &incomingData[ PACKET_POS_SEQUENCE_CNT ], sid );
}
paul
Minor changes in .h inclusion
r45 status = write( fdSPW, incomingData, size );
if (status == -1){
paul
fsw-0-17...
r48 PRINTF2("in SEND *** (2.a) ERRNO = %d, size = %d\n", errno, size)
paul
Minor changes in .h inclusion
r45 }
}
else // the incoming message is a spw_ioctl_pkt_send structure
{
spw_ioctl_send = (spw_ioctl_pkt_send*) incomingData;
paul
fsw-0-20
r58 status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send );
if (status == -1){
PRINTF2("in SEND *** (2.b) ERRNO = %d, RTEMS = %d\n", errno, status)
paul
Minor changes in .h inclusion
r45 }
}
}
paul
fifo occupation reported in the HK packet
r197 update_queue_max_count( queue_send_id, &hk_lfr_q_sd_fifo_size_max );
paul
Minor changes in .h inclusion
r45 }
}
paul
a wrong date implies the generation of a TM_LFR_TC_EXE_NOT_EXECUTABLE...
r254 rtems_task link_task( rtems_task_argument argument )
paul
Ignore doc files...
r46 {
rtems_event_set event_out;
rtems_status_code status;
int linkStatus;
paul
a wrong date implies the generation of a TM_LFR_TC_EXE_NOT_EXECUTABLE...
r254 BOOT_PRINTF("in LINK ***\n")
paul
Ignore doc files...
r46
paul
fsw-0-16...
r47 while(1)
{
paul
Ignore doc files...
r46 // wait for an RTEMS_EVENT
rtems_event_receive( RTEMS_EVENT_0,
RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
a wrong date implies the generation of a TM_LFR_TC_EXE_NOT_EXECUTABLE...
r254 PRINTF("in LINK *** wait for the link\n")
paul
sync
r184 status = ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status
while( linkStatus != 5) // wait for the link
paul
Ignore doc files...
r46 {
paul
sync
r184 status = rtems_task_wake_after( 10 ); // monitor the link each 100ms
status = ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status
paul
sy_lfr_watchdog_enabled handled...
r262 watchdog_reload();
paul
Ignore doc files...
r46 }
paul
spacewire statistics management modified...
r264 spacewire_read_statistics();
paul
Sync
r127 status = spacewire_stop_and_start_link( fdSPW );
paul
fsw-0-16...
r47
if (status != RTEMS_SUCCESSFUL)
paul
Ignore doc files...
r46 {
paul
a wrong date implies the generation of a TM_LFR_TC_EXE_NOT_EXECUTABLE...
r254 PRINTF1("in LINK *** ERR link not started %d\n", status)
paul
Ignore doc files...
r46 }
else
{
paul
a wrong date implies the generation of a TM_LFR_TC_EXE_NOT_EXECUTABLE...
r254 PRINTF("in LINK *** OK link started\n")
paul
Ignore doc files...
r46 }
paul
fsw-0-16...
r47 // restart the SPIQ task
paul
fsw-0-17...
r48 status = rtems_task_restart( Task_id[TASKID_SPIQ], 1 );
if ( status != RTEMS_SUCCESSFUL ) {
PRINTF("in SPIQ *** ERR restarting SPIQ Task\n")
}
paul
Ignore doc files...
r46
paul
fsw-0-17...
r48 // restart RECV and SEND
paul
fsw-0-16...
r47 status = rtems_task_restart( Task_id[ TASKID_SEND ], 1 );
if ( status != RTEMS_SUCCESSFUL ) {
paul
fsw-0-17...
r48 PRINTF("in SPIQ *** ERR restarting SEND Task\n")
paul
fsw-0-16...
r47 }
status = rtems_task_restart( Task_id[ TASKID_RECV ], 1 );
if ( status != RTEMS_SUCCESSFUL ) {
paul
fsw-0-17...
r48 PRINTF("in SPIQ *** ERR restarting RECV Task\n")
paul
fsw-0-16...
r47 }
paul
Ignore doc files...
r46 }
}
paul
Minor changes in .h inclusion
r45 //****************
// OTHER FUNCTIONS
paul
Sync
r127 int spacewire_open_link( void ) // by default, the driver resets the core: [SPW_CTRL_WRITE(pDev, SPW_CTRL_RESET);]
paul
Ignore doc files...
r46 {
/** This function opens the SpaceWire link.
*
* @return a valid file descriptor in case of success, -1 in case of a failure
*
*/
rtems_status_code status;
fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call resets the hardware
if ( fdSPW < 0 ) {
PRINTF1("ERR *** in configure_spw_link *** error opening "GRSPW_DEVICE_NAME" with ERR %d\n", errno)
}
else
{
status = RTEMS_SUCCESSFUL;
}
return status;
}
int spacewire_start_link( int fd )
{
rtems_status_code status;
paul
Sync
r127 status = ioctl( fd, SPACEWIRE_IOCTRL_START, -1); // returns successfuly if the link is started
paul
fsw-0-16...
r47 // -1 default hardcoded driver timeout
return status;
}
paul
Sync
r127 int spacewire_stop_and_start_link( int fd )
paul
fsw-0-16...
r47 {
rtems_status_code status;
paul
Sync
r127 status = ioctl( fd, SPACEWIRE_IOCTRL_STOP); // start fails if link pDev->running != 0
status = ioctl( fd, SPACEWIRE_IOCTRL_START, -1); // returns successfuly if the link is started
paul
Ignore doc files...
r46 // -1 default hardcoded driver timeout
return status;
}
int spacewire_configure_link( int fd )
paul
Last commit before release 0-13...
r35 {
paul
Minor changes in .h inclusion
r45 /** This function configures the SpaceWire link.
*
* @return GR-RTEMS-DRIVER directive status codes:
* - 22 EINVAL - Null pointer or an out of range value was given as the argument.
* - 16 EBUSY - Only used for SEND. Returned when no descriptors are avialble in non-blocking mode.
* - 88 ENOSYS - Returned for SET_DESTKEY if RMAP command handler is not available or if a non-implemented call is used.
* - 116 ETIMEDOUT - REturned for SET_PACKET_SIZE and START if the link could not be brought up.
* - 12 ENOMEM - Returned for SET_PACKETSIZE if it was unable to allocate the new buffers.
* - 5 EIO - Error when writing to grswp hardware registers.
* - 2 ENOENT - No such file or directory
*/
paul
Last commit before release 0-13...
r35 rtems_status_code status;
spacewire_set_NP(1, REGS_ADDR_GRSPW); // [N]o [P]ort force
spacewire_set_RE(1, REGS_ADDR_GRSPW); // [R]MAP [E]nable, the dedicated call seems to break the no port force configuration
paul
Ignore doc files...
r46 status = ioctl(fd, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception
paul
Many corrections done after Logiscope analysis
r166 if (status!=RTEMS_SUCCESSFUL) {
PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_RXBLOCK\n")
}
paul
Last commit before release 0-13...
r35 //
paul
Ignore doc files...
r46 status = ioctl(fd, SPACEWIRE_IOCTRL_SET_EVENT_ID, Task_id[TASKID_SPIQ]); // sets the task ID to which an event is sent when a
paul
Many corrections done after Logiscope analysis
r166 if (status!=RTEMS_SUCCESSFUL) {
paul
sync
r181 PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_EVENT_ID\n") // link-error interrupt occurs
paul
Many corrections done after Logiscope analysis
r166 }
paul
Last commit before release 0-13...
r35 //
paul
Ignore doc files...
r46 status = ioctl(fd, SPACEWIRE_IOCTRL_SET_DISABLE_ERR, 0); // automatic link-disabling due to link-error interrupts
paul
Many corrections done after Logiscope analysis
r166 if (status!=RTEMS_SUCCESSFUL) {
PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_DISABLE_ERR\n")
}
paul
Last commit before release 0-13...
r35 //
paul
Ignore doc files...
r46 status = ioctl(fd, SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ, 1); // sets the link-error interrupt bit