add ota algorithm for device

1. effective "Differential Upgrade" patch algorithm with high compression rate
2. effective recovery algorithm support recovery firmware in blocks which has low memory consumption and wear-leveling strategies, especially suitable for embeded devices with low RAM.
3. add sample ota bootloader project, see:
board\TencentOS_tiny_EVB_MX_Plus\KEIL\ota\ota_bootloader_recovery
4. add sample application project for download firmware through http, see:
board\TencentOS_tiny_EVB_MX_Plus\KEIL\ota\ota_application_download_through_http
5. add sample application project for download firmware through qcloud explorer console, see:
board\TencentOS_tiny_EVB_MX_Plus\KEIL\ota\ota_application_download_through_qcloud_iot_explorer
6. an OTA markdown document is pending
This commit is contained in:
daishengdong
2020-06-02 15:03:42 +08:00
parent 84faf16765
commit 5b51d50ade
177 changed files with 42367 additions and 1233 deletions

View File

@@ -127,9 +127,7 @@ __API__ k_err_t tos_bin_heap_create(k_bin_heap_t *bin_heap, void *pool, size_t i
bin_heap->pool = (uint8_t *)pool;
TOS_OBJ_INIT(bin_heap, KNL_OBJ_TYPE_BINARY_HEAP);
#if TOS_CFG_MMHEAP_EN > 0u
knl_object_alloc_set_static(&bin_heap->knl_obj);
#endif
return K_ERR_NONE;
}
@@ -139,11 +137,9 @@ __API__ k_err_t tos_bin_heap_destroy(k_bin_heap_t *bin_heap)
TOS_PTR_SANITY_CHECK(bin_heap);
TOS_OBJ_VERIFY(bin_heap, KNL_OBJ_TYPE_BINARY_HEAP);
#if TOS_CFG_MMHEAP_EN > 0u
if (!knl_object_alloc_is_static(&bin_heap->knl_obj)) {
return K_ERR_OBJ_INVALID_ALLOC_TYPE;
}
#endif
bin_heap->total = 0;
bin_heap->cmp = K_NULL;
@@ -152,15 +148,11 @@ __API__ k_err_t tos_bin_heap_destroy(k_bin_heap_t *bin_heap)
bin_heap->pool = K_NULL;
TOS_OBJ_DEINIT(bin_heap);
#if TOS_CFG_MMHEAP_EN > 0u
knl_object_alloc_reset(&bin_heap->knl_obj);
#endif
return K_ERR_NONE;
}
#if TOS_CFG_MMHEAP_EN > 0u
__API__ k_err_t tos_bin_heap_create_dyn(k_bin_heap_t *bin_heap, size_t item_cnt, size_t item_size, k_bin_heap_cmp cmp)
{
void *pool;
@@ -208,8 +200,6 @@ __API__ k_err_t tos_bin_heap_destroy_dyn(k_bin_heap_t *bin_heap)
return K_ERR_NONE;
}
#endif
__API__ k_err_t tos_bin_heap_push(k_bin_heap_t *bin_heap, void *item, size_t item_size)
{
TOS_CPU_CPSR_ALLOC();
@@ -298,7 +288,7 @@ __API__ int tos_bin_heap_is_full(k_bin_heap_t *bin_heap)
TOS_OBJ_VERIFY_RC(bin_heap, KNL_OBJ_TYPE_BINARY_HEAP, K_FALSE);
TOS_CPU_INT_DISABLE();
is_full = (bin_heap->total == bin_heap->item_cnt);
is_full = (bin_heap->total == bin_heap->item_cnt ? K_TRUE : K_FALSE);
TOS_CPU_INT_ENABLE();
return is_full;