22 #ifndef DBA_AOF_IMPORTERS_COMMON_H 23 #define DBA_AOF_IMPORTERS_COMMON_H 29 #include <dballe/msg/msg.h> 39 #define TRACE(...) fprintf(stderr, __VA_ARGS__) 40 #define IFTRACE if (1) 42 #define TRACE(...) do { } while (0) 43 #define IFTRACE if (0) 46 #define AOF_UNDEF 0x7fffffff 48 #define OBS(n) (obs[n-1]) 54 static inline int get_conf2(uint32_t conf)
58 case 0:
return 76;
break;
59 case 1:
return 51;
break;
60 case 2:
return 26;
break;
61 case 3:
return 0;
break;
67 static inline int get_conf6(uint32_t conf)
69 return get_conf2(conf >> 3);
73 static inline int count_bits(uint32_t v)
99 static inline uint32_t get_extra_conf(
const uint32_t* obs,
int idx)
101 int count = count_bits(OBS(32));
102 uint32_t w = OBS(33+count+idx/4);
103 return (w >> ((idx % 4) * 6)) & 0x3f;
108 static inline double totemp(
double k) {
return k / 10.0; }
112 void dba_aof_dump_word(
const char* prefix, uint32_t x);
115 uint32_t dba_aof_get_extra_conf(
const uint32_t* obs,
int idx);
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17