Skip to content

Commit c74ecf8

Browse files
committed
initial wip
1 parent d954dc5 commit c74ecf8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1500
-323
lines changed

boards/varmint_h7/common/CommonConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ extern TIM_HandleTypeDef htim7;
149149
extern TIM_HandleTypeDef htim8;
150150
extern TIM_HandleTypeDef htim12;
151151
extern TIM_HandleTypeDef htim15;
152+
extern TIM_HandleTypeDef htim17;
152153

153154
extern UART_HandleTypeDef huart1;
154155
extern UART_HandleTypeDef huart2;

boards/varmint_h7/common/Varmint.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ bool Varmint::sonar_read(rosflight_firmware::RangeStruct * range)
221221
return false;
222222
}
223223

224+
///////////////////////////////////////////////////////////////////////////////////////////////
225+
// Optical Flow Sensor
226+
bool Varmint::flow_read(rosflight_firmware::OpticalFlowStruct * oflow)
227+
{
228+
if (range_.read((uint8_t *) oflow, sizeof(rosflight_firmware::OpticalFlowStruct))) {
229+
return true;
230+
}
231+
232+
return false;
233+
}
234+
224235
///////////////////////////////////////////////////////////////////////////////////////////////
225236
// Battery
226237
bool Varmint::battery_read(rosflight_firmware::BatteryStruct * batt)

boards/varmint_h7/common/Varmint.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#include "Ubx.h"
5858
#include "Vcp.h"
5959
#include "Lidarlitev3hp.h"
60+
#include "Pmw3901.h"
6061
#include "interface/board.h"
6162

6263
/*
@@ -123,6 +124,8 @@ class Varmint : public rosflight_firmware::Board
123124

124125
bool sonar_read(rosflight_firmware::RangeStruct * sonar) override;
125126

127+
bool flow_read(rosflight_firmware::OpticalFlowStruct * flow) override;
128+
126129
// Battery
127130
bool battery_read(rosflight_firmware::BatteryStruct * bat) override;
128131
void battery_voltage_set_multiplier(double multiplier) override;

boards/varmint_h7/common/drivers/Mpu.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void MpuConfig(void)
4747
HAL_MPU_Disable();
4848

4949
/** Initializes and configures the Region and the memory to be protected
50+
* SRAM3
5051
*/
5152
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
5253
MPU_InitStruct.Number = MPU_REGION_NUMBER0;
@@ -63,6 +64,7 @@ void MpuConfig(void)
6364
HAL_MPU_ConfigRegion(&MPU_InitStruct);
6465

6566
/** Initializes and configures the Region and the memory to be protected
67+
* SRAM4
6668
*/
6769
MPU_InitStruct.Number = MPU_REGION_NUMBER1;
6870
MPU_InitStruct.BaseAddress = 0x38000000;

boards/varmint_h7/common/drivers/Packets.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,6 @@ typedef struct //__attribute__((__packed__))
118118
} GnssPacket;
119119

120120
typedef rosflight_firmware::RangeStruct RangePacket;
121+
typedef rosflight_firmware::OpticalFlowStruct OpticalFlowPacket;
121122

122123
#endif /* DRIVERPACKETS_H_ */

0 commit comments

Comments
 (0)