Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include <math.h>
- #include <stdlib.h>
- #include "rtems.h"
- #include <rtems/irq-extension.h>
- #include "exti.h"
- #include "driver_name.h"
- extern void task_config_drivers(void);
- extern void *get_driver_from_list(enum driver_name name);
- extern void EXTI15_10_IRQHandler(void);
- static rtems_id exti_task_id;
- void exti_test_callback(void)
- {
- printf("%s\n", __FUNCTION__);
- rtems_status_code status = rtems_event_send(exti_task_id, RTEMS_EVENT_0);
- if(status != RTEMS_SUCCESSFUL) {
- printk("failed with %d\n", status);
- }
- }
- rtems_task hello_world(__attribute__((unused)) rtems_task_argument argument)
- {
- exti_task_id = rtems_task_self();
- task_config_drivers();
- struct exti_driver *exti = get_driver_from_list(EXTI_TEST);
- exti_driver_config(exti, NULL);
- rtems_status_code status;
- const char *exti_test_msg = "exti test";
- status = rtems_interrupt_handler_install(
- (rtems_vector_number) EXTI15_10_IRQn,
- exti_test_msg,
- RTEMS_INTERRUPT_UNIQUE,
- (rtems_interrupt_handler) EXTI15_10_IRQHandler,
- NULL);
- if (status != RTEMS_SUCCESSFUL) {
- printk("interrupt handler install 2 failed with %d\n", status);
- }
- exti->irq_en(exti);
- while(true) {
- printf("%d\n", __LINE__);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment