void WhoAmI(void) { PrintS(BR_DEVICE_NAME); PrintF("Msp430 Rev:%c HwVer:%d", GetMsp430HardwareRevision(), HardwareVersion()); PrintF("BoardConfig: %d", GetBoardConfiguration()); PrintF("Calibration: %d", ValidCalibration()); PrintF("Errata: %d", Errata()); }
/* this function probably belongs somewhere else */ void WhoAmI(void) { extern const char BUILD[]; extern const char VERSION[]; PrintString3("Version: ", VERSION,CR); PrintString3("Build: ", BUILD,CR); tVersion Version = GetWrapperVersion(); PrintString3("Wrapper: ", Version.pSwVer,CR); PrintString2(SPP_DEVICE_NAME,CR); PrintString("Msp430 Version "); PrintCharacter(GetMsp430HardwareRevision()); PrintString(CR); PrintStringAndDecimal("HwVersion: ", HardwareVersion()); }
HardwareVersion detectHardwareVersion() { auto v = HardwareVersion(); v.major = HW_VERSION_MAJOR; if (palReadPad(GPIO_PORT_HWID, GPIO_PIN_HWID_BIT0)) { v.minor += 1; } if (!palReadPad(GPIO_PORT_HWID, GPIO_PIN_HWID_BIT1_INVERSE)) { v.minor += 2; } if (palReadPad(GPIO_PORT_HWID, GPIO_PIN_HWID_BIT2)) { v.minor += 4; } return v; }