Skip to content

Conversation

@sakumisu
Copy link
Contributor

No description provided.

@sakumisu sakumisu force-pushed the master branch 3 times, most recently from fc5d6d7 to 4ef28cc Compare October 11, 2025 14:05
@sakumisu sakumisu marked this pull request as ready for review October 11, 2025 14:05
@kurisaW
Copy link
Collaborator

kurisaW commented Oct 12, 2025

大佬可以帮忙这三处加一下配置吗:

1.这里要加一下studio的工程配置

- project_name: etherkit_ethernetip_opener

2.添加CI看护

- {RTT_BSP: "etherkit_factory"}

3.添加文档章节说明

- "etherkit_ethernetip_*"

@Rbb666 Rbb666 requested a review from Copilot October 12, 2025 07:10
Copy link

Copilot AI left a 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)
Copy link

Copilot AI Oct 12, 2025

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

Suggested change
#define EC_DC_SYNC_WATI_COUNT (15000)
#define EC_DC_SYNC_WAIT_COUNT (15000)

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 20
slave = &master->slaves[slave_index];

EC_ASSERT_MSG(slave_index >= master->slave_count, "Invalid slave index");
Copy link

Copilot AI Oct 12, 2025

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.

Suggested change
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];

Copilot uses AI. Check for mistakes.
goto mutex_unlock;
}

// Clear recevice time for dc measure delays
Copy link

Copilot AI Oct 12, 2025

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

Suggested change
// Clear recevice time for dc measure delays
// Clear receive time for dc measure delays

Copilot uses AI. Check for mistakes.
}
}

// 添加端口类型字符串转换函数
Copy link

Copilot AI Oct 12, 2025

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.

Suggested change
// 添加端口类型字符串转换函数
// Add port type string conversion function

Copilot uses AI. Check for mistakes.
@sakumisu
Copy link
Contributor Author

// 添加端口类型字符串转换函数

以增加,config.yaml 是通配符,满足的,所以不用加

@sakumisu sakumisu force-pushed the master branch 2 times, most recently from e99b5c1 to 22a31df Compare October 13, 2025 02:26
@kurisaW
Copy link
Collaborator

kurisaW commented Oct 13, 2025

我这边没问题了,大佬看看还有什么需要修改的吗,文档CI报错忽略即可

@sakumisu
Copy link
Contributor Author

我这边没问题了,大佬看看还有什么需要修改的吗,文档CI报错忽略即可

我这边可以了,修了ai的一些问题

@kurisaW kurisaW merged commit 3af5972 into RT-Thread-Studio:master Oct 13, 2025
29 of 30 checks passed
@kurisaW
Copy link
Collaborator

kurisaW commented Oct 13, 2025

感谢大佬的贡献!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants