-
Notifications
You must be signed in to change notification settings - Fork 21
feat(cherryecat): add cherryecat demo #53
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
Conversation
fc5d6d7 to
4ef28cc
Compare
|
大佬可以帮忙这三处加一下配置吗: 1.这里要加一下studio的工程配置
2.添加CI看护
3.添加文档章节说明
|
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.
Pull Request Overview
This PR introduces a complete CherryECAT (EtherCAT Master) implementation for embedded systems, featuring core EtherCAT functionality, slave scanning, process data exchange, and mailbox communication protocols.
Key changes:
- Implementation of a full EtherCAT master stack with scanning, configuration, and PDO exchange
- Support for CoE (CANopen over EtherCAT) communication with SDO operations
- Distributed Clock (DC) synchronization and delay measurement functionality
- Multi-network device support with redundancy capabilities
Reviewed Changes
Copilot reviewed 115 out of 283 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ec_slave.c | Core slave management, state machines, PDO configuration, and DC synchronization |
| src/ec_master.c | Master control, periodic process handling, network statistics, and slave coordination |
| src/ec_netdev.c | Network device abstraction with statistics and PHY management |
| src/ec_coe.c | CANopen over EtherCAT implementation with segmented transfers |
| src/ec_mailbox.c | EtherCAT mailbox communication protocol |
| src/ec_datagram.c | Low-level datagram construction and management |
| port/netdev_*.c | Hardware-specific network drivers for Renesas and HPMicro platforms |
| include/*.h | Header files defining core data structures and PHY drivers |
Comments suppressed due to low confidence (1)
projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/src/ec_slave.c:1
- Incorrect variable usage on line 737. Should use 'slave_state' instead of 'slave->current_state' for consistency, but line 738 uses slave->current_state correctly after assignment.
/*
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| /** Maximum count to wait for clock discipline. | ||
| */ | ||
| #define EC_DC_SYNC_WATI_COUNT (15000) |
Copilot
AI
Oct 12, 2025
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.
Corrected spelling of 'WATI' to 'WAIT'.
| #define EC_DC_SYNC_WATI_COUNT (15000) | |
| #define EC_DC_SYNC_WAIT_COUNT (15000) |
| slave = &master->slaves[slave_index]; | ||
|
|
||
| EC_ASSERT_MSG(slave_index >= master->slave_count, "Invalid slave index"); |
Copilot
AI
Oct 12, 2025
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.
Logic error in assertion condition. Should check if slave_index is greater than or equal to slave_count, but the condition will always fail for valid indices.
| slave = &master->slaves[slave_index]; | |
| EC_ASSERT_MSG(slave_index >= master->slave_count, "Invalid slave index"); | |
| EC_ASSERT_MSG(slave_index >= master->slave_count, "Invalid slave index"); | |
| slave = &master->slaves[slave_index]; |
| goto mutex_unlock; | ||
| } | ||
|
|
||
| // Clear recevice time for dc measure delays |
Copilot
AI
Oct 12, 2025
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.
Corrected spelling of 'recevice' to 'receive'.
| // Clear recevice time for dc measure delays | |
| // Clear receive time for dc measure delays |
| } | ||
| } | ||
|
|
||
| // 添加端口类型字符串转换函数 |
Copilot
AI
Oct 12, 2025
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.
[nitpick] Comment is in Chinese. Consider using English comments for better code maintainability and international collaboration.
| // 添加端口类型字符串转换函数 | |
| // Add port type string conversion function |
以增加,config.yaml 是通配符,满足的,所以不用加 |
e99b5c1 to
22a31df
Compare
Signed-off-by: sakumisu <[email protected]>
|
我这边没问题了,大佬看看还有什么需要修改的吗,文档CI报错忽略即可 |
我这边可以了,修了ai的一些问题 |
|
感谢大佬的贡献! |
No description provided.