@@ -21,7 +21,7 @@ static enum rym_code _rym_bg(
2121 struct custom_ctx * cctx = (struct custom_ctx * )ctx ;
2222 cctx -> fpath [0 ] = '/' ;
2323 /* the buf should be the file name */
24- strcpy (& (cctx -> fpath [1 ]), buf );
24+ strcpy (& (cctx -> fpath [1 ]), ( const char * ) buf );
2525 cctx -> fd = open (cctx -> fpath , O_CREAT | O_WRONLY | O_TRUNC , 0 );
2626 if (cctx -> fd < 0 )
2727 {
@@ -31,7 +31,7 @@ static enum rym_code _rym_bg(
3131 return RYM_CODE_CAN ;
3232 }
3333
34- cctx -> flen = atoi (buf + strlen (buf )+ 1 );
34+ cctx -> flen = atoi (( const char * ) buf + strlen (( const char * ) buf )+ 1 );
3535 if (cctx -> flen == 0 )
3636 cctx -> flen = -1 ;
3737 return RYM_CODE_ACK ;
@@ -80,8 +80,8 @@ rt_err_t rym_write_to_file(rt_device_t idev)
8080
8181 rt_kprintf ("entering RYM mode\n" );
8282
83- res = rym_recv_on_device (& ctx -> parent , idev ,
84- _rym_bg , _rym_tof , _rym_end , 1000 );
83+ res = rym_recv_on_device (& ctx -> parent , idev , RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX ,
84+ _rym_bg , _rym_tof , _rym_end , 1000 );
8585
8686 /* there is no Ymodem traffic on the line so print out info. */
8787 rt_kprintf ("leaving RYM mode with code %d\n" , res );
0 commit comments