File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ void setup() {
17
17
RPC.begin ();
18
18
RPC.bind (" add" , add);
19
19
RPC.bind (" sub" , sub);
20
- if (HAL_GetCurrentCPUID () == CM7_CPUID) {
20
+ if (RPC. cpu_id () == CM7_CPUID) {
21
21
// Introduce a brief delay to allow the M4 sufficient time
22
22
// to bind remote functions before invoking them.
23
23
delay (100 );
@@ -29,20 +29,20 @@ void loop() {
29
29
static size_t loop_count = 0 ;
30
30
31
31
// Blink every 512 iterations
32
- if (HAL_GetCurrentCPUID () == CM4_CPUID && (loop_count++ % 512 ) == 0 ) {
32
+ if (RPC. cpu_id () == CM4_CPUID && (loop_count++ % 512 ) == 0 ) {
33
33
digitalWrite (LEDG, LOW);
34
34
delay (10 );
35
35
digitalWrite (LEDG, HIGH);
36
36
delay (10 );
37
37
}
38
38
39
39
int res = RPC.call (" add" , 1 , 2 ).as <int >();
40
- if (HAL_GetCurrentCPUID () == CM7_CPUID) {
40
+ if (RPC. cpu_id () == CM7_CPUID) {
41
41
Serial.println (" add(1, 2) = " + String (res));
42
42
}
43
43
44
44
res = RPC.call (" sub" , res, 1 ).as <int >();
45
- if (HAL_GetCurrentCPUID () == CM7_CPUID) {
45
+ if (RPC. cpu_id () == CM7_CPUID) {
46
46
Serial.println (" sub(3, 1) = " + String (res));
47
47
}
48
48
delay (250 );
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Thread subtractThread;
11
11
Note that the sketch has to be uploaded to both cores.
12
12
**/
13
13
String currentCPU () {
14
- if (HAL_GetCurrentCPUID () == CM7_CPUID) {
14
+ if (RPC. cpu_id () == CM7_CPUID) {
15
15
return " M7" ;
16
16
} else {
17
17
return " M4" ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ void setup() {
9
9
}
10
10
11
11
void loop () {
12
- if (HAL_GetCurrentCPUID () == CM4_CPUID) {
12
+ if (RPC. cpu_id () == CM4_CPUID) {
13
13
RPC.println (" Printed from M4 core" );
14
14
delay (1000 );
15
15
} else {
You can’t perform that action at this time.
0 commit comments