Skip to content

Instantly share code, notes, and snippets.

@goog
Created June 21, 2019 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goog/7bf5ec55139a3ed43e36be5b2eee318b to your computer and use it in GitHub Desktop.
Save goog/7bf5ec55139a3ed43e36be5b2eee318b to your computer and use it in GitHub Desktop.
#define EXIT_PR (*(volatile uint32_t *)0x40013C14)
rtems_isr EINT95_handler(rtems_vector_number vector)
{
if(EXIT_PR & 0x200)
{
printk("exit 9 hap\n");
int pin = STM32F4_GPIO_PIN(0,9); // pa9
bool val;
val = stm32f4_gpio_get_input(pin);
volatile int j = 20000;
for(; j > 0; j--) j = j;
//rtems_counter_delay_nanoseconds(5000000);
if(val == stm32f4_gpio_get_input(pin))
{
f_key_pressed = 1;
printk("key1\n");
}
EXIT_PR = (1<<9);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment