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:
Gregory Nutt 2014-08-07 18:00:38 -06:00
parent 49deb059d4
commit 899025527c
3 changed files with 11 additions and 11 deletions

View File

@ -156,11 +156,11 @@
/* Delays ***************************************************************************/
/* 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_PENDOWN_POLL_TICKS (40 / MSEC_PER_TICK) /* Active polling rate: 60 MSec */
#define TC_DEBOUNCE_TICKS (16 / MSEC_PER_TICK) /* Delay before re-sampling: 30 MSec */
#define TC_SAMPLE_TICKS (4 / MSEC_PER_TICK) /* Delay for A/D sampling: 4 MSec */
#define TC_SETTLE_TICKS (10 / MSEC_PER_TICK) /* Delay for A/D settling: 4 MSec */
#define TC_PENUP_POLL_TICKS MSEC2TICK(70) /* IDLE polling rate: 70 MSec */
#define TC_PENDOWN_POLL_TICKS MSEC2TICK(40) /* Active polling rate: 40 MSec */
#define TC_DEBOUNCE_TICKS MSEC2TICK(16) /* Delay before re-sampling: 16 MSec */
#define TC_SAMPLE_TICKS MSEC2TICK(4) /* Delay for A/D sampling: 4 MSec */
#define TC_SETTLE_TICKS MSECT2TICK(10) /* Delay for A/D settling: 10 MSec */
#define TC_RESAMPLE_TICKS TC_SAMPLE_TICKS
/************************************************************************************

View File

@ -142,10 +142,10 @@
/* Delays ***************************************************************************/
/* 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_PENDOWN_POLL_TICKS (60 / MSEC_PER_TICK) /* Active polling rate: 60 MSec */
#define TC_DEBOUNCE_TICKS (30 / MSEC_PER_TICK) /* Delay before re-sampling: 30 MSec */
#define TC_SAMPLE_TICKS (4 / MSEC_PER_TICK) /* Delay for A/D sampling: 4 MSec */
#define TC_PENUP_POLL_TICKS MSEC2TICK(100) /* IDLE polling rate: 100 MSec */
#define TC_PENDOWN_POLL_TICKS MSEC2TICK(60) /* Active polling rate: 60 MSec */
#define TC_DEBOUNCE_TICKS MSEC2TICK(30) /* Delay before re-sampling: 30 MSec */
#define TC_SAMPLE_TICKS MSEC2TICK(4) /* Delay for A/D sampling: 4 MSec */
#define TC_RESAMPLE_TICKS TC_SAMPLE_TICKS
/************************************************************************************

View File

@ -218,8 +218,8 @@ int sam_timerinitialize(void)
/* Set the timeout */
tcvdbg("Interval = %d us.\n", (unsigned long)MSEC_PER_TICK * 1000);
ret = ioctl(fd, TCIOC_SETTIMEOUT, (unsigned long)MSEC_PER_TICK * 1000);
tcvdbg("Interval = %d us.\n", (unsigned long)USEC_PER_TICK);
ret = ioctl(fd, TCIOC_SETTIMEOUT, (unsigned long)USEC_PER_TICK);
if (ret < 0)
{
tcdbg("ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno);