diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 21:23:18 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 21:23:18 +0000 |
commit | d9714b556703561a0abcbe71970b1cd6922168a6 (patch) | |
tree | 70b7893243b8ee2e6b8b5fd95106c4ab962699c5 /apps/modbus/nuttx/porttimer.c | |
parent | ebf70f8a79eb8ef23bc1d99938768ef06c466119 (diff) | |
download | px4-nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.tar.gz px4-nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.tar.bz2 px4-nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.zip |
Use NuttX types in FreeModBus port; Add FreeModBus demo at apps/examples/modbus; Add new termios APIs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4964 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/modbus/nuttx/porttimer.c')
-rw-r--r-- | apps/modbus/nuttx/porttimer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/modbus/nuttx/porttimer.c b/apps/modbus/nuttx/porttimer.c index 3ff2d78ae..d688c4f52 100644 --- a/apps/modbus/nuttx/porttimer.c +++ b/apps/modbus/nuttx/porttimer.c @@ -37,14 +37,14 @@ /* ----------------------- Defines ------------------------------------------*/ /* ----------------------- Static variables ---------------------------------*/ -ULONG ulTimeOut; -BOOL bTimeoutEnable; +uint32_t ulTimeOut; +bool bTimeoutEnable; static struct timeval xTimeLast; /* ----------------------- Start implementation -----------------------------*/ -BOOL -xMBPortTimersInit( USHORT usTim1Timerout50us ) +bool +xMBPortTimersInit( uint16_t usTim1Timerout50us ) { ulTimeOut = usTim1Timerout50us / 20U; if( ulTimeOut == 0 ) @@ -62,7 +62,7 @@ xMBPortTimersClose( ) void vMBPortTimerPoll( ) { - ULONG ulDeltaMS; + uint32_t ulDeltaMS; struct timeval xTimeCur; /* Timers are called from the serial layer because we have no high @@ -79,7 +79,7 @@ vMBPortTimerPoll( ) ( xTimeCur.tv_usec - xTimeLast.tv_usec ) * 1000L; if( ulDeltaMS > ulTimeOut ) { - bTimeoutEnable = FALSE; + bTimeoutEnable = false; ( void )pxMBPortCBTimerExpired( ); } } @@ -92,11 +92,11 @@ vMBPortTimersEnable( ) int res = gettimeofday( &xTimeLast, NULL ); ASSERT( res == 0 ); - bTimeoutEnable = TRUE; + bTimeoutEnable = true; } void vMBPortTimersDisable( ) { - bTimeoutEnable = FALSE; + bTimeoutEnable = false; } |