Changeset 17639 for trunk/FACT++/src


Ignore:
Timestamp:
03/31/14 16:14:13 (11 years ago)
Author:
tbretz
Message:
Replaced define by enum.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/HeadersFSC.h

    r17624 r17639  
    11#ifndef FACT_HeadersFSC
    22#define FACT_HeadersFSC
    3 
    4 #define RESISTANCE_CHANNELS 64
    5 #define RESISTANCE_REGS 8
    6 #define VOLTAGE_CHANNELS 84
    7 #define VOLTAGE_REGS 11
    8 
    93
    104namespace FSC
     
    1812        };
    1913    }
    20    
    21    
    2214
    23     typedef struct {
    24         uint8_t ad7719_readings_since_last_muxing;
    25         uint8_t ad7719_current_channel;
     15    enum {
     16        kNumResistanceChannels = 64,
     17        kNumResistanceRegs     =  8,
     18        kNumVoltageChannels    = 84,
     19        kNumVoltageRegs        = 11
     20    };
     21
     22
     23    struct BinaryOutput_t
     24    {
     25        uint8_t  ad7719_readings_since_last_muxing;
     26        uint8_t  ad7719_current_channel;
    2627        uint32_t ad7719_current_reading;
    27         uint8_t ad7719_enables[RESISTANCE_REGS];
    28         uint8_t ad7719_channels_ready[RESISTANCE_REGS];
    29         uint32_t ad7719_values[RESISTANCE_CHANNELS];
     28        uint8_t  ad7719_enables[kNumResistanceRegs];
     29        uint8_t  ad7719_channels_ready[kNumResistanceRegs];
     30        uint32_t ad7719_values[kNumResistanceChannels];
    3031        uint16_t ad7719_values_checksum;
    3132
    32         uint8_t adc_readings_since_last_muxing;
    33         uint8_t adc_current_channel;
     33        uint8_t  adc_readings_since_last_muxing;
     34        uint8_t  adc_current_channel;
    3435        uint16_t adc_current_reading;
    35         uint8_t adc_enables[VOLTAGE_REGS];
    36         uint8_t adc_channels_ready[VOLTAGE_REGS];
    37         uint16_t adc_values[VOLTAGE_CHANNELS];
     36        uint8_t  adc_enables[kNumVoltageRegs];
     37        uint8_t  adc_channels_ready[kNumVoltageRegs];
     38        uint16_t adc_values[kNumVoltageChannels];
    3839        uint16_t adc_values_checksum;
    3940
    40         uint8_t ad7719_measured_all;    // treat it as a bool
    41         uint8_t adc_measured_all;       // treat it as a bool
     41        uint8_t  ad7719_measured_all;    // treat it as a bool
     42        uint8_t  adc_measured_all;       // treat it as a bool
    4243
    43         uint8_t app_reset_source;
     44        uint8_t  app_reset_source;
    4445        uint32_t time_sec;
    4546        uint16_t time_ms;
    46     } __attribute__((__packed__)) BinaryOutput_t;
     47    } __attribute__((__packed__));
    4748}
    4849
Note: See TracChangeset for help on using the changeset viewer.