Merge in from Master
This commit is contained in:
commit
be2ed7eba7
@ -10261,3 +10261,5 @@
|
||||
https://github.com/kaushalparikh/nuttx (2015-04-19).
|
||||
* include/time.h: Add prototypes for localtime() and localtimer_r()
|
||||
(2015-04-21).
|
||||
* include/assert.h: Wrap definitions of assertion macros in do while.
|
||||
Suggested by orbitalfox (2015-04-22).
|
||||
|
@ -597,13 +597,13 @@ int up_rtc_settime(FAR const struct timespec *tp)
|
||||
|
||||
/* Enable write access to the backup domain */
|
||||
|
||||
flags = irqsave();
|
||||
(void)stm32_pwr_enablebkp(true);
|
||||
|
||||
/* Then write the broken out values to the RTC counter and BKP overflow register
|
||||
* (hi-res mode only)
|
||||
*/
|
||||
|
||||
flags = irqsave();
|
||||
do
|
||||
{
|
||||
stm32_rtc_beginwr();
|
||||
@ -617,9 +617,9 @@ int up_rtc_settime(FAR const struct timespec *tp)
|
||||
#ifdef CONFIG_RTC_HIRES
|
||||
putreg16(regvals.ovf, RTC_TIMEMSB_REG);
|
||||
#endif
|
||||
irqrestore(flags);
|
||||
|
||||
(void)stm32_pwr_enablebkp(false);
|
||||
irqrestore(flags);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/assert.h
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -58,10 +58,24 @@
|
||||
#ifdef CONFIG_HAVE_FILENAME
|
||||
|
||||
# define ASSERT(f) \
|
||||
{ if (!(f)) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
|
||||
do \
|
||||
{ \
|
||||
if (!(f)) \
|
||||
{ \
|
||||
up_assert((const uint8_t *)__FILE__, (int)__LINE__); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define VERIFY(f) \
|
||||
{ if ((f) < 0) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
|
||||
do \
|
||||
{ \
|
||||
if ((f) < 0) \
|
||||
{ \
|
||||
up_assert((const uint8_t *)__FILE__, (int)__LINE__); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define PANIC() \
|
||||
up_assert((const uint8_t *)__FILE__, (int)__LINE__)
|
||||
@ -69,10 +83,24 @@
|
||||
# ifdef CONFIG_DEBUG
|
||||
|
||||
# define DEBUGASSERT(f) \
|
||||
{ if (!(f)) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
|
||||
do \
|
||||
{ \
|
||||
if (!(f)) \
|
||||
{ \
|
||||
up_assert((const uint8_t *)__FILE__, (int)__LINE__); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define DEBUGVERIFY(f) \
|
||||
{ if ((f) < 0) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
|
||||
do \
|
||||
{ \
|
||||
if ((f) < 0) \
|
||||
{ \
|
||||
up_assert((const uint8_t *)__FILE__, (int)__LINE__); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define DEBUGPANIC() \
|
||||
up_assert((const uint8_t *)__FILE__, (int)__LINE__)
|
||||
|
Loading…
Reference in New Issue
Block a user