[Ymodem]When active end the session, It can config send CAN number.
This commit is contained in:
parent
521f24f109
commit
ed57c7c32a
|
@ -197,7 +197,7 @@ static rt_err_t _rym_do_trans(struct rym_ctx *ctx)
|
||||||
{
|
{
|
||||||
rt_err_t err;
|
rt_err_t err;
|
||||||
enum rym_code code;
|
enum rym_code code;
|
||||||
rt_size_t data_sz;
|
rt_size_t data_sz, i;
|
||||||
|
|
||||||
code = _rym_read_code(ctx,
|
code = _rym_read_code(ctx,
|
||||||
RYM_WAIT_PKG_TICK);
|
RYM_WAIT_PKG_TICK);
|
||||||
|
@ -223,8 +223,9 @@ static rt_err_t _rym_do_trans(struct rym_ctx *ctx)
|
||||||
{
|
{
|
||||||
case RYM_CODE_CAN:
|
case RYM_CODE_CAN:
|
||||||
/* the spec require multiple CAN */
|
/* the spec require multiple CAN */
|
||||||
_rym_putchar(ctx, RYM_CODE_CAN);
|
for (i = 0; i < RYM_END_SESSION_SEND_CAN_NUM; i++) {
|
||||||
_rym_putchar(ctx, RYM_CODE_CAN);
|
_rym_putchar(ctx, RYM_CODE_CAN);
|
||||||
|
}
|
||||||
return -RYM_ERR_CAN;
|
return -RYM_ERR_CAN;
|
||||||
case RYM_CODE_ACK:
|
case RYM_CODE_ACK:
|
||||||
_rym_putchar(ctx, RYM_CODE_ACK);
|
_rym_putchar(ctx, RYM_CODE_ACK);
|
||||||
|
|
|
@ -55,6 +55,9 @@ enum rym_code {
|
||||||
#define RYM_CHD_INTV_TICK (RT_TICK_PER_SECOND * 3)
|
#define RYM_CHD_INTV_TICK (RT_TICK_PER_SECOND * 3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* how many CAN be sent when user active end the session. */
|
||||||
|
#define RYM_END_SESSION_SEND_CAN_NUM 0x07
|
||||||
|
|
||||||
enum rym_stage {
|
enum rym_stage {
|
||||||
RYM_STAGE_NONE,
|
RYM_STAGE_NONE,
|
||||||
/* set when C is send */
|
/* set when C is send */
|
||||||
|
@ -129,7 +132,7 @@ struct rym_ctx
|
||||||
* second.
|
* second.
|
||||||
*/
|
*/
|
||||||
rt_err_t rym_recv_on_device(struct rym_ctx *ctx, rt_device_t dev,
|
rt_err_t rym_recv_on_device(struct rym_ctx *ctx, rt_device_t dev,
|
||||||
rym_callback on_begin, rym_callback on_data, rym_callback on_end,
|
rt_uint16_t oflag, rym_callback on_begin, rym_callback on_data,
|
||||||
int handshake_timeout);
|
rym_callback on_end, int handshake_timeout);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue