RM新时代网站-首页

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領取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.

經(jīng)經(jīng)分析原因,是文件類型使用不當報錯,現(xiàn)將修復情情況如下:

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)

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權轉載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • GPIO
    +關注

    關注

    16

    文章

    1204

    瀏覽量

    52051
  • PIN管
    +關注

    關注

    0

    文章

    36

    瀏覽量

    6322
  • UART接口
    +關注

    關注

    0

    文章

    124

    瀏覽量

    15288
  • RT-Thread
    +關注

    關注

    31

    文章

    1285

    瀏覽量

    40081
  • HAL庫
    +關注

    關注

    1

    文章

    121

    瀏覽量

    6216
  • RA6M3
    +關注

    關注

    0

    文章

    52

    瀏覽量

    110
收藏 人收藏

    評論

    相關推薦

    RA6M3 HMI Board評測挑戰(zhàn)】-瑞薩RA6M3上的CAN實踐

    RA6M3 HMI Board 評測大挑戰(zhàn)】-瑞薩RA6M3上的CAN實踐
    的頭像 發(fā)表于 10-17 14:55 ?1997次閱讀
    【<b class='flag-5'>RA6M3</b> HMI Board評測挑戰(zhàn)】-瑞薩<b class='flag-5'>RA6M3</b>上的CAN實踐

    RA6M3數(shù)據(jù)手冊(英)

    RA6M3數(shù)據(jù)手冊(英)
    發(fā)表于 11-07 19:49 ?0次下載
    <b class='flag-5'>RA6M3</b>數(shù)據(jù)手冊(英)

    RA6M3硬件用戶手冊(英)

    RA6M3硬件用戶手冊(英)
    發(fā)表于 11-07 19:49 ?0次下載
    <b class='flag-5'>RA6M3</b>硬件用戶手冊(英)

    RA6M3數(shù)據(jù)手冊(中英)

    RA6M3數(shù)據(jù)手冊(中英)
    發(fā)表于 11-07 19:49 ?0次下載
    <b class='flag-5'>RA6M3</b>數(shù)據(jù)手冊(中英)

    RA6M3硬件用戶手冊(中英)

    RA6M3硬件用戶手冊(中英)
    發(fā)表于 11-07 19:49 ?2次下載
    <b class='flag-5'>RA6M3</b>硬件用戶手冊(中英)

    RA6M3 組用戶手冊:硬件

    RA6M3 組用戶手冊:硬件
    發(fā)表于 05-12 19:25 ?0次下載
    <b class='flag-5'>RA6M3</b> 組用戶手冊:硬件

    RA6M3 組數(shù)據(jù)表

    RA6M3 組數(shù)據(jù)表
    發(fā)表于 05-12 19:25 ?0次下載
    <b class='flag-5'>RA6M3</b> 組數(shù)據(jù)表

    vscode+pyocd+daplink調試瑞薩ra6m3

    拿到了瑞薩的ra6m3的板子,發(fā)現(xiàn)使用RT-Thread Stduio下載速度很慢,就想著搭建一個vscode的環(huán)境試試。
    的頭像 發(fā)表于 06-07 11:51 ?1457次閱讀

    RA6M3 組用戶手冊:硬件

    RA6M3 組用戶手冊:硬件
    發(fā)表于 06-29 19:17 ?0次下載
    <b class='flag-5'>RA6M3</b> 組用戶手冊:硬件

    RA6M3 組數(shù)據(jù)表

    RA6M3 組數(shù)據(jù)表
    發(fā)表于 06-29 19:17 ?0次下載
    <b class='flag-5'>RA6M3</b> 組數(shù)據(jù)表

    RA6M3 微控制器組數(shù)據(jù)表

    RA6M3 微控制器組數(shù)據(jù)表
    發(fā)表于 07-04 19:45 ?0次下載
    <b class='flag-5'>RA6M3</b> 微控制器組數(shù)據(jù)表

    vscode+pyocd+daplink調試瑞薩ra6m3步驟

    拿到了瑞薩的ra6m3的板子,發(fā)現(xiàn)使用RT-Thread Stduio下載速度很慢,就想著搭建一個vscode的環(huán)境試試。
    的頭像 發(fā)表于 09-14 14:47 ?1703次閱讀

    瑞薩 RA6M3 開發(fā)實踐指南-UART實踐

    RT-Thread即將發(fā)布一系列RA6M3外設驅動的實踐指南,我們將使用瑞薩RA6M3 HMI-Board 開發(fā)板,帶領大家上手RT-Thread設備驅動。? 【硬件介紹】 1.? 開
    的頭像 發(fā)表于 09-23 12:15 ?1356次閱讀

    RA6M3硬件手冊

    RA6M3User'sManualHardware
    發(fā)表于 03-23 15:06 ?4次下載

    RA6M3 RT-Thread* LVGL HMI Board開發(fā)實踐指南-GPIO實踐

    RT-Thread即將發(fā)布一系列RA6M3外設驅動的實踐指南,我們將使用瑞薩RA6M3 HMI-Board 開發(fā)板,帶領大家上手RT-Thread設備驅動, 本篇文章將介紹GPIO外設
    的頭像 發(fā)表于 11-30 19:05 ?1250次閱讀
    <b class='flag-5'>RA6M3</b> <b class='flag-5'>RT</b>-Thread* LVGL HMI Board開發(fā)實踐指南-GPIO實踐
    RM新时代网站-首页