Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsharith
373 Mobile 3D Printing
Commits
92cb1b8b
Commit
92cb1b8b
authored
Apr 23, 2019
by
liubryan
Browse files
remapped buttons
parent
bfb254bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
LCD_DISPLAY_FINAL/SoftConsole/MSS_LCD_MSS_CM3_0/MSS_LCD_MSS_CM3_0_app/main.c
View file @
92cb1b8b
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment