Skip to content

Commit e25f008

Browse files
committed
Update perf_counter.c
1 parent cf99406 commit e25f008

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

perf_counter.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,28 +119,26 @@ void perfc_port_insert_to_system_timer_insert_ovf_handler(void)
119119
*/
120120
__IRQ_SAFE {
121121
s_lSystemClockCounts += lLoad;
122+
}
122123

123-
// update system ms counter
124-
do {
125-
int64_t lTemp = s_wMSResidule + lLoad;
124+
// update system ms counter
125+
__IRQ_SAFE {
126+
int64_t lTemp = s_wMSResidule + lLoad;
126127

127-
int64_t lMS = lTemp / s_wMSUnit;
128-
s_lSystemMS += lMS;
129-
s_wMSResidule = (uint32_t)((int64_t)lTemp - (int64_t)lMS * s_wMSUnit);
128+
int64_t lMS = lTemp / s_wMSUnit;
129+
s_lSystemMS += lMS;
130130

131-
} while(0);
131+
s_wMSResidule = (uint32_t)((int64_t)lTemp - (int64_t)lMS * s_wMSUnit);
132132
}
133133

134+
// update system us counter
134135
__IRQ_SAFE {
135-
// update system us counter
136-
do {
137-
int64_t lTemp = s_wUSResidule + lLoad;
136+
int64_t lTemp = s_wUSResidule + lLoad;
138137

139-
int64_t lUS = lTemp / s_wUSUnit;
140-
s_lSystemUS += lUS;
138+
int64_t lUS = lTemp / s_wUSUnit;
139+
s_lSystemUS += lUS;
141140

142-
s_wUSResidule = (uint32_t)((int64_t)lTemp - (int64_t)lUS * s_wUSUnit);
143-
} while(0);
141+
s_wUSResidule = (uint32_t)((int64_t)lTemp - (int64_t)lUS * s_wUSUnit);
144142
}
145143
}
146144

0 commit comments

Comments
 (0)