1 #ifndef _ALI_DFU_PORT_H 2 #define _ALI_DFU_PORT_H 3 #include <stdbool.h> 4 5 #define DFU_IMAGE_SIZE_MAX 240*1024 6 7 void dfu_reboot(void); 8 unsigned char dfu_check_checksum(short image_id, unsigned short *crc16_output); 9 int ali_dfu_image_update(short signature, int offset, int length, int *p_void); 10 11 /** 12 * @brief get the current runing partition. 13 * @return the current runing partition. 14 */ 15 uint8_t get_program_image(void); 16 17 /** 18 * @brief switch the running partition, without reboot. 19 * @param[in] the partition which switch to. 20 * @return the runing partition when next boot. 21 */ 22 uint8_t change_program_image(uint8_t dfu_image); 23 24 int erase_dfu_flash(void); 25 26 #endif 27