Skip to content
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

add synwit swm341 bsp #6235

Merged
merged 15 commits into from
Aug 14, 2022
Merged

add synwit swm341 bsp #6235

merged 15 commits into from
Aug 14, 2022

Conversation

yanmowudi
Copy link
Contributor

@yanmowudi yanmowudi commented Aug 7, 2022

拉取/合并请求描述:(PR description)

[
增加华芯微特SWM341芯片的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):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
  • 本拉取/合并使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

MSH_CMD_EXPORT(spi_w25q_sample, spi w25q sample);

//#include <dfs_file.h>
//#include <unistd.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些注释的代码还需要是吗,是要在某些宏开启的情况下使用吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,spi外设的测试代码,如果您觉得不需要可以去掉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果留着的话最好有使用说明。要不然开发者也不知道该怎么用。

@mysterywolf
Copy link
Member

你好,感谢提交PR,
等这个PR合并之后,建议再提交一个PR,创建一个swm文件夹,并将swm的两个bsp都放在文件夹里,因为未来可能还有新的swm bsp加进来。
还有就是建议不同bsp能共用一个驱动文件,这样后期维护的时候,不会出现一些共性问题 只改了一个bsp驱动的问题(顾头不顾腚的问题),因为我注意到有一些驱动,目前两个bsp是有高度重复的,可以参考STM32的driver去写,通过宏来区分不同的BSP或者型号:https://github.com/RT-Thread/rt-thread/tree/master/bsp/stm32/libraries/HAL_Drivers
这样也方便后期社区其他小伙伴帮你一起维护。

@mysterywolf mysterywolf added the +1 Agree +1 label Aug 8, 2022
@Guozhanxin Guozhanxin added the +2 Agree +2 label Aug 14, 2022
@mysterywolf mysterywolf merged commit 0189987 into RT-Thread:master Aug 14, 2022
@mysterywolf
Copy link
Member

#6271
您好 我在这里已经帮您整个到了一个文件夹中
我发现一个问题,触摸驱动您是否漏选忘记select软件包了?

@yanmowudi
Copy link
Contributor Author

您好,整合到一个文件我这边来做,要一起更新一下swm320的lib,您反馈的问题我同步修改,预计本周完成。

@yanmowudi
Copy link
Contributor Author

您好,这个例子中https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/programming-manual/device/rtc/rtc?id=rtc-%e8%ae%be%e5%a4%87%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b设置日期和设置时间分两个函数来设置,是否每次设置都会做UTC处理,导致时间错误?

@mysterywolf
Copy link
Member

你好,这个确实有些问题,但是不影响低层驱动的对接 我们会在v5.0的时候对rtc框架做出调整。
可以参考STM32的drv_rtc.c来书写 https://github.com/RT-Thread/rt-thread/blob/master/bsp/stm32/libraries/HAL_Drivers/drv_rtc.c

@mysterywolf
Copy link
Member

mysterywolf commented Aug 16, 2022

一般可以考虑标准time函数来进行日期的设置,只要rtc支持上,time.h里的函数我们都是支持的。

@yanmowudi
Copy link
Contributor Author

好的,我是在测试的时候发现时间设置不对,驱动已经完成,删掉这两个函数,直接用date()设置时间也可以

@mysterywolf
Copy link
Member

好的 感谢~

@yanmowudi
Copy link
Contributor Author

这个rtc框架好像已经改过很多次了

@mysterywolf
Copy link
Member

是的 这个rtc框架是最老的一批框架,目前已经完善了。至于您提到的这个问题,实际上更多的是采用time.h的函数来替代。这两个函数是辅助性质的。这两个函数的注意事项,我会放到文档中心中。

@mysterywolf
Copy link
Member

mysterywolf commented Aug 16, 2022

我再补充一下,使用时间的时候,只要RTC使能了
就可以直接#include <sys/time>
然后linux或者unix操作系统怎么操作时间,rtthread就怎么操作时间就可以了。这块文档中心RTC框架章节没有说明白,引起了误解 我会补充好。 可以看一下这里:https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/programming-manual/libc/iso-ansi-c?id=_5-%e6%97%b6%e9%97%b4%e5%87%bd%e6%95%b0

@yanmowudi
Copy link
Contributor Author

嗯嗯,感谢回复。rtc章节文档可能需要更新一下

@mysterywolf
Copy link
Member

mysterywolf commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
+1 Agree +1 +2 Agree +2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants