diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-05-09 11:44:11 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-05-09 11:44:11 +0300 |
| commit | d84b6c4fff9cbf40263140a522fca3ae6bdfd57c (patch) | |
| tree | 0c177f5f904e3dff11278aca4c642b5f78378a44 /Software/Embedded_SW/Embedded/Modules | |
| parent | 706b7f128efe759c7f8efe5379b572aca45e8c7e (diff) | |
| download | Tango-d84b6c4fff9cbf40263140a522fca3ae6bdfd57c.tar.gz Tango-d84b6c4fff9cbf40263140a522fca3ae6bdfd57c.zip | |
update FPGA_Comm.h + Add timeout for busy SPI
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c index e7b75cc9d..deb5cbf75 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c @@ -563,7 +563,17 @@ void Stub_MotorMovRequest(MessageContainer* requestContainer) response.position = Get_Param(x_ABS_POS); response.has_position = true; - while(SSIBusy(SSI2_BASE)){}; + //while(SSIBusy(SSI2_BASE)){}; + uint32_t timeout = SSI_SPI_TIMEOUT; + + while(SSIBusy(SSI2_BASE)) + { + timeout = timeout--; + if(timeout == 0) + { + return ERROR; + } + } read_status = Get_and_Clear_Status(); |
