pkarashchenko commented on a change in pull request #934: URL: https://github.com/apache/incubator-nuttx-apps/pull/934#discussion_r795209896
########## File path: examples/mcuboot/swap_test/version_main.c ########## @@ -0,0 +1,125 @@ +/**************************************************************************** + * apps/examples/mcuboot/swap_test/version_main.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> +#include <endian.h> + +#include <errno.h> +#include <stdio.h> + +#include <bootutil/bootutil_public.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define BOOT_HEADER_MAGIC_V1 0x96f3b83d +#define BOOT_HEADER_SIZE_V1 32 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +begin_packed_struct struct mcuboot_raw_header_v1_s +{ + uint32_t header_magic; + uint32_t image_load_address; + uint16_t header_size; + uint16_t pad; + uint32_t image_size; + uint32_t image_flags; + struct + { + uint8_t major; + uint8_t minor; + uint16_t revision; + uint32_t build_num; + } version; Review comment: ```suggestion begin_packed_struct struct { uint8_t major; uint8_t minor; uint16_t revision; uint32_t build_num; } end_packed_struct version; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
