add more ota_err_code support for ota bootloader
This commit is contained in:
2
components/ota/common/env/ota_env.c
vendored
2
components/ota/common/env/ota_env.c
vendored
@@ -35,7 +35,7 @@ ota_err_t ota_env_init(ota_updt_type_t updt_type, uint32_t partition_addr, ota_f
|
||||
ota_partition_end(OTA_PARTITION_KV),
|
||||
(kv_flash_drv_t *)flash_drv,
|
||||
(kv_flash_prop_t *)flash_prop) != KV_ERR_NONE) {
|
||||
return OTA_ERR_KV_FAIL;
|
||||
return OTA_ERR_KV_INIT_FAIL;
|
||||
}
|
||||
|
||||
return OTA_ERR_NONE;
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "tos_kv.h"
|
||||
#include "ota_image.h"
|
||||
#include "ota_info.h"
|
||||
#include "ota_partition.h"
|
||||
|
||||
@@ -35,19 +34,19 @@ ota_img_vs_t ota_info_curr_version(void)
|
||||
return version;
|
||||
}
|
||||
|
||||
int ota_info_update(ota_img_vs_t new_version)
|
||||
ota_err_t ota_info_update(ota_img_vs_t new_version)
|
||||
{
|
||||
kv_err_t err;
|
||||
|
||||
err = tos_kv_del("new_version");
|
||||
if (err != KV_ERR_NONE && err != KV_ERR_NOT_EXIST) {
|
||||
return -1;
|
||||
return OTA_ERR_KV_DEL_FAIL;
|
||||
}
|
||||
|
||||
if (tos_kv_set("cur_version", &new_version, sizeof(ota_img_vs_t)) != KV_ERR_NONE) {
|
||||
return -1;
|
||||
return OTA_ERR_KV_SET_FAIL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return OTA_ERR_NONE;
|
||||
}
|
||||
|
||||
|
@@ -18,9 +18,12 @@
|
||||
#ifndef _OTA_INFO_H_
|
||||
#define _OTA_INFO_H_
|
||||
|
||||
#include "ota_err.h"
|
||||
#include "ota_image.h"
|
||||
|
||||
ota_img_vs_t ota_info_curr_version(void);
|
||||
|
||||
int ota_info_update(ota_img_vs_t new_version);
|
||||
ota_err_t ota_info_update(ota_img_vs_t new_version);
|
||||
|
||||
#endif /* _OTA_INFO_H_ */
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
static ota_pt_ctrl_t ctrl;
|
||||
|
||||
static int partitions_verify(ota_pt_t *pts, int n)
|
||||
static ota_err_t partitions_verify(ota_pt_t *pts, int n)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@@ -34,7 +34,7 @@ static int partitions_verify(ota_pt_t *pts, int n)
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return OTA_ERR_NONE;
|
||||
}
|
||||
|
||||
ota_err_t ota_partition_load(ota_updt_type_t updt_type, uint32_t partition_addr)
|
||||
|
Reference in New Issue
Block a user