Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

OTA - Add private function to free buffers for unhandled events #2025

Merged
merged 4 commits into from
May 21, 2020

Conversation

pvyawaha
Copy link
Contributor

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:

  • I have tested my changes. No regression in existing tests.
  • My code is Linted.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pvyawaha pvyawaha self-assigned this May 21, 2020
*
* 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,
Copy link
Contributor

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 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it

Copy link
Contributor Author

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.

Copy link
Contributor

@gkwicker gkwicker left a 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 )
Copy link
Contributor

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.

Copy link
Contributor Author

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,
Copy link
Contributor

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" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider configASSERT( pxEventMsg );

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in ec0eaa3

Copy link
Contributor

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" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@pvyawaha pvyawaha merged commit 3149505 into master May 21, 2020
@pvyawaha pvyawaha deleted the ota/fix_late_callback_event_handling branch May 21, 2020 21:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants