diff options
| author | Sebastian Plamauer <oeplse@gmail.com> | 2016-10-31 20:18:39 +0100 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2016-12-19 13:03:50 -0800 |
| commit | 1598e44231a9ea2dbf20f487fcd05ded90e80d9a (patch) | |
| tree | 2020360e16b0a59b3207838274b5159ac9fe3b73 /stmhal | |
| parent | af17b64a58a421342ebad876b81ab68b91c13473 (diff) | |
atmel-samd: Add preliminary support for UART
Diffstat (limited to 'stmhal')
| -rw-r--r-- | stmhal/can.c | 2 | ||||
| -rw-r--r-- | stmhal/modnwcc3k.c | 2 | ||||
| -rw-r--r-- | stmhal/moduselect.c | 2 | ||||
| -rw-r--r-- | stmhal/pybioctl.h | 8 | ||||
| -rw-r--r-- | stmhal/uart.c | 4 | ||||
| -rw-r--r-- | stmhal/usb.c | 2 |
6 files changed, 6 insertions, 14 deletions
diff --git a/stmhal/can.c b/stmhal/can.c index 88d66b653..8bb008bc6 100644 --- a/stmhal/can.c +++ b/stmhal/can.c @@ -28,6 +28,7 @@ #include <string.h> #include <stdarg.h> +#include "py/ioctl.h" #include "py/nlr.h" #include "py/objtuple.h" #include "py/runtime.h" @@ -36,7 +37,6 @@ #include "py/mphal.h" #include "bufhelper.h" #include "can.h" -#include "pybioctl.h" #include "irq.h" #if MICROPY_HW_ENABLE_CAN diff --git a/stmhal/modnwcc3k.c b/stmhal/modnwcc3k.c index 591057602..936404e5f 100644 --- a/stmhal/modnwcc3k.c +++ b/stmhal/modnwcc3k.c @@ -30,6 +30,7 @@ // CC3000 defines its own ENOBUFS (different to standard one!) #undef ENOBUFS +#include "py/ioctl.h" #include "py/nlr.h" #include "py/objtuple.h" #include "py/objlist.h" @@ -41,7 +42,6 @@ #include "pin.h" #include "genhdr/pins.h" #include "spi.h" -#include "pybioctl.h" #include "hci.h" #include "socket.h" diff --git a/stmhal/moduselect.c b/stmhal/moduselect.c index 0d76953c6..97e2f4417 100644 --- a/stmhal/moduselect.c +++ b/stmhal/moduselect.c @@ -26,12 +26,12 @@ #include <stdio.h> +#include "py/ioctl.h" #include "py/runtime.h" #include "py/obj.h" #include "py/objlist.h" #include "py/mperrno.h" #include "py/mphal.h" -#include "pybioctl.h" // Flags for poll() #define FLAG_ONESHOT (1) diff --git a/stmhal/pybioctl.h b/stmhal/pybioctl.h deleted file mode 100644 index b71e04ed5..000000000 --- a/stmhal/pybioctl.h +++ /dev/null @@ -1,8 +0,0 @@ -#define MP_IOCTL_POLL (0x100 | 1) - -// These values are compatible with Linux, which are in turn -// compatible with iBCS2 spec. -#define MP_IOCTL_POLL_RD (0x0001) -#define MP_IOCTL_POLL_WR (0x0004) -#define MP_IOCTL_POLL_ERR (0x0008) -#define MP_IOCTL_POLL_HUP (0x0010) diff --git a/stmhal/uart.c b/stmhal/uart.c index cbcb7c059..a485f4463 100644 --- a/stmhal/uart.c +++ b/stmhal/uart.c @@ -28,13 +28,13 @@ #include <string.h> #include <stdarg.h> +#include "py/ioctl.h" #include "py/nlr.h" #include "py/runtime.h" #include "py/stream.h" #include "py/mperrno.h" #include "py/mphal.h" #include "uart.h" -#include "pybioctl.h" #include "irq.h" //TODO: Add UART7/8 support for MCU_SERIES_F7 @@ -563,7 +563,7 @@ STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, mp_uint_t n_args, con self->read_buf_len = args.read_buf_len.u_int + 1; // +1 to adjust for usable length of buffer self->read_buf = m_new(byte, self->read_buf_len << self->char_width); __HAL_UART_ENABLE_IT(&self->uart, UART_IT_RXNE); - HAL_NVIC_SetPriority(self->irqn, IRQ_PRI_UART, IRQ_SUBPRI_UART); + HAL_NVIC_SetPriority(self->irqn, IRQ_PRI_UART, IRQ_SUBPRI_UART); HAL_NVIC_EnableIRQ(self->irqn); } diff --git a/stmhal/usb.c b/stmhal/usb.c index 4eb67a8ca..21f718bc9 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -34,13 +34,13 @@ #include "usbd_msc_storage.h" #include "usbd_hid_interface.h" +#include "py/ioctl.h" #include "py/objstr.h" #include "py/runtime.h" #include "py/stream.h" #include "py/mperrno.h" #include "bufhelper.h" #include "usb.h" -#include "pybioctl.h" #if defined(USE_USB_FS) #define USB_PHY_ID USB_PHY_FS_ID |
