|
|
@ -1,9 +1,9 @@ |
|
|
|
#include "sn.h" |
|
|
|
|
|
|
|
#include <stdbool.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#include <string.h> |
|
|
|
#include <stdio.h> |
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* EXTERN * |
|
|
@ -15,15 +15,15 @@ sn_t* xs_device_info_get() { // |
|
|
|
sn_t* info = (sn_t*)DEVICE_INFO_START_ADD; |
|
|
|
m_sn = *info; |
|
|
|
|
|
|
|
if (m_sn.year < 0) { |
|
|
|
if (m_sn.year == 255) { |
|
|
|
m_sn.year = 0; |
|
|
|
} |
|
|
|
|
|
|
|
if (m_sn.weak < 0) { |
|
|
|
if (m_sn.weak == 255) { |
|
|
|
m_sn.weak = 0; |
|
|
|
} |
|
|
|
|
|
|
|
if (m_sn.index < 0) { |
|
|
|
if (m_sn.index == 65535) { |
|
|
|
m_sn.index = 0; |
|
|
|
} |
|
|
|
|
|
|
@ -34,7 +34,6 @@ const char* sn_get_str() { |
|
|
|
sn_t* info = xs_device_info_get(); |
|
|
|
static char sn_str[32]; |
|
|
|
|
|
|
|
|
|
|
|
sprintf(sn_str, "%s%02d%02d%04d", "SN", info->year, info->weak, info->index); |
|
|
|
return sn_str; |
|
|
|
} |