change text W7500x_gpio.c GPIO_Mode_OUT, HAL_GPIO_SetBits, HAL_GPIO_ResetBits

pull/10617/head
TeddyWiz 2019-05-20 16:52:54 +09:00
parent 25019df05e
commit 45f43b61fc
1 changed files with 9 additions and 5 deletions

View File

@ -81,7 +81,7 @@ void HAL_GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
{ {
if(GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT) if(GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT)
{ {
GPIOx->OUTENSET |= pos; GPIOx->OUTENSET = pos;
} }
else // GPIO_Mode_In else // GPIO_Mode_In
{ {
@ -199,8 +199,10 @@ void HAL_GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin)); assert_param(IS_GPIO_PIN(GPIO_Pin));
(GPIOx->LB_MASKED[(uint8_t)(GPIO_Pin)]) = GPIO_Pin; if (GPIO_Pin < 256)
(GPIOx->UB_MASKED[(uint8_t)((GPIO_Pin)>>8)]) = GPIO_Pin; (GPIOx->LB_MASKED[(uint8_t) (GPIO_Pin)]) = 0xFFFF;
else
(GPIOx->UB_MASKED[(uint8_t) ((GPIO_Pin) >> 8)]) = 0xFFFF;
} }
void HAL_GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) void HAL_GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
@ -209,8 +211,10 @@ void HAL_GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin)); assert_param(IS_GPIO_PIN(GPIO_Pin));
(GPIOx->LB_MASKED[(uint8_t)(GPIO_Pin)]) = ~(GPIO_Pin); if (GPIO_Pin < 256)
(GPIOx->UB_MASKED[(uint8_t)(GPIO_Pin>>8)]) = ~(GPIO_Pin); (GPIOx->LB_MASKED[(uint8_t) (GPIO_Pin)]) = 0x0;
else
(GPIOx->UB_MASKED[(uint8_t) (GPIO_Pin >> 8)]) = 0x0;
} }
void HAL_GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal) void HAL_GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal)