fix(UML-1582): Очередные багфиксы

This commit is contained in:
algin 2023-06-16 15:59:00 +03:00
parent b1f1cadcfc
commit 080b4f25c7
5 changed files with 18 additions and 12 deletions

View File

@ -99,11 +99,17 @@ void EthEcatPdoFMMU::process() {
std::vector<uint8_t> process_data(std::min(logical_full_length_write, logical_full_length_read));
free_rtos::Timer& ecat_timer = ecat_buffer_.get_ecat().get_ecat_timer();
ecat_timer.Wait();
read(0, process_data);
while(1) {
ecat_timer.Wait();
//DebugP_log("Tick !\r\n");
read(0, process_data);
read_write(0, 0, process_data);
//read(0, process_data);
/*
for(uint8_t& byte : process_data) {
DebugP_log("0x%01x", byte);
@ -113,7 +119,7 @@ void EthEcatPdoFMMU::process() {
process_read_queue(process_data.data(), process_data.size());
process_write_queue(process_data.data(), process_data.size());
write(0, process_data);
//write(0, process_data);
pdo_counter_++;
}

View File

@ -168,10 +168,10 @@ private:
address::Logical logical_write = fmmu_global_properties.logical_start_address + offset_write;
TDatagramWrite datagram_write{ {{logical_write}}, data... };
datagram_read + datagram_write;
auto queue = datagram_read + datagram_write;
do {
telegram.transfer(datagram_read);
telegram.transfer(queue);
} while(datagram_read.get_all_wkc() < 0x0001);
}

View File

@ -28,7 +28,7 @@ void EthEcat::Init(TEthMacPorts port_id) {
.clock_src_mux_addr = 0x430081B0u, // sysconfig
.int_num = 152u, // sysconfig
.int_priority = 4, // sysconfig
.period_us = 1000 ///400 microsec
.period_us = 125 /// microsec
};
ecat_timer_.Init(ecat_tmr_sett);

View File

@ -33,8 +33,14 @@ public:
}
custom_tuple<DataTypes&...> get(uint32_t timeout_ticks = SystemP_WAIT_FOREVER) {
int32_t sts;
ready_ = false;
sem_.pend(timeout_ticks);
sts = sem_.pend(timeout_ticks);
if(sts == SystemP_SUCCESS) {
ready_ = true;
}
return data_tuple_;
}
@ -44,7 +50,6 @@ public:
for_each(data_tuple_, functor);
ready_ = true;
sem_.post();
}
@ -53,7 +58,6 @@ public:
for_each(data_tuple_, functor);
ready_ = true;
sem_.post();
}

View File

@ -32,10 +32,6 @@ public:
virtual ~IEcatDatagram() { };
IEcatDatagram* get_next() {
return static_cast<IEcatDatagram*>(get_next());
}
queue::Queue<IEcatDatagram> operator+(IEcatDatagram &next) {
//DebugP_log((char*)"Coupling first pair\r\n");