File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Thread subtractThread;
1111 Note that the sketch has to be uploaded to both cores.
1212 **/
1313String currentCPU () {
14- if (HAL_GetCurrentCPUID () == CM7_CPUID) {
14+ if (RPC. cpu_id () == CM7_CPUID) {
1515 return " M7" ;
1616 } else {
1717 return " M4" ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ void setup() {
99}
1010
1111void 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 {
You can’t perform that action at this time.
0 commit comments