mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
9ded6db852
- the infinite timeout value is again represented by a special value (not a special timer ID), but this time it's a non-negative value - all timers in the UART module default to the system timer - all timers in the TMR module default to the system timer - implemented a generic system timer mechanism that can be used in conjunction with a timer interrupt. - implemented system timers on LM3S (tested) and STM32 (not tested). Both are based on the Cortex M3 SysTick timer.
29 lines
760 B
C
29 lines
760 B
C
// XMODEM for eLua
|
|
|
|
#ifndef __XMODEM_H__
|
|
#define __XMODEM_H__
|
|
|
|
#include "type.h"
|
|
#include "platform.h"
|
|
|
|
// XMODEM constants
|
|
#define XMODEM_INITIAL_BUFFER_SIZE 1024
|
|
#define XMODEM_INCREMENT_AMMOUNT 512
|
|
|
|
// xmodem timeout/retry parameters
|
|
#define XMODEM_TIMEOUT 1000000
|
|
#define XMODEM_RETRY_LIMIT 20
|
|
|
|
// error return codes
|
|
#define XMODEM_ERROR_REMOTECANCEL (-1)
|
|
#define XMODEM_ERROR_OUTOFSYNC (-2)
|
|
#define XMODEM_ERROR_RETRYEXCEED (-3)
|
|
#define XMODEM_ERROR_OUTOFMEM (-4)
|
|
|
|
typedef void ( *p_xm_send_func )( u8 );
|
|
typedef int ( *p_xm_recv_func )( timer_data_type );
|
|
long xmodem_receive( char** dest );
|
|
void xmodem_init( p_xm_send_func send_func, p_xm_recv_func recv_func );
|
|
|
|
#endif // #ifndef __XMODEM_H__
|