FreeHIL
Loading...
Searching...
No Matches
FH_GlobalTimerCount.c File Reference

File Map:
FH_Root, Section FH_General, FH_GlobalTimerCount
There are a diverse range of different situations where a precise timing is a necessity
To have a general heart beat (1 mili-second) for all different parts of the code, a timer in the micro-controller on which FH source code is ported, shall be utilized
FH_GlobalTimeCounter here shall be incremented every 1 mili-second in an interested timer ISR (Interrupt Service Routine) by FH user
For this to happen, FH_GlobalTimerCount.h shall be included in the interested timer ISR (Interrupt Service Routine) file More...

Go to the source code of this file.

Functions

void FH_Reset_GlobalTimeCounter ()
 This function resets the FH_GlobalTimeCounter if need be
FH_GlobalTimeCounter here shall be incremented every 1 mili-second in an interested timer ISR (Interrupt Service Routine) by FH user
For this to happen, FH_GlobalTimerCount.h shall be included in the interested timer ISR (Interrupt Service Routine) file.

Variables

volatile uint32_t FH_GlobalTimeCounter = 0

Detailed Description

File Map:
FH_Root, Section FH_General, FH_GlobalTimerCount
There are a diverse range of different situations where a precise timing is a necessity
To have a general heart beat (1 mili-second) for all different parts of the code, a timer in the micro-controller on which FH source code is ported, shall be utilized
FH_GlobalTimeCounter here shall be incremented every 1 mili-second in an interested timer ISR (Interrupt Service Routine) by FH user
For this to happen, FH_GlobalTimerCount.h shall be included in the interested timer ISR (Interrupt Service Routine) file

Warning
If FH user would not increment the FH_GlobalTimeCounter in a timer ISR (Interrupt Service Routine) every 1 mili-second, the related commands (which require timing) will have malfunction
Attention
FH user could left this file intact but shall include FH_GlobalTimerCount.h in the interested timer ISR (Interrupt Service Routine) file

SPDX-License-Identifier: Apache-2.0

Copyright 2026 Vahid Hasirchi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

For more information refer to FreeHIL.com

Definition in file FH_GlobalTimerCount.c.

Function Documentation

◆ FH_Reset_GlobalTimeCounter()

void FH_Reset_GlobalTimeCounter ( )

This function resets the FH_GlobalTimeCounter if need be
FH_GlobalTimeCounter here shall be incremented every 1 mili-second in an interested timer ISR (Interrupt Service Routine) by FH user
For this to happen, FH_GlobalTimerCount.h shall be included in the interested timer ISR (Interrupt Service Routine) file.

Parameters
None
Returns
None
Note
Since the mere heart beat of the FH code is FH_GlobalTimeCounter and it is getting incremented every 1 mili-second, it is normally required to reset it to start a new time calculation

Definition at line 64 of file FH_GlobalTimerCount.c.

References FH_GlobalTimeCounter.

Variable Documentation

◆ FH_GlobalTimeCounter

volatile uint32_t FH_GlobalTimeCounter = 0

There are a diverse range of different situations where a precise timing is a necessity
To have a general heart beat (1 mili-second) for all different parts of the code, a timer in the micro-controller on which FH source code is ported, shall be utilized
FH_GlobalTimeCounter here shall be incremented every 1 mili-second in an interested timer ISR (Interrupt Service Routine) by FH user
For this to happen, FH_GlobalTimerCount.h shall be included in the interested timer ISR (Interrupt Service Routine) file

Warning
If FH user would not increment the FH_GlobalTimeCounter in a timer ISR (Interrupt Service Routine) every 1 mili-second, the related commands (which require timing) will have malfunction

Definition at line 48 of file FH_GlobalTimerCount.c.

Referenced by FH_CAN_ReceiveW_CAN01(), FH_CAN_ReceiveW_CAN02(), FH_CAN_ReceiveW_CAN03(), FH_CAN_ReceiveW_CAN04(), FH_CAN_ReceiveW_CAN05(), FH_CAN_ReceiveW_CAN06(), FH_CAN_ReceiveW_CAN07(), FH_CAN_ReceiveW_CAN08(), FH_Reset_GlobalTimeCounter(), FH_RFCommunication_Receive(), FH_UART_ReceiveW_UART01(), FH_UART_ReceiveW_UART02(), FH_UART_ReceiveW_UART03(), FH_UART_ReceiveW_UART04(), FH_UART_ReceiveW_UART05(), FH_UART_ReceiveW_UART06(), FH_UART_ReceiveW_UART07(), and FH_UART_ReceiveW_UART08().