Skip to content

Commit

Permalink
pull out version and move configs
Browse files Browse the repository at this point in the history
  • Loading branch information
zjwhitehead committed Apr 20, 2024
1 parent b129f07 commit 2594bb6
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 33 deletions.
32 changes: 32 additions & 0 deletions inc/sp140/rp2040-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,36 @@ struct HardwareConfig {
bool enable_vib;
};


// V2 configuration
HardwareConfig v2_config = {
.button_top = 7,
.buzzer_pin = 2,
.led_sw = LED_BUILTIN,
.throttle_pin = A2,
.serial_esc = &Serial1,
.tft_rst = 6,
.tft_cs = 4,
.tft_dc = 5,
.tft_lite = A3,
.esc_pin = 3,
.enable_vib = true
};

// V1 configuration
HardwareConfig v1_config = {
.button_top = 15,
.buzzer_pin = 10,
.led_sw = 12,
.throttle_pin = A0,
.bmp_pin = 9,
.serial_esc = &Serial1,
.tft_rst = 5,
.tft_cs = 13,
.tft_dc = 11,
.tft_lite = 25,
.esc_pin = 14,
.enable_vib = false
};

#endif // INC_SP140_RP2040_CONFIG_H_
4 changes: 2 additions & 2 deletions inc/sp140/shared-config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Copyright 2021 <Zach Whitehead>
#include "../version.h"

#ifndef INC_SP140_SHARED_CONFIG_H_
#define INC_SP140_SHARED_CONFIG_H_

Expand All @@ -9,8 +11,6 @@
#define MAMP_OFFSET 200
#define VOLT_OFFSET 1.5

#define VERSION_MAJOR 6
#define VERSION_MINOR 1

#define CRUISE_GRACE 1.5 // 1.5 sec period to get off throttle
#define POT_SAFE_LEVEL 0.05 * 4096 // 5% or less
Expand Down
5 changes: 5 additions & 0 deletions inc/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright <Zach Whitehead>
#pragma once

#define VERSION_MAJOR 6
#define VERSION_MINOR 1
2 changes: 1 addition & 1 deletion src/sp140/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <Fonts/FreeSansBold12pt7b.h>

#include "../../inc/sp140/rp2040-config.h" // device config
#include "../../inc/version.h"
#include "sp140/structs.h"

// DEBUG WATCHDOG
Expand Down
30 changes: 0 additions & 30 deletions src/sp140/sp140.ino
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,6 @@ TaskHandle_t watchdogTaskHandle = NULL;
SemaphoreHandle_t eepromSemaphore;
SemaphoreHandle_t tftSemaphore;

// V2 configuration
HardwareConfig v2_config = {
.button_top = 7,
.buzzer_pin = 2,
.led_sw = LED_BUILTIN,
.throttle_pin = A2,
.serial_esc = &Serial1,
.tft_rst = 6,
.tft_cs = 4,
.tft_dc = 5,
.tft_lite = A3,
.esc_pin = 3,
.enable_vib = true
};

// V1 configuration
HardwareConfig v1_config = {
.button_top = 15,
.buzzer_pin = 10,
.led_sw = 12,
.throttle_pin = A0,
.bmp_pin = 9,
.serial_esc = &Serial1,
.tft_rst = 5,
.tft_cs = 13,
.tft_dc = 11,
.tft_lite = 25,
.esc_pin = 14,
.enable_vib = false
};

#pragma message "Warning: OpenPPG software is in beta"

Expand Down

0 comments on commit 2594bb6

Please sign in to comment.