mirror of
https://github.com/pine64/bl_iot_sdk.git
synced 2024-09-03 21:49:43 +00:00
bl_sys_time.c: adds null pointer checks and extra spaces cleanup
Signed-off-by: Jesus Velazquez <jesus.velazquez@gmail.com>
This commit is contained in:
parent
143f051b9c
commit
838ff4f832
@ -49,6 +49,10 @@ int bl_sys_time_get(uint64_t *epoch)
|
|||||||
{
|
{
|
||||||
int ms_diff;
|
int ms_diff;
|
||||||
|
|
||||||
|
if (!epoch) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (0 == epoch_time) {
|
if (0 == epoch_time) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -77,6 +81,10 @@ int bl_sys_time_sync_state(uint32_t *xTicksToJump)
|
|||||||
uint32_t deltaTickRtos;
|
uint32_t deltaTickRtos;
|
||||||
uint32_t deltaTickRtc;
|
uint32_t deltaTickRtc;
|
||||||
|
|
||||||
|
if (!xTicksToJump) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if(!sync_init){
|
if(!sync_init){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user