mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2026-08-27 17:01:31 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
63
Living_SDK/kernel/hal/ota.c
Normal file
63
Living_SDK/kernel/hal/ota.c
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <hal/hal.h>
|
||||
|
||||
static hal_ota_module_t *ota_module;
|
||||
|
||||
hal_ota_module_t *hal_ota_get_default_module(void)
|
||||
{
|
||||
return ota_module;
|
||||
}
|
||||
|
||||
void hal_ota_register_module(hal_ota_module_t *module)
|
||||
{
|
||||
ota_module = module;
|
||||
}
|
||||
|
||||
hal_stat_t hal_ota_init(void *something)
|
||||
{
|
||||
return ota_module->init(ota_module, something);
|
||||
}
|
||||
|
||||
hal_stat_t hal_ota_write(hal_ota_module_t *m, volatile uint32_t *off_set, uint8_t *in_buf , uint32_t in_buf_len)
|
||||
{
|
||||
if (m == NULL) {
|
||||
m = hal_ota_get_default_module();
|
||||
}
|
||||
|
||||
if (m != NULL && m->ota_write != NULL) {
|
||||
return m->ota_write(m, off_set, in_buf, in_buf_len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
hal_stat_t hal_ota_read(hal_ota_module_t *m, volatile uint32_t *off_set, uint8_t *out_buf, uint32_t out_buf_len)
|
||||
{
|
||||
if (m == NULL) {
|
||||
m = hal_ota_get_default_module();
|
||||
}
|
||||
|
||||
if (m != NULL && m->ota_read != NULL) {
|
||||
return m->ota_read(m, off_set, out_buf, out_buf_len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
hal_stat_t hal_ota_set_boot(hal_ota_module_t *m, void *something)
|
||||
{
|
||||
if (m == NULL) {
|
||||
m = hal_ota_get_default_module();
|
||||
}
|
||||
|
||||
if (m != NULL && m->ota_set_boot != NULL) {
|
||||
return m->ota_set_boot(m, something);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue