samd: srst_get_val now actually works
This commit is contained in:
parent
100fc2e7d4
commit
5c835bc0f6
@ -196,20 +196,24 @@ void platform_init(void)
|
|||||||
button_init();
|
button_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t srst_state;
|
||||||
void platform_srst_set_val(bool assert)
|
void platform_srst_set_val(bool assert)
|
||||||
{
|
{
|
||||||
volatile int i;
|
volatile int i;
|
||||||
if (!assert) {
|
if (!assert) {
|
||||||
gpio_clear(SRST_PORT, SRST_PIN);
|
gpio_clear(SRST_PORT, SRST_PIN);
|
||||||
for(i = 0; i < 10000; i++) asm("nop");
|
for(i = 0; i < 10000; i++) asm("nop");
|
||||||
|
srst_state = 0;
|
||||||
} else {
|
} else {
|
||||||
gpio_set(SRST_PORT, SRST_PIN);
|
gpio_set(SRST_PORT, SRST_PIN);
|
||||||
|
srst_state = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool platform_srst_get_val(void)
|
bool platform_srst_get_val(void)
|
||||||
{
|
{
|
||||||
return gpio_get(SRST_PORT, SRST_PIN) != 0;
|
//return gpio_get(SRST_PORT, SRST_PIN) != 0;
|
||||||
|
return srst_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool platform_target_get_power(void)
|
bool platform_target_get_power(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user