diff --git a/ChangeLog b/ChangeLog index a5743d55eec..32522415b67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2052,3 +2052,8 @@ * lib/time/lib_gmtimer.c: Correct several calculations that could lead to errors in dates. * drivers/pm: Add the beginnings of a NuttX power management sub-system. + * arch/arm/src/stm32/stm32_irq.c: Fix a error introduced in 6.8. + Timeout calculation uses clock_settime() instead of clock_gettime(). + Pretty gross error, but actually it works with the side effect of setting + a bad time. + diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html index 69310516691..73bb1bf6583 100644 --- a/Documentation/NuttShell.html +++ b/Documentation/NuttShell.html @@ -1497,7 +1497,7 @@ ping [-c <count>] [-i <interval>] <ip-address> Test the network communication with a remote peer. Example,
-nsh> 10.0.0.1
+nsh> ping 10.0.0.1
PING 10.0.0.1 56 bytes of data
56 bytes from 10.0.0.1: icmp_seq=1 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c
index 6057192464c..09f61c05cf5 100644
--- a/arch/arm/src/stm32/stm32_i2c.c
+++ b/arch/arm/src/stm32/stm32_i2c.c
@@ -200,7 +200,7 @@ int inline stm32_i2c_sem_waitisr(FAR struct i2c_dev_s *dev)
flags = irqsave();
do
{
- (void)clock_settime(CLOCK_REALTIME, &abstime);
+ (void)clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000;
if (abstime.tv_nsec > 1000 * 1000 * 1000)
{
diff --git a/drivers/pm/pm_checkstate.c b/drivers/pm/pm_checkstate.c
index 93f19a5024b..9ecff862eb2 100644
--- a/drivers/pm/pm_checkstate.c
+++ b/drivers/pm/pm_checkstate.c
@@ -129,7 +129,7 @@ enum pm_state_e pm_checkstate(void)
now = clock_systimer();
if (now - g_pmglobals.stime >= TIME_SLICE_TICKS)
{
- int16_t accum;
+ int16_t accum;
/* Sample the count, reset the time and count, and assess the PM
* state. This is an atomic operation because interrupts are
diff --git a/include/nuttx/pm.h b/include/nuttx/pm.h
index 898a82b88fd..520348ca621 100644
--- a/include/nuttx/pm.h
+++ b/include/nuttx/pm.h
@@ -458,5 +458,22 @@ EXTERN int pm_changestate(enum pm_state_e newstate);
#endif
#endif /* __ASSEMBLY__ */
+
+/****************************************************************************
+ * Stubs
+ ****************************************************************************/
+
+#else /* CONFIG_PM */
+
+/* Stubbed out versions of all of PM interface functions that may be used to
+ * avoid so much conditional compilation in driver code when PM is disabled:
+ */
+
+# define pm_initialize()
+# define pm_register(cb) (0)
+# define pm_activity(prio)
+# define pm_checkstate() (0)
+# define pm_changestate(state)
+
#endif /* CONFIG_PM */
#endif /* __INCLUDE_NUTTX_PM_H */