From 1cb5ddbae0f81af4b1ba8a2b9268cc2b12a67202 Mon Sep 17 00:00:00 2001 From: 1nct Date: Tue, 2 Aug 2022 15:02:45 +0200 Subject: [PATCH] - Added long address svg - Direction is now preserved on packet timeout - Address > 127 can no longer be written to flash as it is not valid --- core0.c | 2 +- core1.c | 2 +- docs/svg/Long_address.svg | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 docs/svg/Long_address.svg diff --git a/core0.c b/core0.c index a63dc5a..741d6f4 100644 --- a/core0.c +++ b/core0.c @@ -129,7 +129,7 @@ void write_cv_handler(uint16_t cv_index, uint8_t cv_data){ switch (cv_index) { // CV_1 => Value = 0 is not allowed case 0: - if (cv_data == 0) break; + if (cv_data == 0 || cv_data > 127) break; // CV_7 & CV_8 are read-only // ADC offset Adjustment (CV_7; Value = 7); case 6: diff --git a/core1.c b/core1.c index 1f6edee..42ce5ac 100644 --- a/core1.c +++ b/core1.c @@ -304,7 +304,7 @@ void core1_entry() { // Check for time difference between last packet and current time (Packet Timeout) absolute_time_t current_time = get_absolute_time(); if (absolute_time_diff_us(time_last_update,current_time) > packet_timeout_threshold_in_us){ - update_speed_dir(pid,0); + update_speed_dir(pid,1 + 128*pid->direction); // Emergency stop on timeout } // If core0 sends new speed data to core1 speed_step_target and direction variables get updated if(multicore_fifo_rvalid()) { diff --git a/docs/svg/Long_address.svg b/docs/svg/Long_address.svg new file mode 100644 index 0000000..69f3706 --- /dev/null +++ b/docs/svg/Long_address.svg @@ -0,0 +1,4 @@ + + + +
CV_17 = {192, 231}
CV_17 = {192, 231}
CV_18 = {0, 255}
CV_18 = {0, 255}
215
215
214
214
213
213
212
212
211
211
210
210
29
29
28
28
27
27
26
26
25
25
24
24
23
23
22
22
21
21
20
20
1
1
1
1
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
Bit Weight
Bit Weight
Bit Value
Bit Value
Text is not SVG - cannot display
\ No newline at end of file