Skip to content

Commit 2c5d982

Browse files
committed
RPC: Update examples.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent 024cf36 commit 2c5d982

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

libraries/RPC/examples/Basic_AddSub/Basic_AddSub.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void setup() {
1717
RPC.begin();
1818
RPC.bind("add", add);
1919
RPC.bind("sub", sub);
20-
if (HAL_GetCurrentCPUID() == CM7_CPUID) {
20+
if (RPC.cpu_id() == CM7_CPUID) {
2121
// Introduce a brief delay to allow the M4 sufficient time
2222
// to bind remote functions before invoking them.
2323
delay(100);
@@ -29,20 +29,20 @@ void loop() {
2929
static size_t loop_count = 0;
3030

3131
// 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) {
3333
digitalWrite(LEDG, LOW);
3434
delay(10);
3535
digitalWrite(LEDG, HIGH);
3636
delay(10);
3737
}
3838

3939
int res = RPC.call("add", 1, 2).as<int>();
40-
if (HAL_GetCurrentCPUID() == CM7_CPUID) {
40+
if (RPC.cpu_id() == CM7_CPUID) {
4141
Serial.println("add(1, 2) = " + String(res));
4242
}
4343

4444
res = RPC.call("sub", res, 1).as<int>();
45-
if (HAL_GetCurrentCPUID() == CM7_CPUID) {
45+
if (RPC.cpu_id() == CM7_CPUID) {
4646
Serial.println("sub(3, 1) = " + String(res));
4747
}
4848
delay(250);

libraries/RPC/examples/RPC_m4/RPC_m4.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Thread subtractThread;
1111
Note that the sketch has to be uploaded to both cores.
1212
**/
1313
String currentCPU() {
14-
if (HAL_GetCurrentCPUID() == CM7_CPUID) {
14+
if (RPC.cpu_id() == CM7_CPUID) {
1515
return "M7";
1616
} else {
1717
return "M4";

libraries/RPC/examples/SerialPassthrough_RPC/SerialPassthrough_RPC.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void setup() {
99
}
1010

1111
void loop() {
12-
if (HAL_GetCurrentCPUID() == CM4_CPUID) {
12+
if (RPC.cpu_id() == CM4_CPUID) {
1313
RPC.println("Printed from M4 core");
1414
delay(1000);
1515
} else {

0 commit comments

Comments
 (0)