diff options
| author | Damien George | 2015-01-20 11:55:10 +0000 |
|---|---|---|
| committer | Damien George | 2015-01-20 11:55:10 +0000 |
| commit | 50912e7f5dc579fd2917537046793dfa30decadf (patch) | |
| tree | 541d6f7531d9d75e168fc914f226d15b4c7faf04 /stmhal | |
| parent | 640e0b221e972f9a2da2d870bf3fc5a93c18f0ec (diff) | |
py, unix, stmhal: Allow to compile with -Wshadow.
See issue #699.
Diffstat (limited to 'stmhal')
| -rw-r--r-- | stmhal/moduselect.c | 2 | ||||
| -rw-r--r-- | stmhal/pyexec.c | 4 | ||||
| -rw-r--r-- | stmhal/stm32f4xx_it.c | 8 | ||||
| -rw-r--r-- | stmhal/usbd_conf.c | 72 |
4 files changed, 43 insertions, 43 deletions
diff --git a/stmhal/moduselect.c b/stmhal/moduselect.c index 1adb6257f..67e4e2a28 100644 --- a/stmhal/moduselect.c +++ b/stmhal/moduselect.c @@ -240,7 +240,7 @@ STATIC mp_obj_t poll_poll(uint n_args, const mp_obj_t *args) { if (n_ready > 0 || (timeout != -1 && HAL_GetTick() - start_tick >= timeout)) { // one or more objects are ready, or we had a timeout mp_obj_list_t *ret_list = mp_obj_new_list(n_ready, NULL); - mp_uint_t n_ready = 0; + n_ready = 0; for (mp_uint_t i = 0; i < self->poll_map.alloc; ++i) { if (!MP_MAP_SLOT_IS_FILLED(&self->poll_map, i)) { continue; diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c index f4b8c10fd..761372109 100644 --- a/stmhal/pyexec.c +++ b/stmhal/pyexec.c @@ -365,7 +365,7 @@ friendly_repl_reset: while (mp_repl_continue_with_input(vstr_str(&line))) { vstr_add_char(&line, '\n'); - int ret = readline(&line, "... "); + ret = readline(&line, "... "); if (ret == CHAR_CTRL_C) { // cancel everything stdout_tx_str("\r\n"); @@ -380,7 +380,7 @@ friendly_repl_reset: if (lex == NULL) { printf("MemoryError\n"); } else { - int ret = parse_compile_execute(lex, MP_PARSE_SINGLE_INPUT, EXEC_FLAG_ALLOW_DEBUGGING | EXEC_FLAG_IS_REPL); + ret = parse_compile_execute(lex, MP_PARSE_SINGLE_INPUT, EXEC_FLAG_ALLOW_DEBUGGING | EXEC_FLAG_IS_REPL); if (ret & PYEXEC_FORCED_EXIT) { return ret; } diff --git a/stmhal/stm32f4xx_it.c b/stmhal/stm32f4xx_it.c index 17ca21f63..e54318e70 100644 --- a/stmhal/stm32f4xx_it.c +++ b/stmhal/stm32f4xx_it.c @@ -77,7 +77,7 @@ #include "storage.h" extern void __fatal_error(const char*); -extern PCD_HandleTypeDef hpcd; +extern PCD_HandleTypeDef pcd_handle; /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ @@ -205,7 +205,7 @@ void SysTick_Handler(void) { #if defined(OTG_XX_IRQHandler) void OTG_XX_IRQHandler(void) { - HAL_PCD_IRQHandler(&hpcd); + HAL_PCD_IRQHandler(&pcd_handle); } #endif @@ -217,7 +217,7 @@ void OTG_XX_IRQHandler(void) { #if defined(OTG_XX_WKUP_IRQHandler) void OTG_XX_WKUP_IRQHandler(void) { - if ((&hpcd)->Init.low_power_enable) { + if ((&pcd_handle)->Init.low_power_enable) { /* Reset SLEEPDEEP bit of Cortex System Control Register */ SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); @@ -244,7 +244,7 @@ void OTG_XX_WKUP_IRQHandler(void) { {} /* ungate PHY clock */ - __HAL_PCD_UNGATE_PHYCLOCK((&hpcd)); + __HAL_PCD_UNGATE_PHYCLOCK((&pcd_handle)); } #ifdef USE_USB_FS /* Clear EXTI pending Bit*/ diff --git a/stmhal/usbd_conf.c b/stmhal/usbd_conf.c index eddf1d626..e599b0ebf 100644 --- a/stmhal/usbd_conf.c +++ b/stmhal/usbd_conf.c @@ -37,7 +37,7 @@ /* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
-PCD_HandleTypeDef hpcd;
+PCD_HandleTypeDef pcd_handle;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -331,62 +331,62 @@ USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev) {
#ifdef USE_USB_FS
/*Set LL Driver parameters */
- hpcd.Instance = USB_OTG_FS;
- hpcd.Init.dev_endpoints = 4;
- hpcd.Init.use_dedicated_ep1 = 0;
- hpcd.Init.ep0_mps = 0x40;
- hpcd.Init.dma_enable = 0;
- hpcd.Init.low_power_enable = 0;
- hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;
- hpcd.Init.Sof_enable = 0;
- hpcd.Init.speed = PCD_SPEED_FULL;
+ pcd_handle.Instance = USB_OTG_FS;
+ pcd_handle.Init.dev_endpoints = 4;
+ pcd_handle.Init.use_dedicated_ep1 = 0;
+ pcd_handle.Init.ep0_mps = 0x40;
+ pcd_handle.Init.dma_enable = 0;
+ pcd_handle.Init.low_power_enable = 0;
+ pcd_handle.Init.phy_itface = PCD_PHY_EMBEDDED;
+ pcd_handle.Init.Sof_enable = 0;
+ pcd_handle.Init.speed = PCD_SPEED_FULL;
#if !defined(MICROPY_HW_USB_VBUS_DETECT_PIN)
- hpcd.Init.vbus_sensing_enable = 0; // No VBUS Sensing on USB0
+ pcd_handle.Init.vbus_sensing_enable = 0; // No VBUS Sensing on USB0
#else
- hpcd.Init.vbus_sensing_enable = 1;
+ pcd_handle.Init.vbus_sensing_enable = 1;
#endif
/* Link The driver to the stack */
- hpcd.pData = pdev;
- pdev->pData = &hpcd;
+ pcd_handle.pData = pdev;
+ pdev->pData = &pcd_handle;
/*Initialize LL Driver */
- HAL_PCD_Init(&hpcd);
+ HAL_PCD_Init(&pcd_handle);
- HAL_PCD_SetRxFiFo(&hpcd, 0x80);
- HAL_PCD_SetTxFiFo(&hpcd, 0, 0x20);
- HAL_PCD_SetTxFiFo(&hpcd, 1, 0x40);
- HAL_PCD_SetTxFiFo(&hpcd, 2, 0x20);
- HAL_PCD_SetTxFiFo(&hpcd, 3, 0x40);
+ HAL_PCD_SetRxFiFo(&pcd_handle, 0x80);
+ HAL_PCD_SetTxFiFo(&pcd_handle, 0, 0x20);
+ HAL_PCD_SetTxFiFo(&pcd_handle, 1, 0x40);
+ HAL_PCD_SetTxFiFo(&pcd_handle, 2, 0x20);
+ HAL_PCD_SetTxFiFo(&pcd_handle, 3, 0x40);
#endif
#ifdef USE_USB_HS
/*Set LL Driver parameters */
- hpcd.Instance = USB_OTG_HS;
- hpcd.Init.dev_endpoints = 6;
- hpcd.Init.use_dedicated_ep1 = 0;
- hpcd.Init.ep0_mps = 0x40;
+ pcd_handle.Instance = USB_OTG_HS;
+ pcd_handle.Init.dev_endpoints = 6;
+ pcd_handle.Init.use_dedicated_ep1 = 0;
+ pcd_handle.Init.ep0_mps = 0x40;
/* Be aware that enabling USB-DMA mode will result in data being sent only by
multiple of 4 packet sizes. This is due to the fact that USB-DMA does
not allow sending data from non word-aligned addresses.
For this specific application, it is advised to not enable this option
unless required. */
- hpcd.Init.dma_enable = 0;
+ pcd_handle.Init.dma_enable = 0;
- hpcd.Init.low_power_enable = 0;
- hpcd.Init.phy_itface = PCD_PHY_ULPI;
- hpcd.Init.Sof_enable = 0;
- hpcd.Init.speed = PCD_SPEED_HIGH;
- hpcd.Init.vbus_sensing_enable = 1;
+ pcd_handle.Init.low_power_enable = 0;
+ pcd_handle.Init.phy_itface = PCD_PHY_ULPI;
+ pcd_handle.Init.Sof_enable = 0;
+ pcd_handle.Init.speed = PCD_SPEED_HIGH;
+ pcd_handle.Init.vbus_sensing_enable = 1;
/* Link The driver to the stack */
- hpcd.pData = pdev;
- pdev->pData = &hpcd;
+ pcd_handle.pData = pdev;
+ pdev->pData = &pcd_handle;
/*Initialize LL Driver */
- HAL_PCD_Init(&hpcd);
+ HAL_PCD_Init(&pcd_handle);
- HAL_PCD_SetRxFiFo(&hpcd, 0x200);
- HAL_PCD_SetTxFiFo(&hpcd, 0, 0x80);
- HAL_PCD_SetTxFiFo(&hpcd, 1, 0x174);
+ HAL_PCD_SetRxFiFo(&pcd_handle, 0x200);
+ HAL_PCD_SetTxFiFo(&pcd_handle, 0, 0x80);
+ HAL_PCD_SetTxFiFo(&pcd_handle, 1, 0x174);
#endif
|
