summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Reeder2018-08-02 13:17:49 -0500
committerJason Reeder2018-08-02 13:31:59 -0500
commit7892557b0dbb4abead07dbbd85fc3e08874e651d (patch)
tree1d160e5cbaf5b91ced34b7bd80aa37b512e81b9d
parent6561a7652362fb16914f4b4007c35321da2d1b6c (diff)
downloadtida01555-7892557b0dbb4abead07dbbd85fc3e08874e651d.tar.gz
tida01555-7892557b0dbb4abead07dbbd85fc3e08874e651d.tar.xz
tida01555-7892557b0dbb4abead07dbbd85fc3e08874e651d.zip
Fixed a bug that could cause a lockup to occur
There was one handshake that did not use a temporary variable before checking the value in the while loop. Without the temporary variable the XIN instruction may place the value to be checked into a different core register than the one being checked. This commit adds a temporary variable in order to force the compiler to copy the value to the variable being checked by the while loop. All other while loops involving the XIN instruction already used this method. Signed-off-by: Jason Reeder <jreeder@ti.com>
-rw-r--r--PRU_ADS8688_Controller/PRU_ADS8688_Controller.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/PRU_ADS8688_Controller/PRU_ADS8688_Controller.c b/PRU_ADS8688_Controller/PRU_ADS8688_Controller.c
index 99adfbe..75cb40b 100644
--- a/PRU_ADS8688_Controller/PRU_ADS8688_Controller.c
+++ b/PRU_ADS8688_Controller/PRU_ADS8688_Controller.c
@@ -149,7 +149,8 @@ send_command(uint16_t continuous) {
149 149
150 /* Wait for SPI coprocessor to acknowledge the command */ 150 /* Wait for SPI coprocessor to acknowledge the command */
151 while (!(status & SEND_ACK_BIT)) { 151 while (!(status & SEND_ACK_BIT)) {
152 __xin(SCRATCHPAD_1, STATUS_REG, 0, status); 152 __xin(SCRATCHPAD_1, STATUS_REG, 0, temp);
153 status = temp;
153 } 154 }
154 155
155 /* Clear the start bit */ 156 /* Clear the start bit */