|
发表于 2015-10-14 23:36:47
|
显示全部楼层
ymodem+rtt 编译时候提示
..\app\src\user_finsh_cmd.c(105): error: #167: argument of type "int" is incompatible with parameter of type "rt_device_t"
- void update(uint8_t argc, char **argv) {
- uint16_t size;
- char *recv_buff, c_file_size[11] = {0};
- struct rym_ctx rctx;
- rt_kprintf("Please select a update file and use Ymodem to send.\r\n");
- //serial_get_device()
- if (!rym_recv_on_device(&rctx,serial_get_device(),
- RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX, ymodem_on_begin, ymodem_on_data, NULL,
- RT_TICK_PER_SECOND)) {
- /* wait some time for terminal response finish */
- rt_thread_delay(RT_TICK_PER_SECOND);
- /* set need copy application from backup section flag is 1, backup application length */
- ef_set_env("iap_need_copy_app", "1");
- rt_sprintf(c_file_size, "%ld", update_file_total_size);
- ef_set_env("iap_copy_app_size", c_file_size);
- ef_save_env();
- /* copy downloaded application to application entry */
- if (ef_erase_user_app(iap_get_app_addr(), update_file_total_size)
- || ef_copy_app_from_bak(iap_get_app_addr(), update_file_total_size)) {
- rt_kprintf("Update user app fail.\n");
- } else {
- rt_kprintf("Update user app success.\n");
- }
- /* clean need copy application from backup section flag */
- ef_set_env("iap_need_copy_app", "0");
- ef_set_env("iap_copy_app_size", "0");
- ef_save_env();
- } else {
- /* wait some time for terminal response finish */
- rt_thread_delay(RT_TICK_PER_SECOND);
- rt_kprintf("Update user app fail.\n");
- }
- }
- MSH_CMD_EXPORT(update, Update user application);
复制代码
提示是 if (!rym_recv_on_device(&rctx,serial_get_device(),
RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX, ymodem_on_begin, ymodem_on_data, NULL,
RT_TICK_PER_SECOND))
不知道如何 解决。恳请楼主解答,谢谢 |
|