From 45591068e82af264fded4a5e66a70674e59c9e1c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 29 Apr 2012 18:06:23 +0000 Subject: Reformatting and documentation related fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4147 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/chrtclib.c | 75 ++++++++++++++++++++++++--------------------------- os/various/mail.c | 2 +- 2 files changed, 36 insertions(+), 41 deletions(-) (limited to 'os/various') diff --git a/os/various/chrtclib.c b/os/various/chrtclib.c index 38f5a3627..f9e770ad1 100644 --- a/os/various/chrtclib.c +++ b/os/various/chrtclib.c @@ -34,14 +34,14 @@ defined(STM32F10X_HD)) #if STM32_RTC_IS_CALENDAR /** - * @brief Converts from STM32 BCD to canonicalized time format. + * @brief Converts from STM32 BCD to canonicalized time format. * - * @param[out] timp pointer to a @p tm structure defined in time.h - * @param[in] timespec pointer to a @p RTCTime structure + * @param[out] timp pointer to a @p tm structure as defined in time.h + * @param[in] timespec pointer to a @p RTCTime structure * * @notapi */ -void stm32_rtc_bcd2tm(struct tm *timp, RTCTime *timespec){ +static void stm32_rtc_bcd2tm(struct tm *timp, RTCTime *timespec) { uint32_t tv_time = timespec->tv_time; uint32_t tv_date = timespec->tv_date; @@ -60,7 +60,7 @@ void stm32_rtc_bcd2tm(struct tm *timp, RTCTime *timespec){ timp->tm_isdst = -1; timp->tm_wday = (tv_date & RTC_DR_WDU) >> RTC_DR_WDU_OFFSET; - if(timp->tm_wday == 7) + if (timp->tm_wday == 7) timp->tm_wday = 0; timp->tm_mday = (tv_date & RTC_DR_DU) >> RTC_DR_DU_OFFSET; @@ -86,14 +86,14 @@ void stm32_rtc_bcd2tm(struct tm *timp, RTCTime *timespec){ } /** - * @brief Converts from canonicalized to STM32 BCD time format. + * @brief Converts from canonicalized to STM32 BCD time format. * - * @param[in] timp pointer to a @p tm structure defined in time.h + * @param[in] timp pointer to a @p tm structure as defined in time.h * @param[out] timespec pointer to a @p RTCTime structure * * @notapi */ -void stm32_rtc_tm2bcd(struct tm *timp, RTCTime *timespec){ +static void stm32_rtc_tm2bcd(struct tm *timp, RTCTime *timespec) { uint32_t v = 0; timespec->tv_date = 0; @@ -131,28 +131,29 @@ void stm32_rtc_tm2bcd(struct tm *timp, RTCTime *timespec){ } /** - * @brief Gets raw time from RTC and converts it to canonicalized format. + * @brief Gets raw time from RTC and converts it to canonicalized format. * * @param[in] rtcp pointer to RTC driver structure - * @param[out] timp pointer to a @p tm structure defined in time.h + * @param[out] timp pointer to a @p tm structure as defined in time.h * * @api */ -void rtcGetTimeTm(RTCDriver *rtcp, struct tm *timp){ +void rtcGetTimeTm(RTCDriver *rtcp, struct tm *timp) { RTCTime timespec = {0,0,FALSE,0}; + rtcGetTime(rtcp, ×pec); stm32_rtc_bcd2tm(timp, ×pec); } /** - * @brief Sets RTC time. + * @brief Sets RTC time. * * @param[in] rtcp pointer to RTC driver structure - * @param[out] timp pointer to a @p tm structure defined in time.h + * @param[out] timp pointer to a @p tm structure as defined in time.h * * @api */ -void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp){ +void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp) { RTCTime timespec = {0,0,FALSE,0}; stm32_rtc_tm2bcd(timp, ×pec); @@ -160,15 +161,14 @@ void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp){ } /** - * @brief Gets raw time from RTC and converts it to unix format. + * @brief Gets raw time from RTC and converts it to unix format. * * @param[in] rtcp pointer to RTC driver structure - * * @return Unix time value in seconds. * * @api */ -time_t rtcGetTimeUnixSec(RTCDriver *rtcp){ +time_t rtcGetTimeUnixSec(RTCDriver *rtcp) { RTCTime timespec = {0,0,FALSE,0}; struct tm timp; @@ -179,15 +179,14 @@ time_t rtcGetTimeUnixSec(RTCDriver *rtcp){ } /** - * @brief Sets RTC time. + * @brief Sets RTC time. * * @param[in] rtcp pointer to RTC driver structure - * * @return Unix time value in seconds. * * @api */ -void rtcSetTimeUnixSec(RTCDriver *rtcp, time_t tv_sec){ +void rtcSetTimeUnixSec(RTCDriver *rtcp, time_t tv_sec) { RTCTime timespec = {0,0,FALSE,0}; struct tm *timp; @@ -197,15 +196,14 @@ void rtcSetTimeUnixSec(RTCDriver *rtcp, time_t tv_sec){ } /** - * @brief Gets raw time from RTC and converts it to unix format. + * @brief Gets raw time from RTC and converts it to unix format. * * @param[in] rtcp pointer to RTC driver structure - * * @return Unix time value in microseconds. * * @api */ -uint64_t rtcGetTimeUnixUsec(RTCDriver *rtcp){ +uint64_t rtcGetTimeUnixUsec(RTCDriver *rtcp) { uint64_t result = 0; RTCTime timespec = {0,0,FALSE,0}; @@ -225,14 +223,14 @@ uint64_t rtcGetTimeUnixUsec(RTCDriver *rtcp){ #else /* STM32_RTC_IS_CALENDAR */ /** - * @brief Gets raw time from RTC and converts it to canonicalized format. + * @brief Gets raw time from RTC and converts it to canonicalized format. * * @param[in] rtcp pointer to RTC driver structure - * @param[out] timp pointer to a @p tm structure defined in time.h + * @param[out] timp pointer to a @p tm structure as defined in time.h * * @api */ -void rtcGetTimeTm(RTCDriver *rtcp, struct tm *timp){ +void rtcGetTimeTm(RTCDriver *rtcp, struct tm *timp) { RTCTime timespec = {0,0,FALSE,0}; rtcGetTime(rtcp, ×pec); @@ -241,14 +239,14 @@ void rtcGetTimeTm(RTCDriver *rtcp, struct tm *timp){ } /** - * @brief Sets RTC time. + * @brief Sets RTC time. * * @param[in] rtcp pointer to RTC driver structure - * @param[out] timp pointer to a @p tm structure defined in time.h + * @param[out] timp pointer to a @p tm structure as defined in time.h * * @api */ -void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp){ +void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp) { RTCTime timespec = {0,0,FALSE,0}; timespec.tv_sec = mktime(timp); @@ -257,15 +255,14 @@ void rtcSetTimeTm(RTCDriver *rtcp, struct tm *timp){ } /** - * @brief Gets raw time from RTC and converts it to unix format. + * @brief Gets raw time from RTC and converts it to unix format. * * @param[in] rtcp pointer to RTC driver structure - * * @return Unix time value in seconds. * * @api */ -time_t rtcGetTimeUnixSec(RTCDriver *rtcp){ +time_t rtcGetTimeUnixSec(RTCDriver *rtcp) { RTCTime timespec = {0,0,FALSE,0}; rtcGetTime(rtcp, ×pec); @@ -273,15 +270,14 @@ time_t rtcGetTimeUnixSec(RTCDriver *rtcp){ } /** - * @brief Sets RTC time. + * @brief Sets RTC time. * * @param[in] rtcp pointer to RTC driver structure - * * @return Unix time value in seconds. * * @api */ -void rtcSetTimeUnixSec(RTCDriver *rtcp, time_t tv_sec){ +void rtcSetTimeUnixSec(RTCDriver *rtcp, time_t tv_sec) { RTCTime timespec = {0,0,FALSE,0}; timespec.tv_sec = tv_sec; @@ -290,15 +286,14 @@ void rtcSetTimeUnixSec(RTCDriver *rtcp, time_t tv_sec){ } /** - * @brief Gets raw time from RTC and converts it to unix format. + * @brief Gets raw time from RTC and converts it to unix format. * * @param[in] rtcp pointer to RTC driver structure - * * @return Unix time value in microseconds. * * @api */ -uint64_t rtcGetTimeUnixUsec(RTCDriver *rtcp){ +uint64_t rtcGetTimeUnixUsec(RTCDriver *rtcp) { uint64_t result = 0; RTCTime timespec = {0,0,FALSE,0}; @@ -317,12 +312,12 @@ uint64_t rtcGetTimeUnixUsec(RTCDriver *rtcp){ /** * @brief Get current time in format suitable for usage in FatFS. * - * @param[in] timespec pointer to time value structure + * @param[in] rtcp pointer to RTC driver structure * @return FAT time value. * * @api */ -uint32_t rtcGetTimeFat(RTCDriver *rtcp){ +uint32_t rtcGetTimeFat(RTCDriver *rtcp) { uint32_t fattime = 0; struct tm *timp = NULL; diff --git a/os/various/mail.c b/os/various/mail.c index cebd44457..5702b0be8 100644 --- a/os/various/mail.c +++ b/os/various/mail.c @@ -32,7 +32,7 @@ /** * @brief Initializes a Mail Pool. * @note The number of the mail objects in the mail pool should be at - * least 2+size(mailbox), this considering one writer and + * least 2+size(mailbox), this considering one writer and * one reader, add one element for each extra reader or writer in * order to avoid waiting on the mail pool. A smaller number of * elements can be specified if waiting on the pool is acceptable. -- cgit v1.2.3