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,12 +154,17 @@ void platform_srst_set_val(bool assert)
} }
} }
bool platform_target_get_power(void) { bool platform_target_get_power(void) {
if (platform_hwversion() > 0) {
return gpio_get(PWR_BR_PORT, PWR_BR_PIN); 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)
{ {
if (platform_hwversion() > 0) {
gpio_set_val(PWR_BR_PORT, PWR_BR_PIN, !power); gpio_set_val(PWR_BR_PORT, PWR_BR_PIN, !power);
} }
}
void platform_delay(uint32_t delay) void platform_delay(uint32_t delay)
{ {
timeout_counter = delay; timeout_counter = delay;