Skip to content

Commit

Permalink
Adds railcom driver middle-cutout hook (#439)
Browse files Browse the repository at this point in the history
Adds a hook to the Tiva railcom driver that calls a hardware-specific function
in the middle of the cutout, between the two windows.
  • Loading branch information
balazsracz authored Oct 8, 2020
1 parent abba7dd commit 7f67efb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions boards/bracz-railcom/hardware.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ struct RailcomDefs
static bool need_ch1_cutout() {
return true;
}
static void middle_cutout_hook() {}

static void enable_measurement(bool);
static void disable_measurement();
Expand Down
3 changes: 2 additions & 1 deletion boards/ti-bracz-acc3/hardware.v3.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ struct RailcomHw

static bool need_ch1_cutout() { return true; }
static uint8_t get_feedback_channel() { return 0xff; }

static void middle_cutout_hook() {}

/// @returns a bitmask telling which pins are active. Bit 0 will be set if
/// channel 0 is active (drawing current).
static uint8_t sample() {
Expand Down
1 change: 1 addition & 0 deletions boards/ti-ek-tm4c123gxl-launchpad/HwInit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ struct RailcomDefs
static void disable_measurement() {}
static bool need_ch1_cutout() { return true; }
static uint8_t get_feedback_channel() { return 0xff; }
static void middle_cutout_hook() {}

/** @returns a bitmask telling which pins are active. Bit 0 will be set if
* channel 0 is active (drawing current).*/
Expand Down
1 change: 1 addition & 0 deletions src/freertos_drivers/ti/TivaRailcom.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ private:
}
HWREG(HW::UART_BASE[i] + UART_O_CTL) |= UART_CTL_RXE;
}
HW::middle_cutout_hook();
Debug::RailcomDriverCutout::set(true);
}

Expand Down

0 comments on commit 7f67efb

Please sign in to comment.