|
HP85 GPIB Disk Emulator
1.0
HP85GPIBDiskEmulator
|
timer functions More...
Go to the source code of this file.
Functions | |
| MEMSPACE int | set_timers (void(*handler)(void), int timer __attribute__((unused))) |
| Install a user timer task. More... | |
| MEMSPACE int | kill_timer (int timer) |
| Delete "Kill" one user timer task. More... | |
| MEMSPACE void | delete_all_timers () |
| Clear ALL user timer tasks. More... | |
| MEMSPACE void | subtract_timespec (ts_t *a, ts_t *b) |
| subtract a-= b timespec * structures. More... | |
| MEMSPACE char * | ts_to_str (ts_t *val) |
| MEMSPACE void | display_ts (ts_t *val) |
| timespec structure in seconds.nanoseconds. More... | |
| MEMSPACE void | clock_elapsed_begin () |
| Store current struct timespec in __clock_elapsed. More... | |
| MEMSPACE void | clock_elapsed_end (char *msg) |
| Subtract and display time difference from clock_elapesed_begin(). More... | |
| MEMSPACE void | clock_clear () |
| clear time and timezone to 0. More... | |
| MEMSPACE void | disable_timers () |
| Disable all timer tasks. More... | |
| MEMSPACE void | enable_timers () |
| Enable timer tasks. More... | |
| void | execute_timers () |
| Execute all user timers at SYSTEM_HZ rate. Called by system task. More... | |
| void | clock_task (void) |
| 1000HZ timer task More... | |
| MEMSPACE void | init_timers () |
| Setup all timers tasksi and enable interrupts. More... | |
| MEMSPACE int | clock_getres (clockid_t clk_id __attribute__((unused)), struct timespec *res) |
| Read clock time resolution into struct timepec *ts - POSIX function. More... | |
| MEMSPACE int | clock_settime (clockid_t clk_id __attribute__((unused)), const struct timespec *ts) |
| Set system clock using seconds and nonoseconds - POSIX function. More... | |
| MEMSPACE int | clock_gettime (clockid_t clk_id __attribute__((unused)), struct timespec *ts) |
| Generic clock_gettime() function WITHOUT high resolution. More... | |
Variables | |
| volatile ts_t | __clock |
| System Clock Time. More... | |
| tz_t | __tzone |
| System Time Zone. More... | |
| static int | timers_enabled = 0 |
| static int | timers_configured = 0 |
| TIMERS | timer_irq [MAX_TIMER_CNT] |
| array or user timers More... | |
| static char | _ts_to_str [32] |
| timespec structure in seconds.nanoseconds in string. More... | |
| static ts_t | __clock_elapsed |
| Used for elapsed time calculations. More... | |
timer functions
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file timer.c.
| MEMSPACE void clock_clear | ( | ) |
clear time and timezone to 0.
Definition at line 222 of file timer.c.
Referenced by init_timers(), and main().
| MEMSPACE void clock_elapsed_begin | ( | ) |
Store current struct timespec in __clock_elapsed.
Definition at line 184 of file timer.c.
Referenced by gpib_timer_elapsed_begin().
| MEMSPACE void clock_elapsed_end | ( | char * | msg | ) |
Subtract and display time difference from clock_elapesed_begin().
| [in] | msg | User message to proceed Time display. |
Definition at line 200 of file timer.c.
Referenced by gpib_timer_elapsed_end().
Generic clock_gettime() function WITHOUT high resolution.
Read clock time into struct timepec *ts - POSIX function.
| [in] | clk_id | unused hardware clock index. |
| [out] | ts | timespec result. |
Definition at line 386 of file timer.c.
Referenced by clock_elapsed_begin(), clock_elapsed_end(), display_clock(), gettimeofday(), printer_open(), and time().
Set system clock using seconds and nonoseconds - POSIX function.
| [in] | clk_id | Hardware timer index used when there are more then one.
|
| [in] | ts | struct timespec input. |
Definition at line 353 of file timer.c.
Referenced by clock_clear(), clock_set(), initialize_clock(), setdate_r(), and settimeofday().
| void clock_task | ( | void | ) |
| MEMSPACE void delete_all_timers | ( | ) |
Clear ALL user timer tasks.
Definition at line 116 of file timer.c.
Referenced by init_timers().
| MEMSPACE void disable_timers | ( | ) |
| MEMSPACE void enable_timers | ( | ) |
Enable timer tasks.
Definition at line 251 of file timer.c.
Referenced by init_timers().
| void execute_timers | ( | ) |
| MEMSPACE void init_timers | ( | ) |
Setup all timers tasksi and enable interrupts.
See time.c
Definition at line 299 of file timer.c.
Referenced by main().
| MEMSPACE int kill_timer | ( | int | timer | ) |
| MEMSPACE int set_timers | ( | void(*)(void) | handler, |
| int timer | __attribute__(unused) | ||
| ) |
Install a user timer task.
| [in] | handler) | function pointer to user task. |
| [in] | timer | reserved for systems with additional low level hardware timers. |
Definition at line 59 of file timer.c.
Referenced by gpib_timer_init(), i2c_init(), init_timers(), and mmc_install_timer().
subtract a-= b timespec * structures.
| [in] | a | timespec struct. |
| [in] | b | timespec struct. |
Definition at line 134 of file timer.c.
Referenced by clock_elapsed_end().
Definition at line 154 of file timer.c.
Referenced by clock_elapsed_end(), and display_ts().
| volatile ts_t __clock |
System Clock Time.
Definition at line 38 of file timer.c.
Referenced by clock_gettime(), clock_settime(), and clock_task().
|
static |
Used for elapsed time calculations.
Definition at line 176 of file timer.c.
Referenced by clock_elapsed_begin(), and clock_elapsed_end().
| tz_t __tzone |
|
static |
timespec structure in seconds.nanoseconds in string.
| [in] | timespec struct we wish to display. | |
| [in] | output string. |
Definition at line 152 of file timer.c.
Referenced by ts_to_str().
| TIMERS timer_irq[MAX_TIMER_CNT] |
array or user timers
Definition at line 47 of file timer.c.
Referenced by delete_all_timers(), execute_timers(), kill_timer(), and set_timers().
|
static |
Definition at line 44 of file timer.c.
Referenced by disable_timers(), enable_timers(), and init_timers().
|
static |
Definition at line 43 of file timer.c.
Referenced by disable_timers(), enable_timers(), and init_timers().
1.8.17