88#include "tutti_gli_header.h"
92int8_t spegnimento[8] = {6,0,0,0,0,0,0,0};
93int8_t accensione[8] = {6,1,0,0,0,0,0,0};
116uint8_t tappo, per_non_ripetere=255;
127 uint32_t temperatura_in_microK;
137 NVIC_SetPriority (SysTick_IRQn, 29);
140tx_msg_info.id = ARM_CAN_EXTENDED_ID(0xff);
153while( (
evento_CAN != CAN_EVENT_SEND_COMPLETE) && (attesa < 250) ){
160 LPC_CAN1->GSR &= ~CAN_GSR_TXERR_Msk;
162 uint32_t LPC_dummy= LPC_CAN1->ICR;
186 per_non_ripetere=255;
190 LPC_CAN1->IER &= ~CAN_IER_RIE;
196 per_non_ripetere=255;
210 while( (
evento_CAN != CAN_EVENT_SEND_COMPLETE) && (attesa < 500) ){
219 LPC_CAN1->GSR &= ~CAN_GSR_TXERR_Msk;
222 LPC_CAN1->IER |= CAN_IER_RIE;
231 LPC_CAN1->IER &= ~CAN_IER_RIE;
240 per_non_ripetere=255;
245 while( (
evento_CAN != CAN_EVENT_SEND_COMPLETE) && (attesa < 500) ){
253 LPC_CAN1->GSR &= ~CAN_GSR_TXERR_Msk;
260 LPC_CAN1->IER |= CAN_IER_RIE;
277 per_non_ripetere = 255;
@ The_total_number_of_instrucions
This is the total numebr of instructions, not an instruction.
uint8_t tx_data[8]
Transmission data vector.
uint32_t volatile evento_CAN
This is the variable which resembles the flags from the communication.
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.
bool messaggio_CAN_arrivato
This variable is set to true as soon as a reception have been concluded.
volatile uint8_t rx_data[8]
Received data vector.
bool messaggio_CAN_spedito
This variable is set to true as soon as a transmission have been concluded.
#define indirizzo_generico_CAN
snippetlineno Can.h var_indirizzo_generico_CAN
void(* ptr_istruzioni[The_total_number_of_instrucions])(void)
This is the pointer array to the instructions set: the byte istruzione_codice of the CAN message is t...
#define istruzione_codice
void LED_remote_ON_OFF(void)
LEDs can be set ON/OFF from remote.
void LED_accendi_spegni(uint8_t LED, uint8_t accendi_1_spegni_0)
This function turns ON or OFF any of the selcted LED.
volatile uint8_t LED_rosso_attivo
volatile uint16_t LED_rosso_fondo_scala
volatile uint8_t LED_verde_attivo
volatile uint32_t POWER_DOWN_MAX_ATTESA
upper limit for POWER_DOWN_TEMPO_ATTESA
volatile uint32_t POWER_DOWN_ABILITA_CONTEGGIO
Power down couter and anable is set if this variable is true.
void PowerControl_PowerDown(void)
Power down managing function.
volatile uint32_t POWER_DOWN_TEMPO_ATTESA
Counter to wait for power down, multiple of 10 ms.
void Aspetta_tanti_ms(int millisecondi)
The timing function.
void instr_inizializza_tutto_da_zero_function(void)
Start-up function.
int wait_for_ADC_setting
settable from the can
bool flag_power_down
if flag_power_down is true the u-controller goes in power down after a while
int main(void)
The main...
volatile int8_t vettore_istruzioni[8]
This is a copy of the received 8 bytes from the CAN.
unsigned int FW_version
This is where the FW version is stored.