Rev 2175 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2175 | Rev 2176 | ||
|---|---|---|---|
| Line 93... | Line 93... | ||
| 93 | lastMeasurment = Timer_GetTicks() - PreviusTimerValue; |
93 | lastMeasurment = Timer_GetTicks() - PreviusTimerValue; |
| 94 | MeasurmentBuffer[MeasurmentBufferPointer] = (uint16_t) (lastMeasurment & 0x0000FFFF); |
94 | MeasurmentBuffer[MeasurmentBufferPointer] = (uint16_t) (lastMeasurment & 0x0000FFFF); |
| 95 | PreviusTimerValue = Timer_GetTicks(); |
95 | PreviusTimerValue = Timer_GetTicks(); |
| 96 | #if sns_power_100_PULSES_PER_KWH == 1 |
96 | #if sns_power_100_PULSES_PER_KWH == 1 |
| 97 | EnergyCounter+=10; |
97 | EnergyCounter+=10; |
| 98 |
|
98 | if (EnergyCounter % 1024 == 0) |
| 99 | if (EnergyCounter & (1024-1) == 0) |
- | |
| 100 | StoreInEEPROM = 1; |
99 | StoreInEEPROM = 1; |
| 101 | #endif |
100 | #endif |
| 102 | #if sns_power_1000_PULSES_PER_KWH == 1 |
101 | #if sns_power_1000_PULSES_PER_KWH == 1 |
| 103 | EnergyCounter++; |
102 | EnergyCounter++; |
| 104 |
|
103 | if (EnergyCounter % 1024 == 0) |
| 105 | if (EnergyCounter & (1024-1) == 0) |
- | |
| 106 | StoreInEEPROM = 1; |
104 | StoreInEEPROM = 1; |
| 107 | #endif |
105 | #endif |
| 108 | #if sns_power_10000_PULSES_PER_KWH == 1 |
106 | #if sns_power_10000_PULSES_PER_KWH == 1 |
| 109 | tmpCounter++; |
107 | tmpCounter++; |
| 110 | #if sns_power_SEND_1_MIN_AVG == 1 |
108 | #if sns_power_SEND_1_MIN_AVG == 1 |
| 111 | avgCounter++; |
109 | avgCounter++; |
| 112 | #endif |
110 | #endif |
| 113 | if(tmpCounter >= 10) { |
111 | if(tmpCounter >= 10) { |
| 114 | EnergyCounter++; |
112 | EnergyCounter++; |
| 115 |
|
113 | if (EnergyCounter % 1024 == 0) |
| 116 | if (EnergyCounter & (1024-1) == 0) |
- | |
| 117 | StoreInEEPROM = 1; |
114 | StoreInEEPROM = 1; |
| 118 | tmpCounter = 0; |
115 | tmpCounter = 0; |
| 119 | } |
116 | } |
| 120 | #endif |
117 | #endif |
| 121 | 118 | ||