Skip to content

Commit 4f60299

Browse files
committed
Add external hook for CPU freq.
1 parent 5958591 commit 4f60299

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

cores/arduino/ard_sup/ap3_clock_sources.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ SOFTWARE.
2626

2727
bool enableBurstMode();
2828
bool disableBurstMode();
29+
uint32_t getCpuFreqMHz();
30+
31+
uint32_t cpuFreq = 48000000; //At POR core is 48MHz
2932

3033
#endif //_AP3_GPIO_H_

cores/arduino/ard_sup/clock/ap3_clock_sources.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ bool enableBurstMode(void)
1717
{
1818
return (false);
1919
}
20+
cpuFreq = 96000000;
2021
return (true);
2122
}
2223

@@ -36,5 +37,12 @@ bool disableBurstMode(void)
3637
{
3738
return (false);
3839
}
40+
cpuFreq = 48000000;
3941
return (true);
4042
}
43+
44+
//Returns the current core speed
45+
uint32_t getCpuFreqMHz(void)
46+
{
47+
return(cpuFreq);
48+
}

0 commit comments

Comments
 (0)