Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: CAN/function_CAN.cpp
- Revision:
- 192:637092202815
- Parent:
- 180:02be1711ee0b
- Child:
- 209:ebc69d6ee6f1
diff -r 9ca80cca68e3 -r 637092202815 CAN/function_CAN.cpp
--- a/CAN/function_CAN.cpp Fri Dec 18 00:58:54 2020 +0000
+++ b/CAN/function_CAN.cpp Fri Dec 18 05:44:16 2020 +0000
@@ -754,6 +754,11 @@
break;
}
+ case CRX_SET_CHANGE_EVERY_REFERNCE: {
+ flag_every_reference = 1;
+ break;
+ }
+
default:
break;
}
@@ -808,10 +813,18 @@
f_past[num_array_f_past-1] = torq.sen; //N
f_future[0] = torq.sen; //N
- for(int i=1; i<num_array_f_future-1; i++) {
- f_future[i] = f_future[i+1];
+
+ if(flag_every_reference == 1) {
+ for(int i=1; i<num_array_f_future-1; i++) {
+ f_future[i] = 500.0f;
+ }
+ f_future[num_array_f_future-1] = 500.0f; //N
+ } else {
+ for(int i=1; i<num_array_f_future-1; i++) {
+ f_future[i] = f_future[i+1];
+ }
+ f_future[num_array_f_future-1] = torq.ref; //N
}
- f_future[num_array_f_future-1] = torq.ref; //N
} else if(address==CID_RX_REF_VALVE_POS) {