Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for railcom board. #458

Merged
merged 1 commit into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards/bracz-railcom/HwInit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const uint32_t RailcomDefs::UART_PERIPH[] = RAILCOM_PERIPH;
TivaDAC<DACDefs> dac;
TivaGNDControl gnd_control;
TivaBypassControl bypass_control;

unsigned DCCDecode::sampleCount_ = 0;
uint8_t RailcomDefs::feedbackChannel_ = 0xff;
uint8_t dac_next_packet_mode = 0;

Expand Down
6 changes: 4 additions & 2 deletions boards/bracz-railcom/hardware.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,6 @@ struct DCCDecode
HWREG(TIMER_BASE + TIMER_O_TAMR) |= (TIMER_TAMR_TAMIE);
}

static void cap_event_hook() {}

static const auto RCOM_TIMER = TIMER_A;
static const auto SAMPLE_PERIOD_CLOCKS = 60000;
//static const auto SAMPLE_TIMER_TIMEOUT = TIMER_TIMA_TIMEOUT;
Expand All @@ -470,6 +468,10 @@ struct DCCDecode
static inline void dcc_before_cutout_hook();
static inline void dcc_packet_finished_hook();
static inline void after_feedback_hook();

/// counts how many edges / transitions we had on the DCC signal.
static unsigned sampleCount_;
static inline void cap_event_hook() { ++sampleCount_; }
};

#endif // ! pindefs_only
Expand Down