0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

RA6M3修复ra_pin_mode、rt_ssize_t ra_uart_transmit文件类型错误

冬至子 来源:Lu_盼盼 作者:Lu_盼盼 2023-09-27 11:38 次阅读

renesas在用keil编译时报错:

1.jpg

详细信如下:

../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.

经经分析原因,是文件类型使用不当报错,现将修复情情况如下:

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);
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)
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)

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • GPIO
    +关注

    关注

    16

    文章

    1204

    浏览量

    52051
  • PIN管
    +关注

    关注

    0

    文章

    36

    浏览量

    6322
  • UART接口
    +关注

    关注

    0

    文章

    124

    浏览量

    15288
  • RT-Thread
    +关注

    关注

    31

    文章

    1285

    浏览量

    40082
  • HAL库
    +关注

    关注

    1

    文章

    121

    浏览量

    6217
  • RA6M3
    +关注

    关注

    0

    文章

    52

    浏览量

    110
收藏 人收藏

    评论

    相关推荐

    RA6M3 HMI Board评测挑战】-瑞萨RA6M3上的CAN实践

    RA6M3 HMI Board 评测大挑战】-瑞萨RA6M3上的CAN实践
    的头像 发表于 10-17 14:55 1997次阅读
    【<b class='flag-5'>RA6M3</b> HMI Board评测挑战】-瑞萨<b class='flag-5'>RA6M3</b>上的CAN实践

    RA6M3数据手册(英)

    RA6M3数据手册(英)
    发表于 11-07 19:49 0次下载
    <b class='flag-5'>RA6M3</b>数据手册(英)

    RA6M3硬件用户手册(英)

    RA6M3硬件用户手册(英)
    发表于 11-07 19:49 0次下载
    <b class='flag-5'>RA6M3</b>硬件用户手册(英)

    RA6M3数据手册(中英)

    RA6M3数据手册(中英)
    发表于 11-07 19:49 0次下载
    <b class='flag-5'>RA6M3</b>数据手册(中英)

    RA6M3硬件用户手册(中英)

    RA6M3硬件用户手册(中英)
    发表于 11-07 19:49 2次下载
    <b class='flag-5'>RA6M3</b>硬件用户手册(中英)

    RA6M3 组用户手册:硬件

    RA6M3 组用户手册:硬件
    发表于 05-12 19:25 0次下载
    <b class='flag-5'>RA6M3</b> 组用户手册:硬件

    RA6M3 组数据表

    RA6M3 组数据表
    发表于 05-12 19:25 0次下载
    <b class='flag-5'>RA6M3</b> 组数据表

    vscode+pyocd+daplink调试瑞萨ra6m3

    拿到了瑞萨的ra6m3的板子,发现使用RT-Thread Stduio下载速度很慢,就想着搭建一个vscode的环境试试。
    的头像 发表于 06-07 11:51 1457次阅读

    RA6M3 组用户手册:硬件

    RA6M3 组用户手册:硬件
    发表于 06-29 19:17 0次下载
    <b class='flag-5'>RA6M3</b> 组用户手册:硬件

    RA6M3 组数据表

    RA6M3 组数据表
    发表于 06-29 19:17 0次下载
    <b class='flag-5'>RA6M3</b> 组数据表

    RA6M3 微控制器组数据表

    RA6M3 微控制器组数据表
    发表于 07-04 19:45 0次下载
    <b class='flag-5'>RA6M3</b> 微控制器组数据表

    vscode+pyocd+daplink调试瑞萨ra6m3步骤

    拿到了瑞萨的ra6m3的板子,发现使用RT-Thread Stduio下载速度很慢,就想着搭建一个vscode的环境试试。
    的头像 发表于 09-14 14:47 1703次阅读

    瑞萨 RA6M3 开发实践指南-UART实践

    RT-Thread即将发布一系列RA6M3外设驱动的实践指南,我们将使用瑞萨RA6M3 HMI-Board 开发板,带领大家上手RT-Thread设备驱动。  【硬件介绍】 1.  开
    的头像 发表于 09-23 12:15 1356次阅读

    RA6M3硬件手册

    RA6M3User'sManualHardware
    发表于 03-23 15:06 4次下载

    RA6M3 RT-Thread* LVGL HMI Board开发实践指南-GPIO实践

    RT-Thread即将发布一系列RA6M3外设驱动的实践指南,我们将使用瑞萨RA6M3 HMI-Board 开发板,带领大家上手RT-Thread设备驱动, 本篇文章将介绍GPIO外设
    的头像 发表于 11-30 19:05 1252次阅读
    <b class='flag-5'>RA6M3</b> <b class='flag-5'>RT</b>-Thread* LVGL HMI Board开发实践指南-GPIO实践