-
Notifications
You must be signed in to change notification settings - Fork 1.1k
OTA - Add private function to free buffers for unhandled events #2025
Conversation
…ix file close on OTA resume
* | ||
* If there is a valid job id, then a job status update will be sent. | ||
*/ | ||
* If the job context returned NULL and the image state is not in the self_test state, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these uncrustify related changes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes , they are with the latest config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
* Setting an arbitrarily large base of 0x10000 and masking off that base allows | ||
* us to do the same thing as a zero offset without the lint warnings of using a | ||
* null pointer. No structure is anywhere near 64K in size. | ||
*/ | ||
/*lint -emacro((923,9078),OFFSET_OF) Intentionally cast pointer to uint32_t because we are using it as an offset. */ | ||
|
||
#define OFFSET_OF( t, e ) ( ( uint32_t ) ( &( ( t * ) 0x10000UL )->e ) & 0xffffUL ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we reinventing offsetof()
? It is available in C89.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ec0eaa3
* | ||
* If there is a valid job id, then a job status update will be sent. | ||
*/ | ||
* If the job context returned NULL and the image state is not in the self_test state, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it
*/ | ||
static void prvHandleUnexpectedEvents( OTA_EventMsg_t * pxEventMsg ) | ||
{ | ||
DEFINE_OTA_METHOD_NAME( "prvHandleUnexpectedEvents" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider configASSERT( pxEventMsg );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in ec0eaa3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
*/ | ||
static void prvHandleUnexpectedEvents( OTA_EventMsg_t * pxEventMsg ) | ||
{ | ||
DEFINE_OTA_METHOD_NAME( "prvHandleUnexpectedEvents" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
The change add a private function to free buffers for unexpected job and data events. The change also fixes file close when OTA resumes.
Description
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.