Target power option is only for versions > 0

This commit is contained in:
Richard Eoin Meadows 2014-05-28 12:33:43 +01:00
parent c9089f5851
commit 42e41edfa1
1 changed files with 7 additions and 2 deletions

View File

@ -154,11 +154,16 @@ void platform_srst_set_val(bool assert)
} }
} }
bool platform_target_get_power(void) { bool platform_target_get_power(void) {
return gpio_get(PWR_BR_PORT, PWR_BR_PIN); if (platform_hwversion() > 0) {
return gpio_get(PWR_BR_PORT, PWR_BR_PIN);
}
return 1; // 1 = Unpowered
} }
void platform_target_set_power(bool power) void platform_target_set_power(bool power)
{ {
gpio_set_val(PWR_BR_PORT, PWR_BR_PIN, !power); if (platform_hwversion() > 0) {
gpio_set_val(PWR_BR_PORT, PWR_BR_PIN, !power);
}
} }
void platform_delay(uint32_t delay) void platform_delay(uint32_t delay)
{ {