![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: timeslice.cpp
- Revision:
- 121:ee02790d00b7
- Parent:
- 119:ee6a53069455
diff -r 770f00554b1e -r ee02790d00b7 timeslice.cpp --- a/timeslice.cpp Mon May 04 17:25:29 2015 +0000 +++ b/timeslice.cpp Fri May 08 04:15:23 2015 +0000 @@ -1,7 +1,7 @@ #include "timeslice.h" Timeslice::Timeslice(){ - for( register int i = 0; i < __MAX_TIMESLICES__; i++ ) timeslice[ i ] = 0; + for( register int i = 0; i < MAX_TIMESLICES; i++ ) timeslice[ i ] = 0; } Timeslice::~Timeslice(){ @@ -9,7 +9,7 @@ } uint8_t Timeslice::get_timeslice(){ - for( register uint8_t i = 0; i < __MAX_TIMESLICES__; i++ ) + for( register uint8_t i = 0; i < MAX_TIMESLICES; i++ ) if( timeslice[ i ] == 0 ){ timeslice[ i ] = 1; return( i + 1 ); @@ -18,17 +18,17 @@ } void Timeslice::return_timeslice( uint8_t ts ){ - if( ts <= __MAX_TIMESLICES__ && ts > 0 ) timeslice[ ts - 1 ] = 0; + if( ts <= MAX_TIMESLICES && ts > 0 ) timeslice[ ts - 1 ] = 0; } void Timeslice::reset(){ - for( register uint8_t i = 0; i < __MAX_TIMESLICES__; i++ ) + for( register uint8_t i = 0; i < MAX_TIMESLICES; i++ ) timeslice[ i ] = 0; } uint8_t Timeslice::remain_timeslices( void ){ uint8_t sum = 0; - for( register uint8_t i = 0; i < __MAX_TIMESLICES__; i++ ){ + for( register uint8_t i = 0; i < MAX_TIMESLICES; i++ ){ if( timeslice[ i ] == 0 ) sum++; } return( sum );