2022-04-28 09:21:17 -04:00
|
|
|
#
|
|
|
|
# definitions
|
|
|
|
#
|
2023-01-13 07:28:15 -05:00
|
|
|
MACHINE_RA4M1_CLICKER = "RA4M1 CLICKER with RA4M1"
|
|
|
|
MACHINE_EK_RA4M1 = "EK-RA4M1 with RA4M1"
|
|
|
|
MACHINE_EK_RA4W1 = "EK-RA4W1 with RA4W1"
|
|
|
|
MACHINE_EK_RA6M1 = "EK-RA6M1 with RA6M1"
|
|
|
|
MACHINE_EK_RA6M2 = "EK-RA6M2 with RA6M2"
|
2022-04-28 09:21:17 -04:00
|
|
|
SYSCLK_RA4M1_CLICKER = 48000000
|
2023-01-13 07:28:15 -05:00
|
|
|
SYSCLK_EK_RA4M1 = 48000000
|
|
|
|
SYSCLK_EK_RA4W1 = 48000000
|
|
|
|
SYSCLK_EK_RA6M1 = 120000000
|
|
|
|
SYSCLK_EK_RA6M2 = 120000000
|
2022-04-28 09:21:17 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# machine
|
|
|
|
#
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
try:
|
|
|
|
import machine
|
2022-08-18 02:57:45 -04:00
|
|
|
except ImportError:
|
2022-04-28 09:21:17 -04:00
|
|
|
print("machine module is not found")
|
|
|
|
raise SystemExit
|
|
|
|
|
|
|
|
m = os.uname().machine
|
|
|
|
f = machine.freq()
|
|
|
|
|
|
|
|
if m == MACHINE_RA4M1_CLICKER:
|
|
|
|
if f == SYSCLK_RA4M1_CLICKER:
|
|
|
|
print("freq: OK")
|
|
|
|
else:
|
|
|
|
print("freq: NG")
|
|
|
|
|
|
|
|
|
2023-01-13 07:28:15 -05:00
|
|
|
if m == MACHINE_EK_RA4M1:
|
|
|
|
if f == SYSCLK_EK_RA4M1:
|
2022-04-28 09:21:17 -04:00
|
|
|
print("freq: OK")
|
|
|
|
else:
|
|
|
|
print("freq: NG")
|
|
|
|
|
2023-01-13 07:28:15 -05:00
|
|
|
if m == MACHINE_EK_RA4W1:
|
|
|
|
if f == SYSCLK_EK_RA4W1:
|
2022-04-28 09:21:17 -04:00
|
|
|
print("freq: OK")
|
|
|
|
else:
|
|
|
|
print("freq: NG")
|
|
|
|
|
2023-01-13 07:28:15 -05:00
|
|
|
if m == MACHINE_EK_RA6M1:
|
|
|
|
if f == SYSCLK_EK_RA6M1:
|
2022-04-28 09:21:17 -04:00
|
|
|
print("freq: OK")
|
|
|
|
else:
|
|
|
|
print("freq: NG")
|
|
|
|
|
2023-01-13 07:28:15 -05:00
|
|
|
if m == MACHINE_EK_RA6M2:
|
|
|
|
if f == SYSCLK_EK_RA6M2:
|
2022-04-28 09:21:17 -04:00
|
|
|
print("freq: OK")
|
|
|
|
else:
|
|
|
|
print("freq: NG")
|