Changeset 307 in flair-src for trunk/lib/FlairCore/src/Thread_impl.cpp
- Timestamp:
- Mar 8, 2019, 10:30:25 AM (6 years ago)
- Location:
- trunk/lib/FlairCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore
-
Property svn:ignore
set to
build_x86_64
build_core2_64
build_armv7a_neon
build_armv5te
build_arm
build
.codelite
.clang
-
Property svn:ignore
set to
-
trunk/lib/FlairCore/src/Thread_impl.cpp
r250 r307 174 174 175 175 #ifdef __XENO__ 176 int status = rt_task_set_periodic(&task_rt, TM_NOW, period *1000);176 int status = rt_task_set_periodic(&task_rt, TM_NOW, (Time)period * (Time)1000); 177 177 if (status != 0) { 178 178 char errorMsg[256]; … … 181 181 #else 182 182 if (period_set) { 183 next_time -= period;184 next_time += period *1000;185 } else next_time=GetTime()+ period*1000;186 #endif 187 this->period = period *1000;183 next_time -= (Time)period; 184 next_time += (Time)period * (Time)1000; 185 } else next_time=GetTime()+(Time)period*(Time)1000; 186 #endif 187 this->period = (Time)period * (Time)1000; 188 188 period_set = true; 189 189 } … … 192 192 193 193 void Thread_impl::SetPeriodMS(uint32_t period) { 194 if (period == 0) { 195 self->Err("Period must be>0\n"); 196 return; 197 } 198 199 #ifdef __XENO__ 200 int status = rt_task_set_periodic(&task_rt, TM_NOW, period * 1000 * 1000); 201 if (status != 0) { 202 char errorMsg[256]; 203 self->Err("Error rt_task_set_periodic %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg))); 204 } 205 #else 206 if (period_set) { 207 next_time -= period; 208 next_time += period * 1000 * 1000; 209 } else next_time=GetTime()+period*1000*1000; 210 #endif 211 this->period = period * 1000 * 1000; 212 period_set = true; 194 SetPeriodUS(period*1000); 213 195 } 214 196
Note:
See TracChangeset
for help on using the changeset viewer.