CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches

◆ instr_ERROR_inspection_function()

void instr_ERROR_inspection_function ( void  )

The state of the errors can be verified/reset.

Parameters
[in]what_to_answer
1: the answer is error present/not present,
2: the error regsister indicated in data[0] of CANbus message is sent,
3: reset all errors,
4: the state of echo of errors, ON/OFF.
Returns
is according to the requested action: last_error_address, error_register, can_send_error, the echo state ON/OFF
char ii;
volatile uint8_t istruzione = vettore_istruzioni[6];
#define check_for_presence_of_erros ( uint8_t) 1
#define send_back_the_register ( uint8_t) 2
#define reste_all_errors ( uint8_t) 3
#define quering_echo_on_or_off ( uint8_t) 4
switch (istruzione & 0x7F){
case check_for_presence_of_erros:
tx_data[1]= flag_error_verified;
break;
case send_back_the_register:
tx_data[5]= rx_data[0];
tx_data[0]= (Post_frontend_errors[tx_data[5]]>>0) & 0xff;
tx_data[1]= (Post_frontend_errors[tx_data[5]]>>8) & 0xff;
tx_data[2]= (Post_frontend_errors[tx_data[5]]>>16) & 0xff;
tx_data[3]= (Post_frontend_errors[tx_data[5]]>>24) & 0xff;
break;
case reste_all_errors:
flag_error_verified=0;
{
}
break;
case quering_echo_on_or_off:
break;
}
}
uint8_t tx_data[8]
Transmission data vector.
Definition: Can.c:321
volatile uint8_t rx_data[8]
Received data vector.
Definition: Can.c:318
unsigned int Post_frontend_errors[error_number_of_errors_registers+error_offset_for_board_up]
Error are notified via can if =1; not notified if =0.
volatile unsigned char can_send_error
The shift bit of the last error.
void instr_ERROR_inspection_function(void)
The state of the errors can be verified/reset.
volatile unsigned int flag_error_verified_at_startup
Alla verifica di un qualsiasi errore questo flag viene incrementato, 0 implica nessun errore.
volatile unsigned char last_error_address
Il flag di errore veirifcato e tutti gli errori vengono resettati perch\'e acquisiti.
@ error_offset_for_board_up
=15, First addresss for board up errors
@ error_number_of_errors_registers
Number of errors (this is not an addres)
volatile int8_t vettore_istruzioni[8]
This is a copy of the received 8 bytes from the CAN.

Definition at line 721 of file Error_handling.c.