Commit 92cb1b8b authored by liubryan's avatar liubryan
Browse files

remapped buttons

parent bfb254bd
......@@ -2,6 +2,11 @@
#include "drivers/mss_gpio/mss_gpio.h"
#include "drivers/CoreUARTapb/core_uart_apb.h"
extern uint8_t arrow_pos;
extern uint8_t tab_state;
extern uint8_t is_selecting;
extern uint8_t mouse_map[160][110];
/*
uint8_t total_progress = 0;
......@@ -34,41 +39,55 @@ uint8_t tab_state = 0;
void __attribute__ ((interrupt)) GPIO0_IRQHandler( void )
{
//UART_send(&g_uart,"B1\r\n",sizeof("B1\r\n"));
arrow_pos = (arrow_pos == 2) ? 2 : arrow_pos+1;
update_selection(arrow_pos);
delay();
MSS_GPIO_clear_irq( MSS_GPIO_0 ); //clear interrupt and resume
if (is_selecting) {
arrow_pos = (arrow_pos == 0) ? 0 : arrow_pos-1;
update_selection(arrow_pos);
}
delay(3000000);
MSS_GPIO_clear_irq( MSS_GPIO_0 ); //clear interrupt and resume
}
void __attribute__ ((interrupt)) GPIO1_IRQHandler( void )
{
//UART_send(&g_uart,"B2\r\n",sizeof("B2\r\n"));
delay();
delay(3000000);
MSS_GPIO_clear_irq( MSS_GPIO_1 ); //clear interrupt and resume
}
void __attribute__ ((interrupt)) GPIO2_IRQHandler( void )
{
UART_send(&g_uart,arrowPos,1);
//PICK DESIGN AND GO TO LOADING SCREEN
display_inprogress();
delay();
//UART_send(&g_uart,"B3\r\n",sizeof("B3\r\n"));
if (is_selecting) {
//PICK DESIGN AND GO TO LOADING SCREEN
is_selecting = 0;
init_tabs();
display_inprogress();
} else {
tab_state = (tab_state == 0) ? 1 : 0;
toggle_view();
}
delay(3000000);
MSS_GPIO_clear_irq( MSS_GPIO_2 ); //clear interrupt and resume
}
void __attribute__ ((interrupt)) GPIO3_IRQHandler( void )
{
//UART_send(&g_uart,"B4\r\n",sizeof("B4\r\n"));
arrow_pos = (arrow_pos == 0) ? 0 : arrow_pos-1;
update_selection(arrow_pos);
delay();
if (is_selecting) {
arrow_pos = (arrow_pos == 2) ? 2 : arrow_pos+1;
update_selection(arrow_pos);
}
delay(3000000);
MSS_GPIO_clear_irq( MSS_GPIO_3 ); //clear interrupt and resume
}
void __attribute__ ((interrupt)) GPIO4_IRQHandler( void )
{
//UART_send(&g_uart,"B5\r\n",sizeof("B5\r\n"));
tab_state = (tab_state == 0) ? 1 : 0;
toggle_view(tab_state);
delay();
delay(3000000);
MSS_GPIO_clear_irq( MSS_GPIO_4 ); //clear interrupt and resume
}
void uart1_rx_handler( mss_uart_instance_t * this_uart )
{
int i=0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment