fix(SF-33): Очередные правки со стенда

This commit is contained in:
algin 2023-09-20 15:52:57 +03:00
parent 4273fcd70b
commit 39ef0906b7
5 changed files with 23 additions and 7 deletions

View File

@ -168,6 +168,10 @@ void free_rtos::Eth::link_task()
{
for (int i = 0; i < macPortNum_; ++i)
{
if(linkUp_[i] == true) {
continue;
}
macPort = macPort_[i];
linkUp = false;
@ -248,7 +252,7 @@ void free_rtos::Eth::link_task()
}
ClockP_usleep(100000); // 100ms /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 10<31><30> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
ClockP_usleep(1000000); // 100ms /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 10<31><30> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
}
}

View File

@ -28,6 +28,7 @@ void EthEcatPdoFMMU::init(ProcessCallback callback) {
bool EthEcatPdoFMMU::wait_op() {
free_rtos::Semaphore& init_sem = ecat_buffer_.get_ecat().get_init_sem();
free_rtos::Semaphore& process_sem = ecat_buffer_.get_ecat().get_process_sem();
free_rtos::Timer& ecat_timer = ecat_buffer_.get_ecat().get_ecat_timer();
process_sem.pend();
@ -55,6 +56,8 @@ bool EthEcatPdoFMMU::wait_op() {
process_sem.pend();
for(uint32_t i = 0; i < 250; i++) {
ecat_timer.Wait();
status = read_write(0, data_tuple_read, 0, data_tuple_write);
if(status != true) {
@ -63,6 +66,7 @@ bool EthEcatPdoFMMU::wait_op() {
}
init_sem.post();
process_sem.pend();
return status;
}

View File

@ -295,8 +295,12 @@ bool EthEcat::safeop_to_op() {
uint16_t zero{0x00000000};
bool status;
ecat_timer_.Start();
process_sem_.post();
if(init_sem_.pend(process_timeout_ticks_) != SystemP_SUCCESS) {
DebugP_log((char*)"Process task timeout !\r\n");
return false;
}
@ -313,6 +317,8 @@ bool EthEcat::safeop_to_op() {
process_sem_.post();
if(init_sem_.pend(process_timeout_ticks_) != SystemP_SUCCESS) {
DebugP_log((char*)"Process task timeout !\r\n");
return false;
}
@ -326,16 +332,18 @@ bool EthEcat::safeop_to_op() {
}
}
//DebugP_log((char*)"stat.state = %d, stat.fault = %d\r\n", stat.state, stat.fault);
status = (stat.state == EC_STATE_OPERATIONAL) && (stat.fault == 0);
if(status == true) {
ecat_timer_.Start();
if(status != true) {
DebugP_log((char*)"stat.state = %d, stat.fault = %d\r\n", stat.state, stat.fault);
return status;
}
//DebugP_log((char*)"success = %d\r\n", success);
process_sem_.post();
return status;
}

View File

@ -248,7 +248,7 @@ private:
e_pktTotal
};
static constexpr uint32_t process_timeout_ticks_ = 100;
static constexpr uint32_t process_timeout_ticks_ = 5000;
free_rtos::Timer ecat_timer_;

View File

@ -74,7 +74,7 @@ public:
bool transfer(queue::Queue<datagram::IEcatDatagram>& next);
private:
static constexpr uint32_t connection_timeout_ticks_ = 50;
static constexpr uint32_t connection_timeout_ticks_ = 200;
static constexpr uint32_t max_transfer_attempts_ = 2;
Eth& eth_;