Create a function that simulates configuring a hardware timer.
The function must:
The effective timer frequency is calculated as:
effectiveFrequency = frequency / prescaler
In main():
frequency and modemode == 0:mode == 1:Example 1
Input:
1000 0Output:
1000
Example 2
Input:
1000 1 4Output:
250
Constraints:
frequency > 0prescaler > 0prescaler
Input
1000 0
Expected Output
1000