Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
瑞萨_RA6M4
瑞萨_Renesas
RA6M3修复ra_pin_mode、rt_ssize_t ra_uart_transmit文件类型错误
发布于 2023-04-16 18:49:36 浏览:476
订阅该版
renesas在用keil编译时报错: ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20230416/5a582929639f22c412aab28f2daa81c7.png.webp) 详细信如下: ```c ../libraries/HAL_Drivers/drv_gpio.c(324): error: incompatible function pointer types initializing 'void (*)(struct rt_device *, rt_base_t, rt_uint8_t)' (aka 'void (*)(struct rt_device *, long, unsigned char)') with an expression of type 'void (rt_device_t, rt_base_t, rt_base_t)' (aka 'void (struct rt_device *, long, long)') [-Wincompatible-function-pointer-types] .pin_mode = ra_pin_mode, ^~~~~~~~~~~ ../libraries/HAL_Drivers/drv_gpio.c(325): error: incompatible function pointer types initializing 'void (*)(struct rt_device *, rt_base_t, rt_uint8_t)' (aka 'void (*)(struct rt_device *, long, unsigned char)') with an expression of type 'void (rt_device_t, rt_base_t, rt_base_t)' (aka 'void (struct rt_device *, long, long)') [-Wincompatible-function-pointer-types] .pin_write = ra_pin_write, ^~~~~~~~~~~~ ../libraries/HAL_Drivers/drv_gpio.c(326): error: incompatible function pointer types initializing 'rt_int8_t (*)(struct rt_device *, rt_base_t)' (aka 'signed char (*)(struct rt_device *, long)') with an expression of type 'int (rt_device_t, rt_base_t)' (aka 'int (struct rt_device *, long)') [-Wincompatible-function-pointer-types] .pin_read = ra_pin_read, ^~~~~~~~~~~ ../libraries/HAL_Drivers/drv_gpio.c(327): error: incompatible function pointer types initializing 'rt_err_t (*)(struct rt_device *, rt_base_t, rt_uint8_t, void (*)(void *), void *)' (aka 'long (*)(struct rt_device *, long, unsigned char, void (*)(void *), void *)') with an expression of type 'rt_err_t (struct rt_device *, rt_int32_t, rt_uint32_t, void (*)(void *), void *)' (aka 'long (struct rt_device *, int, unsigned int, void (*)(void *), void *)') [-Wincompatible-function-pointer-types] .pin_attach_irq = ra_pin_attach_irq, ^~~~~~~~~~~~~~~~~ ../libraries/HAL_Drivers/drv_gpio.c(328): error: incompatible function pointer types initializing 'rt_err_t (*)(struct rt_device *, rt_base_t)' (aka 'long (*)(struct rt_device *, long)') with an expression of type 'rt_err_t (struct rt_device *, rt_int32_t)' (aka 'long (struct rt_device *, int)') [-Wincompatible-function-pointer-types] .pin_detach_irq = ra_pin_dettach_irq, ^~~~~~~~~~~~~~~~~~ ../libraries/HAL_Drivers/drv_gpio.c(329): error: incompatible function pointer types initializing 'rt_err_t (*)(struct rt_device *, rt_base_t, rt_uint8_t)' (aka 'long (*)(struct rt_device *, long, unsigned char)') with an expression of type 'rt_err_t (struct rt_device *, rt_base_t, rt_uint32_t)' (aka 'long (struct rt_device *, long, unsigned int)') [-Wincompatible-function-pointer-types] .pin_irq_enable = ra_pin_irq_enable, ^~~~~~~~~~~~~~~~~ 6 errors generated. compiling drv_gpio.c... ../libraries/HAL_Drivers/drv_usart_v2.c(252): warning: variable 'uart' set but not used [-Wunused-but-set-variable] struct ra_uart *uart; ^ ../libraries/HAL_Drivers/drv_usart_v2.c(499): error: incompatible function pointer types initializing 'rt_size_t (*)(struct rt_serial_device *, rt_uint8_t *, rt_size_t, rt_uint32_t)' (aka 'unsigned int (*)(struct rt_serial_device *, unsigned char *, unsigned int, unsigned int)') with an expression of type 'rt_ssize_t (struct rt_serial_device *, rt_uint8_t *, rt_size_t, rt_uint32_t)' (aka 'long (struct rt_serial_device *, unsigned char *, unsigned int, unsigned int)') [-Wincompatible-function-pointer-types] .transmit = ra_uart_transmit ^~~~~~~~~~~~~~~~ 1 warning and 1 error generated. ``` 经经分析原因,是文件类型使用不当报错,现将修复情情况如下: ```c bsp/renesas/libraries/HAL_Drivers/drv_gpio.c @@ -111,7 +111,7 @@ static void ra_pin_map_init(void) } #endif /* R_ICU_H */ static void ra_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) static void ra_pin_mode(rt_device_t dev, rt_base_t pin, rt_uint8_t mode) { fsp_err_t err; /* Initialize the IOPORT module and configure the pins */ @@ -154,7 +154,7 @@ static void ra_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) } } static void ra_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value) static void ra_pin_write(rt_device_t dev, rt_base_t pin, rt_uint8_t value) { bsp_io_level_t level = BSP_IO_LEVEL_HIGH; @@ -168,7 +168,7 @@ static void ra_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value) R_BSP_PinAccessDisable(); } static int ra_pin_read(rt_device_t dev, rt_base_t pin) static rt_int8_t ra_pin_read(rt_device_t dev, rt_base_t pin) { if ((pin > RA_MAX_PIN_VALUE) || (pin < RA_MIN_PIN_VALUE)) { @@ -178,7 +178,7 @@ static int ra_pin_read(rt_device_t dev, rt_base_t pin) return R_BSP_PinRead(pin); } static rt_err_t ra_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_t enabled) static rt_err_t ra_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint8_t enabled) { #ifdef R_ICU_H rt_err_t err; @@ -230,7 +230,7 @@ static rt_err_t ra_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_ui #endif } static rt_err_t ra_pin_attach_irq(struct rt_device *device, rt_int32_t pin, static rt_err_t ra_pin_attach_irq(struct rt_device *device, rt_base_t pin, rt_uint32_t mode, void (*hdr)(void *args), void *args) { #ifdef R_ICU_H @@ -264,7 +264,7 @@ static rt_err_t ra_pin_attach_irq(struct rt_device *device, rt_int32_t pin, #endif } static rt_err_t ra_pin_dettach_irq(struct rt_device *device, rt_int32_t pin) static rt_err_t ra_pin_dettach_irq(struct rt_device *device, rt_base_t pin) { #ifdef R_ICU_H rt_int32_t irqx = ra_pin_get_irqx(pin); ``` ```c bsp/renesas/libraries/HAL_Drivers/drv_usart_v2.c Comment on this file @@ -244,7 +244,7 @@ static int ra_uart_getc(struct rt_serial_device *serial) return RT_EOK; } static rt_ssize_t ra_uart_transmit(struct rt_serial_device *serial, static rt_size_t ra_uart_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag) ``` ```c bsp/renesas/libraries/HAL_Drivers/drv_usart_v2.c Comment on this file @@ -244,7 +244,7 @@ static int ra_uart_getc(struct rt_serial_device *serial) return RT_EOK; } static rt_ssize_t ra_uart_transmit(struct rt_serial_device *serial, static rt_size_t ra_uart_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag) ```
5
条评论
默认排序
按发布时间排序
登录
注册新账号
关于作者
Lu_盼盼
这家伙很懒,什么也没写!
文章
35
回答
19
被采纳
0
关注TA
发私信
相关文章
1
瑞萨RA2E1芯片移植发生的问题
2
自动创建项目后添加串口出现找不到头文件board_cfg.h
3
CPK-RA6M4的J-Link驱动没有了,每次更新都会缺少头文件
4
瑞萨RA6M4使用RC522软件包示例无反馈
5
瑞萨的EK-RA6M4和CPK-RA6M4开发上有区别吗?
6
Renesas Ra6m2串口接收事件触发定时器启动失败
7
RT-Thread有对应瑞萨MCU的版本吗?
8
瑞萨RA2L1 SPI相关问题
9
瑞萨RH850系列的芯片有移植过rt thread吗
10
瑞萨RL78系列的芯片有移植过rt thread吗
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
UART
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
SFUD
msh
rt_mq_消息队列_msg_queue
keil_MDK
ulog
MicroPython
C++_cpp
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1443
个答案
289
次被采纳
张世争
805
个答案
174
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
4
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
1
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
投诉
建议
回到
底部