OP-1483 Added velocity filter to correct EKF's velocity estimate for static velocity...
[librepilot.git] / flight / templates / firmware_info.c.template
blob4fe8842f3272232b666cd4f57b6e6790b6c2a516
1 /**
2  ******************************************************************************
3  *
4  * @file       ${OUTFILENAME}
5  * @author     The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
6  * @brief      Firmware version info file autogenerated using template
7  *             ${TEMPLATE}
8  *
9  * @see        The GNU Public License (GPL) Version 3
10  *
11  *****************************************************************************/
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, write to the Free Software Foundation, Inc.,
25  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  */
28 #include <stdint.h>
30 /**
31  * We have 100 bytes for the whole description.
32  *
33  * Structure is:
34  *   4 bytes: header: "OpFw".
35  *   4 bytes: GIT commit tag (short version of SHA1).
36  *   4 bytes: Unix timestamp of compile time.
37  *   2 bytes: target platform. Should follow same rule as BOARD_TYPE and BOARD_REVISION in board define files.
38  *  26 bytes: commit tag if it is there, otherwise branch name. '-dirty' may be added if needed. Zero-padded.
39  *  20 bytes: SHA1 sum of the firmware.
40  *  20 bytes: SHA1 sum of the uavo definitions.
41  *  20 bytes: free for now.
42  *
43  */
45 struct __attribute__((packed)) fw_version_info {
46     uint8_t magic[4];
47     uint32_t commit_hash_prefix;
48     uint32_t timestamp;
49     uint8_t board_type;
50     uint8_t board_revision;
51     uint8_t commit_tag_name[26];
52     uint8_t sha1sum[20];
53     uint8_t uavosha1[20];
54     uint8_t pad[20];
57 #if (defined(__MACH__) && defined(__APPLE__))
58 const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__((__section__("__TEXT,.fw_version_blob"))) = {
59 #else
60 const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__((__section__(".fw_version_blob"))) = {
61 #endif
62     .magic              = { 'O','p','F','w' },
63     .commit_hash_prefix = 0x${HASH8},
64     .timestamp          = ${UNIXTIME},
65     .board_type         = ${BOARD_TYPE},
66     .board_revision     = ${BOARD_REVISION},
67     .commit_tag_name    = "${FWTAG}",
68     .sha1sum            = { ${IMAGE_HASH_ARRAY} },
69     .uavosha1           = { ${UAVO_HASH_ARRAY} },