601#include "tutti_gli_header.h"
603volatile unsigned int flag_error_verified=0;
623volatile uint32_t Error_good_operation;
627 char flag_error_verified_vecchio;
628 unsigned char last_error_address_vecchio;
630#define usa_la_struttura
633 #ifdef usa_la_struttura
664void ERROR_codifica_errore(uint8_t scheda_su_scheda_giu,
unsigned char error_addres,
unsigned char code_to_shift, uint8_t reset_count_se_0 ){
666 uint8_t iii, buffer_instruction[8],actual_error_address=error_addres;
671 if( reset_count_se_0 ==0){
674 Error_good_operation=0;
675 flag_error_verified=0;
682 if( reset_count_se_0 > 0 ){
687 flag_error_verified++;
692 for( iii=0;iii<8;iii++){
693 buffer_instruction[iii]=
tx_data[iii];
695 tx_data[5]= actual_error_address;
701 for( iii=0;iii<8;iii++){
702 tx_data[iii]=buffer_instruction[iii];
724 #define check_for_presence_of_erros ( uint8_t) 1
725 #define send_back_the_register ( uint8_t) 2
726 #define reste_all_errors ( uint8_t) 3
727 #define quering_echo_on_or_off ( uint8_t) 4
729 switch (istruzione & 0x7F){
730 case check_for_presence_of_erros:
732 tx_data[1]= flag_error_verified;
734 case send_back_the_register:
741 case reste_all_errors:
742 flag_error_verified=0;
750 case quering_echo_on_or_off:
767 flag_error_verified_vecchio += flag_error_verified;
769 flag_error_verified = 0;
789 flag_error_verified = flag_error_verified_vecchio;
822 if(flag_error_verified){
@ instr_ERROR_echo_on_off
if enabled, echo of the error via CAN as soon as the error is verified
uint8_t tx_data[8]
Transmission data vector.
uint32_t tx_obj_idx
This is the variable which resembles the flags from the communication.
unsigned int indirizzo_CAN_della_scheda
Per ora lo assegnamo cos\i l'indirizzo della scheda.
volatile uint8_t rx_data[8]
Received data vector.
void store_errors(void)
Copy all errors in a buffer.
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.
void Error_imposta_la_istruzione(void)
Function to be located at the end of every instruction to mark the error, if any.
unsigned int Post_frontend_errors_copy[error_number_of_errors_registers+error_offset_for_board_up]
///
volatile unsigned char can_send_error
The shift bit of the last error.
volatile uint32_t Error_bad_operation
exploited to mark the errors
void instr_ERROR_inspection_function(void)
The state of the errors can be verified/reset.
volatile unsigned char last_code_to_shift
The address of the last verified error.
volatile unsigned char last_code_to_shift_at_startup
The address of the last verified error.
void ERROR_codifica_errore(uint8_t scheda_su_scheda_giu, unsigned char error_addres, unsigned char code_to_shift, uint8_t reset_count_se_0)
If an error is found its flag is codified here.
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.
void instr_ERROR_echo_on_off_function(void)
Immediate echos of a verified error activated/disattivated.
void restore_errors(void)
Re-store all errors from the buffer.
volatile unsigned char flag_error_acknowledged
Alla verifica di un qualsiasi errore allo startup questo flag viene posto ad 1, 0 altrimenti.
volatile unsigned char last_error_address_at_startup
The shift bit of the last error.
@ error_address_I2C0
Error register A for I2C0.
@ error_offset_for_board_up
=15, First addresss for board up errors
@ error_address_I2C1
Error register A for I2C1
@ error_address_SPI
Error register for SPI.
@ error_number_of_errors_registers
Number of errors (this is not an addres)
void Aspetta_tanti_ms(int millisecondi)
The timing function.
volatile int8_t vettore_istruzioni[8]
This is a copy of the received 8 bytes from the CAN.