mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Change all time conversions. Yech. New timer units in microseconds breaks all existing logic that used milliseconds in the conversions. Something likely got broken doing this, probably because I confused a MSEC2TICK conversion with a TICK2MSEC conversion. Also, the tickless OS no appears fully functional and passes the OS test on the simulator with no errors
This commit is contained in:
@@ -156,11 +156,11 @@
|
|||||||
/* Delays ***************************************************************************/
|
/* Delays ***************************************************************************/
|
||||||
/* All values will be increased by one system timer tick (probably 10MS). */
|
/* All values will be increased by one system timer tick (probably 10MS). */
|
||||||
|
|
||||||
#define TC_PENUP_POLL_TICKS (70 / MSEC_PER_TICK) /* IDLE polling rate: 100 MSec */
|
#define TC_PENUP_POLL_TICKS MSEC2TICK(70) /* IDLE polling rate: 70 MSec */
|
||||||
#define TC_PENDOWN_POLL_TICKS (40 / MSEC_PER_TICK) /* Active polling rate: 60 MSec */
|
#define TC_PENDOWN_POLL_TICKS MSEC2TICK(40) /* Active polling rate: 40 MSec */
|
||||||
#define TC_DEBOUNCE_TICKS (16 / MSEC_PER_TICK) /* Delay before re-sampling: 30 MSec */
|
#define TC_DEBOUNCE_TICKS MSEC2TICK(16) /* Delay before re-sampling: 16 MSec */
|
||||||
#define TC_SAMPLE_TICKS (4 / MSEC_PER_TICK) /* Delay for A/D sampling: 4 MSec */
|
#define TC_SAMPLE_TICKS MSEC2TICK(4) /* Delay for A/D sampling: 4 MSec */
|
||||||
#define TC_SETTLE_TICKS (10 / MSEC_PER_TICK) /* Delay for A/D settling: 4 MSec */
|
#define TC_SETTLE_TICKS MSECT2TICK(10) /* Delay for A/D settling: 10 MSec */
|
||||||
#define TC_RESAMPLE_TICKS TC_SAMPLE_TICKS
|
#define TC_RESAMPLE_TICKS TC_SAMPLE_TICKS
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|||||||
@@ -142,10 +142,10 @@
|
|||||||
/* Delays ***************************************************************************/
|
/* Delays ***************************************************************************/
|
||||||
/* All values will be increased by one system timer tick (probably 10MS). */
|
/* All values will be increased by one system timer tick (probably 10MS). */
|
||||||
|
|
||||||
#define TC_PENUP_POLL_TICKS (100 / MSEC_PER_TICK) /* IDLE polling rate: 100 MSec */
|
#define TC_PENUP_POLL_TICKS MSEC2TICK(100) /* IDLE polling rate: 100 MSec */
|
||||||
#define TC_PENDOWN_POLL_TICKS (60 / MSEC_PER_TICK) /* Active polling rate: 60 MSec */
|
#define TC_PENDOWN_POLL_TICKS MSEC2TICK(60) /* Active polling rate: 60 MSec */
|
||||||
#define TC_DEBOUNCE_TICKS (30 / MSEC_PER_TICK) /* Delay before re-sampling: 30 MSec */
|
#define TC_DEBOUNCE_TICKS MSEC2TICK(30) /* Delay before re-sampling: 30 MSec */
|
||||||
#define TC_SAMPLE_TICKS (4 / MSEC_PER_TICK) /* Delay for A/D sampling: 4 MSec */
|
#define TC_SAMPLE_TICKS MSEC2TICK(4) /* Delay for A/D sampling: 4 MSec */
|
||||||
#define TC_RESAMPLE_TICKS TC_SAMPLE_TICKS
|
#define TC_RESAMPLE_TICKS TC_SAMPLE_TICKS
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|||||||
@@ -218,8 +218,8 @@ int sam_timerinitialize(void)
|
|||||||
|
|
||||||
/* Set the timeout */
|
/* Set the timeout */
|
||||||
|
|
||||||
tcvdbg("Interval = %d us.\n", (unsigned long)MSEC_PER_TICK * 1000);
|
tcvdbg("Interval = %d us.\n", (unsigned long)USEC_PER_TICK);
|
||||||
ret = ioctl(fd, TCIOC_SETTIMEOUT, (unsigned long)MSEC_PER_TICK * 1000);
|
ret = ioctl(fd, TCIOC_SETTIMEOUT, (unsigned long)USEC_PER_TICK);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
tcdbg("ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno);
|
tcdbg("ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno);
|
||||||
|
|||||||
Reference in New Issue
Block a user