Ignore:
Timestamp:
05/12/11 17:47:17 (14 years ago)
Author:
neise
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/FSC/src/application.c

    r10667 r10677  
    139139U08     increase_adc (U08 channel){
    140140U08 effective_channel;
    141         for ( U08 increase = 1 ; increase <= V_CHANNELS + I_CHANNELS + H_CHANNELS; increase++)
    142         {
    143                 effective_channel = (channel + increase) % (V_CHANNELS + I_CHANNELS + H_CHANNELS);
     141        for ( U08 increase = 1 ; increase <= VOLTAGE_CHANNELS; increase++)
     142        {
     143                effective_channel = (channel + increase) % (VOLTAGE_CHANNELS);
    144144                if (adc_enables[effective_channel/8] & (1<<effective_channel%8))
    145145                        return effective_channel;
     
    150150U08     increase_ad7719 (U08 channel){
    151151U08 effective_channel;
    152         for ( U08 increase = 1 ; increase <= TEMP_CHANNELS; increase++)
    153         {
    154                 effective_channel = (channel + increase) % (TEMP_CHANNELS);
     152        for ( U08 increase = 1 ; increase <= RESISTANCE_CHANNELS; increase++)
     153        {
     154                effective_channel = (channel + increase) % (RESISTANCE_CHANNELS);
    155155                if (ad7719_enables[effective_channel/8] & (1<<effective_channel%8))
    156156                        return effective_channel;
     
    161161void check_if_measured_all() {
    162162        adc_measured_all = true;
    163         for ( U08 i=0; i<V_BITMAP + I_BITMAP + H_BITMAP; ++i ) {
     163        for ( U08 i=0; i<(VOLTAGE_CHANNELS/8); ++i ) {
    164164                if ((adc_enables[i] ^ adc_channels_ready[i]) != 0x00) {
    165165                        adc_measured_all = false;
     
    168168        }
    169169        ad7719_measured_all = true;
    170         for ( U08 i=0; i<CHANNEL_BITMAP; ++i ) {
     170        for ( U08 i=0; i<(RESISTANCE_CHANNELS/8); ++i ) {
    171171                if ((ad7719_enables[i] ^ ad7719_channels_ready[i]) != 0x00) {
    172172                        ad7719_measured_all = false;
     
    177177
    178178}
     179
     180
     181bool check_if_adc_measurement_done(){
     182        adc_measured_all = true;
     183        for ( U08 i=0; i<VOLTAGE_CHANNELS/8; ++i ) {
     184                if ((adc_enables[i] ^ adc_channels_ready[i]) != 0x00) {
     185                        adc_measured_all = false;
     186                        break;
     187                }
     188        }
     189        return adc_measured_all;
     190}
     191
     192bool check_if_ad7719_measurement_done(){
     193        ad7719_measured_all = true;
     194        for ( U08 i=0; i<RESISTANCE_CHANNELS/8; ++i ) {
     195                if ((ad7719_enables[i] ^ ad7719_channels_ready[i]) != 0x00) {
     196                        ad7719_measured_all = false;
     197                        break;
     198                }
     199        }
     200        return ad7719_measured_all;
     201}
Note: See TracChangeset for help on using the changeset viewer.