AnsweredAssumed Answered

evaluate macro in a .h file

Question asked by stefano manca on Feb 6, 2014
Latest reply on Feb 7, 2014 by Pascal Irrle

Hi, Anybody knows how evaluate (calculate) a macro in a .h file by codewarrior?

 

define BUSCLOCK 20971520

#define TPM_PRESCALER 32//assicurarsi che il registro TPM_SC sia configurato con prescaler a 32

#define TPM_CLOCK (BUSCLOCK/TPM_PRESCALER)

#define TPM_OVERFLOW_MS 64//massima durata impulso e quindi overflow del timer in millisecondi

#define NUM_SLICE 30

#define TPM_OVERFLOW ((TPM_OVERFLOW_MS*TPM_CLOCK)/1000)

#define TPM_OVERFLOW_SLICE (TPM_OVERFLOW/NUM_SLICE)

#define GUARD_TIME_COUNTER_MS 2//periodo di guardia dopo l'arrivo del primo impulso valido in millisecondi

#define GUARD_TIME_COUNTER ((GUARD_TIME_COUNTER_MS*TPM_CLOCK)/1000)

#define PULSE_PERIOD_OK_US 256 //durata impulso valido in microsecondi

#define PULSE_PERIOD_OK ((PULSE_PERIOD_OK_US*TPM_CLOCK)/1000000)

 

Thank you.

Outcomes