-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为复旦微电子FM33LC0XX添加BSP。包含UART驱动,已经在板子上测试通过。 #4957
Conversation
请签署CLA协议 |
FL_GPIO_Init(GPIOD, &GPIO_InitStruct); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码格式不正确:
1.函数名小写
2.空行不可超过一行
3.缩进使用空格
可以查阅:https://gitee.com/rtthread/rt-thread/blob/gitee_master/documentation/coding_style_cn.md
可以使用astyle进行格式化
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
格式我看一下,那个函数是调用的官方库函数,是大写的,这个还改吗。
bsp/fm33lc026/applications/main.c
Outdated
rt_thread_mdelay(500); | ||
} | ||
|
||
// return RT_EOK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码格式:
删除无用注释
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
bsp/fm33lc026/applications/main.h
Outdated
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main.h没用的话直接删掉吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. | ||
---------------------------------------------------------------------------*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license:非apache 的兼容 license,需要更新 bsp 目录下的 license 声明:Copyright_Notice.md。bsp按照字母顺序排列。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我看一下
#endif | ||
}; | ||
|
||
struct stm32_adc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stm32 ?
|
||
/* attention !!! baud calculation example: Tclk / ((ss + bs1 + bs2) * brp) 36 / ((1 + 8 + 3) * 3) = 1MHz*/ | ||
#if defined (SOC_SERIES_STM32F1)/* APB1 36MHz(max) */ | ||
static const struct stm32_baud_rate_tab can_baud_rate_tab[] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SOC_SERIES_STM32F1 ?
stm32 ?
|
||
#if defined(SOC_SERIES_STM32F0) | ||
ADC_ChanConf.SamplingTime = ADC_SAMPLETIME_71CYCLES_5; | ||
#elif defined(SOC_SERIES_STM32F1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SOC_SERIES_STM32F1 ?
return -RT_ERROR; | ||
} | ||
|
||
#if defined(SOC_SERIES_STM32MP1) || defined (SOC_SERIES_STM32H7) || defined (SOC_SERIES_STM32WB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分只作为你们芯片自己的驱动,不用考虑和stm32兼容
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
驱动拿STM32修改的,只修改了串口,其他的没删掉,以后方便接着添加,那我先删掉吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你们的代码不需要在stm32上跑,删掉就行。然后命名也可以改一下,不然看着蛮奇怪的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那我先删掉吧,不在STM32上跑,就是驱动部分drv_xxx.c是拿stm32的drv_xxx.c驱动改的,现在只改了串口,没改的还是stm32那一部分的。还有库函数的函数名大写,这个不用修改了吧。
/* SysTick configuration */ | ||
void rt_hw_systick_init(void) | ||
{ | ||
SystemCoreClockUpdate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
格式:缩进问题
.reset = _crypto_reset, | ||
}; | ||
|
||
int stm32_hw_crypto_device_init(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
函数名
#ifndef __DRV_CRYPTO_H__ | ||
#define __DRV_CRYPTO_H__ | ||
|
||
int l4_hw_crypto_device_init(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该写错了
}; | ||
|
||
struct stm32_dac | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改所有stm32相关的变量名和函数名
/* debug option */ | ||
//#define ETH_RX_DUMP | ||
//#define ETH_TX_DUMP | ||
//#define DRV_DEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些如果是可选项,可以放进menuconfig。不需要则删除
extern void phy_reset(void); | ||
/* EMAC initialization function */ | ||
static rt_err_t rt_stm32_eth_init(rt_device_t dev) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
驱动中的函数,不要使用 rt_ 开头。
内部函数建议改成:_stm32_uart_xxx 这类方式。如 _eth_init(),以下也全部做出修改 :
rt_stm32_eth_init;
rt_stm32_eth_open;
rt_stm32_eth_close;
rt_stm32_eth_read;
rt_stm32_eth_write;
rt_stm32_eth_control;
rt_stm32_eth_rx;
rt_stm32_eth_tx;
int stm32_flash_read(rt_uint32_t addr, rt_uint8_t *buf, size_t size); | ||
int stm32_flash_write(rt_uint32_t addr, const rt_uint8_t *buf, size_t size); | ||
int stm32_flash_erase(rt_uint32_t addr, size_t size); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改命名
#elif defined(GPIOB) | ||
#define __STM32_PORT_MAX 2u | ||
#elif defined(GPIOA) | ||
#define __STM32_PORT_MAX 1u |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改命名
stm32_pin_dettach_irq, | ||
stm32_pin_irq_enable, | ||
stm32_pin_get, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改ops函数名 如 _pin_mode
2.删除没用的文件
|
中文可以不用改英文,这个芯片海外应该还没有使用的,建议国产芯片优先服务国内开发者。别给中国开发者制造困难不说,结果该bsp海外还没几个非中文母语者使用😂,犯不上。 |
建议国产芯片的bsp注释规范应该和全球通用bsp(如STM32)区别开,除非确认该芯片厂商提供的芯片datesheet以及开发指南有完整的英文支持,并且存在海外市场和海外开发者,否则应该采用中文作为注释。否则,增加英文注释不再是为了交流方便,而是给中国开发者制造困难。因为在实际过程中我们发现: |
Please fix the conflicting .ignore_format.yml file, thank you. |
完蛋 估计等那边的pr合并了 又得冲突 现在有两个pr在提交扫描忽略文件,要是再冲突您还得改一次🤣 |
这个忽略文件可以加在自己的bsp下面,可以像scons一样支持分布式的。 |
无限套娃,哈哈 |
都加到自己的bsp下吧。。 |
是的 感觉这部分应该调整一下,大家都学着之前BSP的样子往一个文件里塞确实有些不方便,后续提交bsp应该有个这方面的提示 @Guozhanxin |
弄个 bsp 模板出来 |
棒👍 |
RT-Thread Commiter,您好!我们计划在本月15日(即2021.10.15)发布v4.0.4版本,希望您这两天可以对您维护的BSP进行一些测试工作!以保证在RT-Thread的发布版本里当前 BSP 的各项功能是好用的! |
拉取/合并请求描述:(PR description)
[
为复旦微电子FM33LC0XX添加BSP。
包含UART驱动,已经在板子上测试通过。
STM32系列BSP修改移植,驱动文件没有删除,后续继续修改。
]
以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up