Skip to content

Commit 9965ed2

Browse files
committed
added ros1 code for power and fixed header gaurds
1 parent 308c724 commit 9965ed2

File tree

12 files changed

+265
-0
lines changed

12 files changed

+265
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
#ifdef ACTUATOR_H
2+
13
#include <Arduino.h>
24

35
void actuator_setup();
46
void actuator_loop();
7+
8+
#endif
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
#ifdef DISPLAY_H
2+
13
#include <Arduino.h>
24

35
void display_setup();
46
void display_loop();
7+
8+
#endif

pio_workspace/include/power_main.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
#ifdef POWER_H
2+
13
#include <Arduino.h>
24

35
void power_setup();
46
void power_loop();
7+
8+
#endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifdef POWER_ROS1_H
2+
3+
#include <Arduino.h>
4+
5+
void power_ros1_setup();
6+
void power_ros1_loop();
7+
8+
#endif

pio_workspace/lib/power_custom/ThrusterControl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifdef POWER_H
2+
13
#include "ThrusterControl.h"
24

35
// Initialize thrusters
@@ -29,3 +31,5 @@ void updateThrusters(const int16_t microseconds[8]) {
2931
thrusters[i].writeMicroseconds(microseconds[i]);
3032
}
3133
}
34+
35+
#endif

pio_workspace/lib/power_custom/ThrusterControl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifdef POWER_H
2+
13
#ifndef THRUSTER_CONTROL_H
24
#define THRUSTER_CONTROL_H
35

@@ -28,3 +30,5 @@ void initThrusters();
2830
void updateThrusters(const int16_t microseconds[8]);
2931

3032
#endif
33+
34+
#endif

pio_workspace/platformio.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ build_flags =
4343
${env.build_flags}
4444
#upload_protocol = teensy-cli
4545
upload_port = /dev/power
46+
47+
[env:power_ros1]
48+
platform = teensy
49+
board = teensy40
50+
framework = arduino
51+
build_flags =
52+
-D POWER_ROS1_H
53+
${env.build_flags}
54+
#upload_protocol = teensy-cli
55+
upload_port = /dev/power

pio_workspace/src/actuator_main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifdef ACTUATOR_H
2+
13
#include "actuator_main.h"
24

35
void actuator_setup(){
@@ -7,3 +9,5 @@ void actuator_setup(){
79
void actuator_loop(){
810
// put your main code here, to run repeatedly:
911
}
12+
13+
#endif

pio_workspace/src/display_main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifdef DISPLAY_H
2+
13
#include "display_main.h"
24

35
void display_setup(){
@@ -7,3 +9,5 @@ void display_setup(){
79
void display_loop(){
810
// put your main code here, to run repeatedly:
911
}
12+
13+
#endif

pio_workspace/src/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include "display_main.h"
77
#elif POWER_H
88
#include "power_main.h"
9+
#elif POWER_ROS1_H
10+
#include "power_ros1_main.h"
911
#endif
1012

1113
void setup() {
@@ -15,6 +17,8 @@ void setup() {
1517
display_setup();
1618
#elif POWER_H
1719
power_setup();
20+
#elif POWER_ROS1_H
21+
power_ros1_setup();
1822
#endif
1923
}
2024

@@ -25,5 +29,7 @@ void loop() {
2529
display_loop();
2630
#elif POWER_H
2731
power_loop();
32+
#elif POWER_ROS1_H
33+
power_ros1_loop();
2834
#endif
2935
}

0 commit comments

Comments
 (0)