Skip to content

Commit 7e06aa1

Browse files
authored
v2.7.0
v2.7.0
2 parents 5030467 + fbaef3a commit 7e06aa1

25 files changed

Lines changed: 615 additions & 67 deletions

File tree

Inc/HALAL/Models/Concepts/Concepts.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ struct total_sizeof<>{
9292
public:
9393
static constexpr size_t value = 0;
9494
};
95+
96+
template<class Type>
97+
concept Array = std::is_array<Type>::value;
98+
99+
template<class Type>
100+
concept NotArray = not Array<Type>;

Inc/HALAL/Models/Packets/PacketValue.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class PacketValue<string> : public PacketValue<>{
117117
}
118118
};
119119

120-
template<class Type,size_t N>
120+
template<class Type,size_t N>
121121
class PacketValue<Type(&)[N]>: public PacketValue<> {
122122
public:
123123
using value_type = Type;
@@ -140,12 +140,11 @@ class PacketValue<Type(&)[N]>: public PacketValue<> {
140140
};
141141

142142
#if __cpp_deduction_guides >= 201606
143-
template<class Type,size_t N>
143+
template<class Type,size_t N>
144144
PacketValue(Type(*)[N])->PacketValue<Type(&)[N]>;
145145
#endif
146146

147-
148-
template<class Type,size_t N>
147+
template<class Type,size_t N>
149148
class PacketValue<Type*(&)[N]>: public PacketValue<> {
150149
public:
151150
using value_type = Type*;

Inc/HALAL/Models/TimerPeripheral/TimerPeripheral.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,17 @@ class TimerPeripheral {
4747
struct InitData {
4848
private:
4949
InitData() = default;
50-
5150
public:
5251
uint32_t prescaler;
5352
uint32_t period;
5453
uint32_t deadtime;
54+
uint32_t polarity;
55+
uint32_t negated_polarity;
5556
TIM_TYPE type;
5657
vector<PWMData> pwm_channels = {};
5758
vector<pair<uint32_t, uint32_t>> input_capture_channels = {};
5859
InitData(TIM_TYPE type, uint32_t prescaler = 5,
59-
uint32_t period = 55000, uint32_t deadtime = 0);
60+
uint32_t period = 55000, uint32_t deadtime = 0, uint32_t polarity = TIM_OCPOLARITY_HIGH, uint32_t negated_polarity = TIM_OCPOLARITY_HIGH);
6061
};
6162

6263
TIM_HandleTypeDef* handle;

Inc/HALAL/Services/Communication/Ethernet/TCP/ServerSocket.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ class ServerSocket : public OrderProtocol{
7777

7878
void send();
7979

80+
bool is_connected();
81+
8082
private:
8183

8284
static err_t accept_callback(void* arg, struct tcp_pcb* incomming_control_block, err_t error);

Inc/HALAL/Services/Communication/Ethernet/TCP/Socket.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class Socket : public OrderProtocol{
7575

7676
void process_data();
7777

78+
bool is_connected();
79+
7880
static err_t connect_callback(void* arg, struct tcp_pcb* client_control_block, err_t error);
7981
static err_t receive_callback(void* arg, struct tcp_pcb* client_control_block, struct pbuf* packet_buffer, err_t error);
8082
static err_t poll_callback(void* arg, struct tcp_pcb* client_control_block);

Inc/HALAL/Services/PWM/DualPWM/DualPWM.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ class DualPWM : virtual public PWM {
1616
DualPWM(Pin& pin, Pin& pin_negated);
1717

1818
void turn_on();
19+
void turn_on_positive();
20+
void turn_on_negated();
1921
void turn_off();
22+
void turn_off_positive();
23+
void turn_off_negated();
2024

2125
friend class DualPhasedPWM;
2226
};

Inc/ST-LIB_HIGH/Control/Blocks/Derivator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class SimpleDerivator : public ControlBlock<double,double>{
5757
double buffer[N] = {0.0};
5858
int index = 0;
5959
public:
60-
SimpleDerivator(double period): ControlBlock<double,double>(0.0), period(period){}
60+
SimpleDerivator(double period): ControlBlock<double,double>(0.0), period(period){ output_value = 0.0;}
6161
void execute()override{
6262
buffer[index] = input_value;
6363
output_value = (buffer[index] - buffer[((index-1)%(N) + (N))%(N)])/period;

Inc/ST-LIB_HIGH/Control/Blocks/Integrator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Integrator<IntegratorType::Trapezoidal> : public ControlBlock<double,doubl
2323
double ki;
2424
bool first_execution = true;
2525
public:
26-
Integrator(double period, double ki):ControlBlock<double,double>(0.0), period(period), ki(ki){}
26+
Integrator(double period, double ki):ControlBlock<double,double>(0.0), period(period), ki(ki){output_value = 0.0;}
2727
void execute() override {
2828
buffer[index] = input_value;
2929
if(first_execution){
@@ -98,7 +98,7 @@ class Integrator<IntegratorType::BackwardEuler>: public ControlBlock<double,doub
9898
double ki;
9999
bool first_execution = true;
100100
public:
101-
Integrator(double period, double ki):ControlBlock<double,double>(0.0), period(period), ki(ki) {}
101+
Integrator(double period, double ki):ControlBlock<double,double>(0.0), period(period), ki(ki) {output_value = 0.0;}
102102
void execute() override {
103103
buffer[index] = input_value;
104104
if(first_execution){

Inc/ST-LIB_HIGH/Control/Blocks/MovingAverage.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include "stdio.h"
44
#include "../ControlSystem.hpp"
55

6-
double computeMA(double input_value);
7-
86
template<size_t N>
97
class MovingAverage : public ControlBlock<double,double> {
108
private:

Inc/ST-LIB_HIGH/Protections/ProtectionManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ProtectionManager {
5050
static constexpr uint16_t fault_id = 2;
5151
static char* message;
5252
static size_t message_size;
53-
static constexpr const char* format = "{\"boardId\": %s, \"timestamp\":{%s}, %s}";
53+
static constexpr const char* format = "{\"boardId\": %s, \"timestamp\":{%s}, %s}\0";
5454

5555
static Boards::ID board_id;
5656
static vector<Protection> low_frequency_protections;

0 commit comments

Comments
 (0)