aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-11-08 14:35:29 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-11-08 14:35:29 +0200
commit3f48ba5fcac73aeb6510a7f7bb2e1d482585aeff (patch)
treec03287817d8fa17db2eb6ac8463898de26ba93a2 /Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
parent55dffe48de95cb51b3a1a30e2ffc4336ec3bb2b2 (diff)
downloadTango-3f48ba5fcac73aeb6510a7f7bb2e1d482585aeff.tar.gz
Tango-3f48ba5fcac73aeb6510a7f7bb2e1d482585aeff.zip
check and fix attmptthreadjogging handling
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index 1d310cf01..cdb726b5e 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -1621,22 +1621,26 @@ uint32_t AttemptThreadJoggingCallback(uint32_t index, uint32_t ReadValue)
responseContainer.has_error = true;
responseContainer.error = getJobError_to_ErrorCode(JobEndReason);
}
- SafeRemoveControlCallback(LoadingControlId, Thread_Load_Jog_ThreadStop );
+ SafeRemoveControlCallback(LoadingControlId, AttemptThreadJoggingCallback );
LoadingControlId = 0xFF;
- responseContainer = createContainer(MESSAGE_TYPE__AttemptThreadJoggingResponse, AttemptJoggingToken, true, &response, &attempt_thread_jogging_response__pack, &attempt_thread_jogging_response__get_packed_size);
- responseContainer.continuous = false;
- uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
- size_t container_size = message_container__pack(&responseContainer, container_buffer);
- my_free(responseContainer.data.data);
- SendChars((char*)container_buffer, container_size);
+ if (AttemptJoggingToken[0])
+ {
+ responseContainer = createContainer(MESSAGE_TYPE__AttemptThreadJoggingResponse, AttemptJoggingToken, true, &response, &attempt_thread_jogging_response__pack, &attempt_thread_jogging_response__get_packed_size);
+ responseContainer.continuous = false;
+ uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
+ size_t container_size = message_container__pack(&responseContainer, container_buffer);
+ my_free(responseContainer.data.data);
+ SendChars((char*)container_buffer, container_size);
+ }
return OK;
}
uint32_t AttemptThreadJoggingFunc(MessageContainer* requestContainer)
{
attemptJogCounter = 0;
- ustrncpy (AttemptJoggingToken, requestContainer->token,36);
+ if(requestContainer)
+ ustrncpy (AttemptJoggingToken, requestContainer->token,36);
Report("AttemptThreadJoggingFunc",__FILE__,__LINE__,0xFF,RpWarning,(int)ATTEMPT_JOG_TIMEOUT,0);
LoadingControlId = AddControlCallback("Load jog",AttemptThreadJoggingCallback, eOneSecond,TemplateDataReadCBFunction,0,0,0);
ThreadJoggingFunc(30);