Skip to content

Commit

Permalink
Rename GitHash parameter in version message to Hash. This is better t…
Browse files Browse the repository at this point in the history
…o be independent of Git (even if Git is currently used).
  • Loading branch information
breaker27 committed Feb 23, 2014
1 parent a4931ca commit 6ca0a3f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion firmware/shc_basestation/shc_basestation.c
Expand Up @@ -130,7 +130,7 @@ void decode_data(uint8_t len)
UART_PUTF("Major=%u;", msg_generic_version_get_major());
UART_PUTF("Minor=%u;", msg_generic_version_get_minor());
UART_PUTF("Patch=%u;", msg_generic_version_get_patch());
UART_PUTF("GitHash=%08lx;", msg_generic_version_get_githash());
UART_PUTF("Hash=%08lx;", msg_generic_version_get_hash());
break;

case MESSAGEID_GENERIC_BATTERYSTATUS:
Expand Down
2 changes: 1 addition & 1 deletion firmware/shc_dimmer/shc_dimmer.c
Expand Up @@ -255,7 +255,7 @@ void send_version_status(void)
msg_generic_version_set_major(VERSION_MAJOR);
msg_generic_version_set_minor(VERSION_MINOR);
msg_generic_version_set_patch(VERSION_PATCH);
msg_generic_version_set_githash(VERSION_HASH);
msg_generic_version_set_hash(VERSION_HASH);
pkg_header_calc_crc32();

rfm12_sendbuf();
Expand Down
2 changes: 1 addition & 1 deletion firmware/shc_powerswitch/shc_powerswitch.c
Expand Up @@ -120,7 +120,7 @@ void send_version_status(void)
msg_generic_version_set_major(VERSION_MAJOR);
msg_generic_version_set_minor(VERSION_MINOR);
msg_generic_version_set_patch(VERSION_PATCH);
msg_generic_version_set_githash(VERSION_HASH);
msg_generic_version_set_hash(VERSION_HASH);
pkg_header_calc_crc32();

rfm12_sendbuf();
Expand Down
2 changes: 1 addition & 1 deletion firmware/shc_tempsensor/shc_tempsensor.c
Expand Up @@ -221,7 +221,7 @@ int main(void)
msg_generic_version_set_major(VERSION_MAJOR);
msg_generic_version_set_minor(VERSION_MINOR);
msg_generic_version_set_patch(VERSION_PATCH);
msg_generic_version_set_githash(VERSION_HASH);
msg_generic_version_set_hash(VERSION_HASH);
pkg_header_calc_crc32();

UART_PUTF4("Version: v%u.%u.%u (%08lx)\r\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_HASH);
Expand Down
14 changes: 7 additions & 7 deletions firmware/src_common/msggrp_generic.h
Expand Up @@ -53,7 +53,7 @@ typedef enum {
// Possible MessageTypes: Get, Status, AckStatus
// Validity: test
// Length w/o Header + HeaderExtension: 56 bits
// Data fields: Major, Minor, Patch, GitHash
// Data fields: Major, Minor, Patch, Hash
// Description: Reports the current firmware version. Version information is only available when set in source code, which is usually only done for official builds by the build robot.

// Function to initialize header for the MessageType "Get".
Expand Down Expand Up @@ -143,19 +143,19 @@ static inline uint32_t msg_generic_version_get_patch(void)
return array_read_UIntValue32(((uint16_t)__HEADEROFFSETBITS + 16) / 8, ((uint16_t)__HEADEROFFSETBITS + 16) % 8, 8, 0, 255, bufx);
}

// GitHash (UIntValue)
// Description: The beginning of the revision ID hash as reported by Git.
// Hash (UIntValue)
// Description: The beginning of the revision ID hash (as reported by Git).

// Set GitHash (UIntValue)
// Set Hash (UIntValue)
// Offset: ((uint16_t)__HEADEROFFSETBITS + 24) / 8, ((uint16_t)__HEADEROFFSETBITS + 24) % 8, length bits 32, min val 0, max val 4294967295
static inline void msg_generic_version_set_githash(uint32_t val)
static inline void msg_generic_version_set_hash(uint32_t val)
{
array_write_UIntValue(((uint16_t)__HEADEROFFSETBITS + 24) / 8, ((uint16_t)__HEADEROFFSETBITS + 24) % 8, 32, val, bufx);
}

// Get GitHash (UIntValue)
// Get Hash (UIntValue)
// Offset: ((uint16_t)__HEADEROFFSETBITS + 24) / 8, ((uint16_t)__HEADEROFFSETBITS + 24) % 8, length bits 32, min val 0, max val 4294967295
static inline uint32_t msg_generic_version_get_githash(void)
static inline uint32_t msg_generic_version_get_hash(void)
{
return array_read_UIntValue32(((uint16_t)__HEADEROFFSETBITS + 24) / 8, ((uint16_t)__HEADEROFFSETBITS + 24) % 8, 32, 0, 4294967295, bufx);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/shc_e2p_editor/packet_layout.xml
Expand Up @@ -213,8 +213,8 @@
<MaxVal>255</MaxVal>
</UIntValue>
<UIntValue>
<ID>GitHash</ID>
<Description>The beginning of the revision ID hash as reported by Git.</Description>
<ID>Hash</ID>
<Description>The beginning of the revision ID hash (as reported by Git).</Description>
<Bits>32</Bits>
<MinVal>0</MinVal>
<MaxVal>4294967295</MaxVal>
Expand Down

0 comments on commit 6ca0a3f

Please sign in to comment.