chopstx_poll: Use const pointer for the third argument.

This commit is contained in:
NIIBE Yutaka
2017-11-16 09:15:03 +09:00
parent 621dff7cb3
commit 3552fc5615
5 changed files with 13 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
2017-11-16 NIIBE Yutaka <gniibe@fsij.org> 2017-11-16 NIIBE Yutaka <gniibe@fsij.org>
* chopstx.h (chopstx_poll): API change.
* chopstx.c (chopstx_poll): Use const pointer.
* chopstx-cortex-m.c (idle): Support WFE. * chopstx-cortex-m.c (idle): Support WFE.
* mcu/usb-stm32f103.c (usb_lld_init): Use event. * mcu/usb-stm32f103.c (usb_lld_init): Use event.
* usb_lld.h (INTR_REQ_USB_WAKEUP): Remove. * usb_lld.h (INTR_REQ_USB_WAKEUP): Remove.

6
NEWS
View File

@@ -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 board with no RESET pin cannot be debugged by JTAG/SWD. Setting of
DBGMCU_CR (0xE0042004) is required beforehand (default is zero). 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 ** USB API changes
INTR_REQ_USB is now defined by usb_lld.h. Enumeration type of INTR_REQ_USB is now defined by usb_lld.h. Enumeration type of
DEVICE_STATE now has USB_DEVICE_STATE_ prefix. DEVICE_STATE now has USB_DEVICE_STATE_ prefix.

View File

@@ -346,4 +346,5 @@ chopstx_create_arch (uintptr_t stack_addr, size_t stack_size,
void void
chx_sleep_mode (int enable_sleep) chx_sleep_mode (int enable_sleep)
{ {
(void)enable_sleep;
} }

View File

@@ -1322,7 +1322,7 @@ chx_proxy_init (struct chx_px *px, uint32_t *cp)
* Returns number of active descriptors. * Returns number of active descriptors.
*/ */
int 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; uint32_t counter = 0;
int i; int i;

View File

@@ -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 */ 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); int chopstx_conf_idle (int enable_sleep);