![](/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:
- 119:ee6a53069455
- Parent:
- 0:4d17cd9c8f9d
- Child:
- 121:ee02790d00b7
--- a/timeslice.cpp Fri Apr 24 13:54:24 2015 +0000 +++ b/timeslice.cpp Thu Apr 30 15:42:41 2015 +0000 @@ -1,7 +1,7 @@ #include "timeslice.h" Timeslice::Timeslice(){ - for( register int i = 0; i < __MAX_TIMESLICES__; i++ ) timeslice[ i ] = 0x00; + for( register int i = 0; i < __MAX_TIMESLICES__; i++ ) timeslice[ i ] = 0; } Timeslice::~Timeslice(){ @@ -9,27 +9,27 @@ } uint8_t Timeslice::get_timeslice(){ - for( register uint8_t i = 0x00; i < __MAX_TIMESLICES__; i++ ) - if( timeslice[ i ] == 0x00 ){ - timeslice[ i ] = 0x01; + for( register uint8_t i = 0; i < __MAX_TIMESLICES__; i++ ) + if( timeslice[ i ] == 0 ){ + timeslice[ i ] = 1; return( i + 1 ); } - return( 0x00 ); + return( 0 ); } void Timeslice::return_timeslice( uint8_t ts ){ - if( ts <= __MAX_TIMESLICES__ && ts > 0 ) timeslice[ ts - 1 ] = 0x00; + if( ts <= __MAX_TIMESLICES__ && ts > 0 ) timeslice[ ts - 1 ] = 0; } void Timeslice::reset(){ - for( register uint8_t i = 0x00; i < __MAX_TIMESLICES__; i++ ) - timeslice[ i ] = 0x00; + for( register uint8_t i = 0; i < __MAX_TIMESLICES__; i++ ) + timeslice[ i ] = 0; } uint8_t Timeslice::remain_timeslices( void ){ - uint8_t sum = 0x00; - for( register uint8_t i = 0x00; i < __MAX_TIMESLICES__; i++ ){ - if( timeslice[ i ] == 0x00 ) sum++; + uint8_t sum = 0; + for( register uint8_t i = 0; i < __MAX_TIMESLICES__; i++ ){ + if( timeslice[ i ] == 0 ) sum++; } return( sum ); } \ No newline at end of file