mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-08-17 16:51:44 +08:00
Merge branch 'stable-1.6' into stable-1.7
This commit is contained in:
+11
-1
@@ -7,9 +7,14 @@ repos:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: check-case-conflict
|
||||
- id: check-merge-conflict
|
||||
- id: check-symlinks
|
||||
- id: fix-byte-order-marker
|
||||
- id: mixed-line-ending
|
||||
|
||||
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||
rev: v0.49.0
|
||||
rev: v0.49.1
|
||||
hooks:
|
||||
- id: markdownlint
|
||||
|
||||
@@ -17,3 +22,8 @@ repos:
|
||||
rev: v3.14.2
|
||||
hooks:
|
||||
- id: markdown-link-check
|
||||
|
||||
- repo: https://github.com/cpplint/cpplint
|
||||
rev: 2.0.2
|
||||
hooks:
|
||||
- id: cpplint
|
||||
|
||||
@@ -165,6 +165,9 @@ Enhancement suggestions are tracked as
|
||||
|
||||
There is a [coding style document](CodingStyle.md) next to this guide.
|
||||
|
||||
Please install the [pre-commit hooks](.pre-commit-config.yaml) via `pre-commit
|
||||
install`.
|
||||
|
||||
<!-- omit in toc -->
|
||||
## Attribution
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
filter=-build/include_subdir
|
||||
filter=-build/include_what_you_use
|
||||
filter=-readability/braces
|
||||
filter=-runtime/int
|
||||
filter=-whitespace/braces
|
||||
filter=-whitespace/comments
|
||||
filter=-whitespace/empty_loop_body
|
||||
filter=-whitespace/newline
|
||||
linelength=78
|
||||
@@ -108,3 +108,11 @@ Please see the [contributing document](CONTRIBUTING.md).
|
||||
|
||||
Developers shall use the coding style rules in the [coding style
|
||||
file](CodingStyle.md).
|
||||
|
||||
There is a [cpplint configuration](CPPLINT.cfg) included as well that is
|
||||
automatically checked via [pre-commit hooks](.pre-commit-config.yaml). So
|
||||
please install the pre-commit hooks via
|
||||
|
||||
```bash
|
||||
pre-commit install
|
||||
```
|
||||
|
||||
+12
-16
@@ -66,15 +66,15 @@
|
||||
|
||||
#define smp_store_release(p, v) \
|
||||
do { \
|
||||
smp_mb(); \
|
||||
ACCESS_ONCE(*p) = (v); \
|
||||
smp_mb(); \
|
||||
ACCESS_ONCE(*p) = (v); \
|
||||
} while (0)
|
||||
|
||||
#define smp_load_acquire(p) \
|
||||
#define smp_load_acquire(p) \
|
||||
({ \
|
||||
typeof(*p) ___p1 = ACCESS_ONCE(*p); \
|
||||
smp_mb(); \
|
||||
___p1; \
|
||||
typeof(*p) ___p1 = ACCESS_ONCE(*p); \
|
||||
smp_mb(); \
|
||||
___p1; \
|
||||
})
|
||||
|
||||
#endif
|
||||
@@ -1105,8 +1105,8 @@ void ec_master_send_datagrams(
|
||||
}
|
||||
|
||||
// EtherCAT datagram header
|
||||
EC_WRITE_U8 (cur_data, datagram->type);
|
||||
EC_WRITE_U8 (cur_data + 1, datagram->index);
|
||||
EC_WRITE_U8(cur_data, datagram->type);
|
||||
EC_WRITE_U8(cur_data + 1, datagram->index);
|
||||
memcpy(cur_data + 2, datagram->address, EC_ADDR_LEN);
|
||||
EC_WRITE_U16(cur_data + 6, datagram->data_size & 0x7FF);
|
||||
EC_WRITE_U16(cur_data + 8, 0x0000);
|
||||
@@ -1228,8 +1228,8 @@ void ec_master_receive_datagrams(
|
||||
cmd_follows = 1;
|
||||
while (cmd_follows) {
|
||||
// process datagram header
|
||||
datagram_type = EC_READ_U8 (cur_data);
|
||||
datagram_index = EC_READ_U8 (cur_data + 1);
|
||||
datagram_type = EC_READ_U8(cur_data);
|
||||
datagram_index = EC_READ_U8(cur_data + 1);
|
||||
data_size = EC_READ_U16(cur_data + 6) & 0x07FF;
|
||||
cmd_follows = EC_READ_U16(cur_data + 6) & 0x8000;
|
||||
cur_data += EC_DATAGRAM_HEADER_SIZE;
|
||||
@@ -1466,12 +1466,12 @@ void ec_master_nanosleep(const unsigned long nsecs)
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
hrtimer_start(&t.timer, hrtimer_get_expires(&t.timer), mode);
|
||||
|
||||
if (likely(t.task))
|
||||
if (likely(t.task)) {
|
||||
schedule();
|
||||
}
|
||||
|
||||
hrtimer_cancel(&t.timer);
|
||||
mode = HRTIMER_MODE_ABS;
|
||||
|
||||
} while (t.task && !signal_pending(current));
|
||||
}
|
||||
|
||||
@@ -1540,7 +1540,6 @@ void ec_master_exec_slave_fsms(
|
||||
|
||||
while (master->fsm_exec_count < EC_EXT_RING_SIZE / 2
|
||||
&& count < master->slave_count) {
|
||||
|
||||
if (ec_fsm_slave_is_ready(&master->fsm_slave->fsm)) {
|
||||
datagram = ec_master_get_external_datagram(master);
|
||||
|
||||
@@ -1660,7 +1659,6 @@ static int ec_master_operation_thread(void *priv_data)
|
||||
* https://gitlab.com/etherlab.org/ethercat/-/work_items/168 */
|
||||
seq_rt = smp_load_acquire(&master->injection_seq_rt);
|
||||
if (seq_rt == master->injection_seq_fsm) { // was injected
|
||||
|
||||
// output statistics
|
||||
ec_master_output_stats(master);
|
||||
|
||||
@@ -2138,7 +2136,6 @@ void ec_master_find_dc_ref_clock(
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
master->dc_ref_clock = ref;
|
||||
@@ -2586,7 +2583,6 @@ int ecrt_master_deactivate(ec_master_t *master)
|
||||
for (slave = master->slaves;
|
||||
slave < master->slaves + master->slave_count;
|
||||
slave++) {
|
||||
|
||||
// set states for all slaves
|
||||
ec_slave_request_state(slave, EC_SLAVE_STATE_PREOP);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user