Skip to content

Commit 6bc6308

Browse files
committed
fix ethernet bug
1 parent 54734ad commit 6bc6308

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Inc/ST-LIB_HIGH/Protections/Boundary.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct Boundary<Type, ABOVE> : public BoundaryInterface{
7777
template<class Type>
7878
struct Boundary<Type, EQUALS> : public BoundaryInterface{
7979
static constexpr ProtectionType Protector = EQUALS;
80-
static constexpr const char* format = "\"type\": \"EQUALS\", \"data\": { \"value\": %s, \"bound\": %s }";
80+
static constexpr const char* format = "\"type\": \"EQUALS\", \"data\": { \"value\": %s }";
8181
Type* src = nullptr;
8282
Type boundary;
8383
Boundary(Type boundary): boundary(boundary){};
@@ -99,7 +99,7 @@ struct Boundary<Type, EQUALS> : public BoundaryInterface{
9999
template<class Type>
100100
struct Boundary<Type, NOT_EQUALS> : public BoundaryInterface{
101101
static constexpr ProtectionType Protector = NOT_EQUALS;
102-
static constexpr const char* format = "\"type\": \"NOT_EQUALS\", \"data\": { \"value\": %s, \"bound\": %s }";
102+
static constexpr const char* format = "\"type\": \"NOT_EQUALS\", \"data\": { \"value\": %s, \"want\": %s }";
103103
Type* src = nullptr;
104104
Type boundary;
105105
Boundary(Type boundary): boundary(boundary){};
@@ -144,6 +144,8 @@ template<>
144144
struct Boundary<void, ERROR_HANDLER> : public BoundaryInterface{
145145
static constexpr ProtectionType Protector = ERROR_HANDLER;
146146
static constexpr const char* format = "\"type\": \"ERROR_HANDLER\", \"data\": %s ";
147+
Boundary(void*){}
148+
Boundary(void*, Boundary<void,ERROR_HANDLER>){}
147149
Boundary() = default;
148150
bool check_bounds() override{
149151
return ErrorHandlerModel::error_triggered;

Src/HALAL/Services/Communication/Ethernet/Ethernet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ void Ethernet::inscribe(){
8989
Pin::inscribe(PC4, ALTERNATIVE);
9090
Pin::inscribe(PC5, ALTERNATIVE);
9191
Pin::inscribe(PG11, ALTERNATIVE);
92+
Pin::inscribe(PG0, ALTERNATIVE);
9293
Pin::inscribe(PG13, ALTERNATIVE);
9394
mpu_start();
9495
SCB_EnableICache();

Src/ST-LIB_HIGH/Protections/ProtectionManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Notification ProtectionManager::fault_notification = {ProtectionManager::fault_i
77
Notification ProtectionManager::warning_notification = {ProtectionManager::warning_id, nullptr};
88

99
void ProtectionManager::set_id(BoardID board_id){
10+
add_protection((void*)nullptr,Boundary<void, ProtectionType::ERROR_HANDLER>());
1011
ProtectionManager::board_id = board_id;
1112
}
1213

@@ -39,8 +40,10 @@ void ProtectionManager::check_protections() {
3940
switch(protection.fault_type){
4041
case FaultType::WARNING:
4142
warning_notification.notify(message);
43+
break;
4244
case FaultType::FAULT:
4345
fault_notification.notify(message);
46+
break;
4447
default:
4548
ErrorHandler("Protection has not a Fault Type that can be handled correctly by the ProtectionManager");
4649
}

0 commit comments

Comments
 (0)