Changeset 122 for flukso

Show
Ignore:
Timestamp:
04/09/10 16:20:22 (2 years ago)
Author:
icarus75
Message:

uc: add support for US split-phase supplies

Location:
flukso/trunk/uc
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • flukso/trunk/uc/Makefile

    r121 r122  
    4545# Predefine the TYPE and SENSORx C macros in main.h via this Makefile. 
    4646# Override the defaults on the command line by typing: 
    47 # make TYPE=xxxx SENSOR0=yyyy ... 
     47# make PHASE=x METERCONST=y SENSOR0=z ... 
    4848# 
    4949DBG = 0 
    5050# 
    5151TYPE = 2300501 
     52PHASE = 1 
    5253METERCONST= 5508 
    5354# 
     
    5758SENSOR3 = 0123456789abcdef0123456789abcde3 
    5859# 
    59 CEXTRA = -D DBG=$(DBG) -D METERCONST=$(METERCONST) -D 'SENSOR0="$(SENSOR0)"' -D 'SENSOR1="$(SENSOR1)"' -D 'SENSOR2="$(SENSOR2)"' -D 'SENSOR3="$(SENSOR3)"' 
     60CEXTRA = -D DBG=$(DBG) -D PHASE=$(PHASE) -D METERCONST=$(METERCONST) -D 'SENSOR0="$(SENSOR0)"' -D 'SENSOR1="$(SENSOR1)"' -D 'SENSOR2="$(SENSOR2)"' -D 'SENSOR3="$(SENSOR3)"' 
    6061############################################################################### 
    6162 
  • flukso/trunk/uc/main.c

    r119 r122  
    8080  // read ADC result 
    8181  // add to nano(Wh) counter 
     82#if PHASE == 2 
     83  MacU16X16to32(aux[0].nano, METERCONST, ADC); 
     84#else 
    8285  MacU16X16to32(aux[muxn].nano, METERCONST, ADC); 
    83  
     86#endif 
    8487  if (aux[muxn].nano > WATT) { 
    8588     measurements[muxn].value++; 
  • flukso/trunk/uc/main.h

    r121 r122  
    4141#ifndef SENSOR3 
    4242  #error "SENSOR3 not defined" 
     43#endif 
     44 
     45#ifndef PHASE 
     46  #error "PHASE not defined" 
    4347#endif 
    4448