We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 12e9857 + 6427765 commit c8962d6Copy full SHA for c8962d6
1 file changed
cores/arduino/WMath.cpp
@@ -48,8 +48,14 @@ extern "C" {
48
static long trng()
49
{
50
uint32_t value[4];
51
- if (HW_SCE_McuSpecificInit() != FSP_SUCCESS)
52
- return -1;
+ static bool SCE_inited = false;
+ if (!SCE_inited) {
53
+ if (HW_SCE_McuSpecificInit() != FSP_SUCCESS) {
54
+ return -1;
55
+ }
56
+ SCE_inited = true;
57
58
+
59
HW_SCE_RNG_Read(value);
60
return (long)value[0] >= 0 ? value[0] : -value[0];
61
}
0 commit comments