fix warning for ac5

This commit is contained in:
pikastech 2021-12-12 00:30:04 +08:00
parent 6d93b36954
commit 86377d1a3c
8 changed files with 11 additions and 20 deletions

View File

@ -144,4 +144,4 @@ exit:
void STM32F1_ADC_platformRead(PikaObj* self) {
char *pin = obj_getStr(self, "pin");
obj_setFloat(self, "val", 3.3f * Get_Adc(&pika_hadc1, getChannel(pin)) / 4096.0f);
}
}

View File

@ -168,4 +168,4 @@ int STM32F1_lowLevel_readPin(PikaObj *self, char * pin){
obj_setSysOut(self, "[error] not match gpio pin.");
}
return HAL_GPIO_ReadPin(gpioPort,gpioPin);
}
}

View File

@ -57,7 +57,7 @@ uint8_t READ_SDA(pika_IIC_info* iic) {
}
void WRITE_SDA(pika_IIC_info* iic, uint8_t data) {
HAL_GPIO_WritePin(iic->SDA_GPIO, iic->SDA_GPIO_Pin, data);
HAL_GPIO_WritePin(iic->SDA_GPIO, iic->SDA_GPIO_Pin, (GPIO_PinState) data);
}
void IIC_Start(pika_IIC_info* iic) {
@ -253,4 +253,4 @@ void STM32F1_IIC_platformWrite(PikaObj* self) {
pika_IIC_info* iic = obj_getPtr(self, "iic");
MPU_Write_Len(iic, iic->deviceAddr, addr, strGetSize(data), (uint8_t*)data);
}
}

View File

@ -320,4 +320,4 @@ void STM32F1_PWM_platformSetFrequency(PikaObj* self) {
__HAL_TIM_SET_COMPARE(pika_tim, getTimChennel(pin),
(uint32_t)(pika_tim->Init.Period * duty));
}
}
}

View File

@ -10,4 +10,4 @@ void STM32F1_Time_sleep_s(PikaObj* self, int s) {
for (int i = 0; i < s; i++) {
HAL_Delay(1000);
}
}
}

View File

@ -50,14 +50,6 @@ static void setUartObj(uint8_t id, PikaObj* obj) {
pika_uart->obj = obj;
}
static PikaObj* getUartObj(uint8_t id) {
pika_uart_t* pika_uart = getPikaUart(id);
if (NULL == pika_uart) {
return NULL;
}
return pika_uart->obj;
}
static USART_TypeDef* getUartInstance(uint8_t id) {
#ifdef UART1_EXIST
if (1 == id) {
@ -310,7 +302,6 @@ void STM32F1_UART_platformRead(PikaObj* self) {
UART_Start_Receive_IT(
&pika_uart->huart,
(uint8_t*)(pika_uart->rxBuff + pika_uart->rxBuffOffset), 1);
exit:
args_deinit(buffs);
obj_setStr(self,"readData", readBuff);
}

View File

@ -165,4 +165,4 @@ uint8_t enableClk(char* pin) {
return 0;
}
return 1;
}
}

View File

@ -86,7 +86,7 @@ void delay_us(uint32_t delay);
void delay_unit(uint32_t delay);
void STM32_UART_clearRxBuff(pika_uart_t* pika_uart);
uint8_t STM32_Code_reciveHandler(char *data, uint32_t rxSize);
void STM32_Code_Init();
void STM32_Code_flashHandler();
void HARDWARE_PRINTF_Init();
#endif
void STM32_Code_Init(void);
void STM32_Code_flashHandler(void);
void HARDWARE_PRINTF_Init(void);
#endif