реклама на сайте
подробности

 
 
> Часы в IAR на базе clock(). Секундый таймер IAR.
Dnepr33
сообщение May 27 2014, 04:41
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 22
Регистрация: 1-02-11
Из: Днепропетровск
Пользователь №: 62 622



<time.h>
Как перенастроить, если это в принципе возможно, таймер 1-сек, к которому обращается ф-я clock_t clock(void).
Возможно ли задать тактирование таймера для clock() в IAR от вектора аппаратного прерывания внешнего таймера,
например PCF8563 ? ( В <time.h> определены макрос CLOCKS_PER_SEC )

Откуда возник вопрос.
Переход на зимнее-летнее время, будь он неладен. Аппаратные RTC это не поддерживают.
Даты-время-правило перехода определяются законодательно каждым государством.
Как достаточно просто реализовать часы RTC на базе UTC с поддержкой таймзоны и перехода зима-лето ?
( MSP430 )



Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
Dnepr33
сообщение May 29 2014, 04:22
Сообщение #2


Участник
*

Группа: Участник
Сообщений: 22
Регистрация: 1-02-11
Из: Днепропетровск
Пользователь №: 62 622



Вот что пишется в док (EWRX_CompilerReference.ENU.pdf) на IAR
----------------
Time: (для MSP430)
To make the __time32, __time64, and date functions work,
you must implement the functions:
clock,
__time32,
__time64, and
__getzone.
Whether you use __time32 or __time64 depends on which interface you use for time_t, see time.h, page 304.
To implement these functions does not require that you rebuild the library. You can find
source templates in the files clock.c, time.c, time64.c, and getzone.c in the
430\src\lib directory. For information about overriding default library modules, see
Overriding library modules, page 90.
If you decide to rebuild the library, you can find source templates in the library project
template. For more information, see Building and using a customized library, page 91.
The default implementation of __getzone specifies UTC (Coordinated Universal
Time) as the time zone.
Note: If you link your application with support for I/O debugging, the functions clock
and time are replaced by C-SPY variants that return the host clock and time
respectively. For more information, see Application debug support, page 87.
------------------

Это замечательно, где бы найти пример реализаций и методику перекомпоновки библиотек ?

Сообщение отредактировал Dnepr33 - May 29 2014, 04:41
Go to the top of the page
 
+Quote Post
Сергей Борщ
сообщение May 29 2014, 05:34
Сообщение #3


Гуру
******

Группа: Модераторы
Сообщений: 8 455
Регистрация: 15-05-06
Из: Рига, Латвия
Пользователь №: 17 095



Цитата(Dnepr33 @ May 29 2014, 11:32) *
Это замечательно, где бы найти пример реализаций и методику перекомпоновки библиотек ?

Чукча писатель?
Цитата(Dnepr33 @ May 29 2014, 11:32) *
To implement these functions does not require that you rebuild the library. You can find
source templates in the files clock.c, time.c, time64.c, and getzone.c in the
430\src\lib directory.



--------------------
На любой вопрос даю любой ответ
"Write code that is guaranteed to work, not code that doesn’t seem to break" (C++ FAQ)
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 2nd August 2025 - 05:22
Рейтинг@Mail.ru


Страница сгенерированна за 0.02145 секунд с 7
ELECTRONIX ©2004-2016