diff --git a/props/dual_prop.h b/props/dual_prop.h index 1afc48852..5423a72b4 100644 --- a/props/dual_prop.h +++ b/props/dual_prop.h @@ -26,9 +26,7 @@ Give the BladeConfig 2 sets of descriptions, and */ -#ifndef DUAL_PROP_CONDITION -#define DUAL_PROP_CONDITION blade_detected_ -#endif +#define DUAL_PROP_CONDITION blade_present() #ifdef PROP_INHERIT_PREFIX #error dual_prop.h must be included first diff --git a/props/prop_base.h b/props/prop_base.h index f62ca7587..fbb7c427d 100644 --- a/props/prop_base.h +++ b/props/prop_base.h @@ -544,6 +544,13 @@ class PropBase : CommandParser, Looper, protected SaberBase { bool blade_detected_ = false; #endif + // Use this helper function, not the bool above. + // This function changes when we're properly initialized + // the blade, the bool is an internal to blade detect. + bool blade_present() { + return current_config->ohm < NO_BLADE; + } + // Measure and return the blade identifier resistor. float id() { EnableBooster(); @@ -609,7 +616,14 @@ class PropBase : CommandParser, Looper, protected SaberBase { void PollScanId() { if (find_blade_again_pending_) { find_blade_again_pending_ = false; + bool blade_present_before = blade_present(); FindBladeAgain(); + bool blade_present_after = blade_present(); + if (blade_present_before != blade_present_after) { + SaberBase::DoBladeDetect(blade_present_after); + } else { + SaberBase::DoNewFont(); + } } } #else