diff --git a/ChangeLog b/ChangeLog index af86d2d..89717f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-11-16 NIIBE Yutaka + * chopstx.h (chopstx_poll): API change. + * chopstx.c (chopstx_poll): Use const pointer. + * chopstx-cortex-m.c (idle): Support WFE. * mcu/usb-stm32f103.c (usb_lld_init): Use event. * usb_lld.h (INTR_REQ_USB_WAKEUP): Remove. diff --git a/NEWS b/NEWS index 5e102fc..b77df79 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,12 @@ sleep by this feature requires careful preparation. Enabling sleep, a board with no RESET pin cannot be debugged by JTAG/SWD. Setting of DBGMCU_CR (0xE0042004) is required beforehand (default is zero). +** API change: chopstx_poll +This is a kind of clarification. The third argument is now an array +of constant pointers. We don't touch the array itself, just use it. +This allows having the array in read-only memory and can contribute +less use of RAM. + ** USB API changes INTR_REQ_USB is now defined by usb_lld.h. Enumeration type of DEVICE_STATE now has USB_DEVICE_STATE_ prefix. diff --git a/chopstx-gnu-linux.c b/chopstx-gnu-linux.c index 32329ca..9392292 100644 --- a/chopstx-gnu-linux.c +++ b/chopstx-gnu-linux.c @@ -346,4 +346,5 @@ chopstx_create_arch (uintptr_t stack_addr, size_t stack_size, void chx_sleep_mode (int enable_sleep) { + (void)enable_sleep; } diff --git a/chopstx.c b/chopstx.c index 31a0d0c..93aaf41 100644 --- a/chopstx.c +++ b/chopstx.c @@ -1322,7 +1322,7 @@ chx_proxy_init (struct chx_px *px, uint32_t *cp) * Returns number of active descriptors. */ int -chopstx_poll (uint32_t *usec_p, int n, struct chx_poll_head *pd_array[]) +chopstx_poll (uint32_t *usec_p, int n, struct chx_poll_head *const pd_array[]) { uint32_t counter = 0; int i; diff --git a/chopstx.h b/chopstx.h index 5c7bd88..64e9557 100644 --- a/chopstx.h +++ b/chopstx.h @@ -158,7 +158,8 @@ void chopstx_claim_irq (chopstx_intr_t *intr, uint8_t irq_num); void chopstx_intr_wait (chopstx_intr_t *intr); /* DEPRECATED */ -int chopstx_poll (uint32_t *usec_p, int n, struct chx_poll_head *pd_array[]); +int chopstx_poll (uint32_t *usec_p, int n, + struct chx_poll_head *const pd_array[]); int chopstx_conf_idle (int enable_sleep);