Fixed flusing on slip-arch too
#include "uarte-arch.h"
#include "usb.h"
/*---------------------------------------------------------------------------*/
+#if PLAFTORM_SLIP_ARCH_CONF_USB
+#define set_input(fn) usb_set_input(fn)
+#define write_byte(b) usb_write((uint8_t *)&b, sizeof(uint8_t))
+#define flush() usb_flush()
+#else /* PLATFORM_DBG_CONF_USB */
+#define set_input(fn) uarte_set_input(fn)
+#define write_byte(b) uarte_write(b)
+#define flush()
+#endif /* PLATFORM_DBG_CONF_USB */
+#define SLIP_END 0300
+/*---------------------------------------------------------------------------*/
void
slip_arch_writeb(unsigned char c)
{
-#if PLATFORM_DBG_CONF_USB
- usb_write(&c, sizeof(c));
-#else /* PLATFORM_DBG_CONF_USB */
- uarte_write(c);
-#endif /* PLATFORM_DBG_CONF_USB */
+ write_byte(c);
+ if(c == SLIP_END) {
+ flush();
+ }
}
/*---------------------------------------------------------------------------*/
void
slip_arch_init()
{
-#if PLAFTORM_SLIP_ARCH_CONF_USB
- usb_set_input(slip_input_byte);
-#else /* PLAFTORM_SLIP_ARCH_CONF_USB */
- uarte_set_input(slip_input_byte);
-#endif /* PLAFTORM_SLIP_ARCH_CONF_USB */
+ set_input(slip_input_byte);
}
/*---------------------------------------------------------------------------*/
