Skip to content

Commit

Permalink
add ChipSat IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-goddard committed Mar 22, 2024
1 parent 014ad15 commit 1db6204
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
platform = atmelavr
framework = arduino
board = atmega328p
build_flags = -D VERBOSE
build_flags =
-D VERBOSE
-D CHIPSAT_ID=2
upload_protocol = custom
upload_speed = 19200
upload_command = avrdude -C /Users/camerongoddard/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -P /dev/cu.usbmodem21301 -b 19200 -v -V -p atmega328p -c stk500v1 $UPLOAD_FLAGS -U flash:w:$SOURCE:i
upload_command = avrdude -C /Users/camerongoddard/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -P /dev/cu.usbmodem11301 -b 19200 -v -V -p atmega328p -c stk500v1 $UPLOAD_FLAGS -U flash:w:$SOURCE:i
2 changes: 1 addition & 1 deletion src/ControlTasks/RadioControlTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ bool RadioControlTask::executeDownlink()
uint16_t alt = sfr::gps::altitude / 10;

uint8_t flags = 0;
flags |= constants::radio::chipsat_id << 6;
flags |= constants::radio::id << 6;
flags |= sfr::gps::valid_msg << 5; // gps valid
flags |= sfr::imu::initialized << 4; // imu valid
flags |= sfr::gps::on << 3; // boot mode flag
Expand Down
7 changes: 6 additions & 1 deletion src/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ namespace constants {
constexpr int pl = 8;
constexpr int gn = 0;

constexpr int chipsat_id = 1;
#ifdef CHIPSAT_ID
constexpr int id = CHIPSAT_ID;
#else
constexpr int id = 0;
#endif


} // namespace radio
namespace imu {
Expand Down

0 comments on commit 1db6204

Please sign in to comment.