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
fb6d782d
Commit
fb6d782d
authored
Apr 24, 2019
by
liubryan
Browse files
Update main.c
parent
2f4d90a3
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 @
fb6d782d
...
...
@@ -6,6 +6,7 @@ extern uint8_t arrow_pos;
extern
uint8_t
tab_state
;
extern
uint8_t
is_selecting
;
extern
uint8_t
mouse_map
[
160
][
110
];
extern
uint8_t
map_resolution
;
/*
uint8_t total_progress = 0;
...
...
@@ -88,6 +89,7 @@ void __FINISHED_INTERRUPT_HANDLER__() {
MSS_GPIO_clear_irq
(
MSS_GPIO_4
);
//clear interrupt and resume
}
void
uart1_rx_handler
(
mss_uart_instance_t
*
this_uart
)
{
int
i
=
0
;
...
...
@@ -95,6 +97,10 @@ void __FINISHED_INTERRUPT_HANDLER__() {
MSS_UART_get_rx
(
this_uart
,
g_rx_buff
,
sizeof
(
g_rx_buff
)
);
//erase_block( BARSTART_X, BARSTART_Y, BARSTART_X+100,BAREND_Y);
progress
=
g_rx_buff
[
0
];
uint8_t
xcoord
=
g_rx_buff
[
4
]
/
map_resolution
;
uint8_t
ycoord
=
g_rx_buff
[
5
]
/
map_resolution
;
mouse_map
[
xcoord
][
ycoord
]
=
(
mouse_map
[
xcoord
][
ycoord
]
==
0
)
?
1
:
0
;
if
(
tab_state
==
0
&&
!
is_selecting
){
//MSS_UART_get_rx( this_uart, g_rx_buff, sizeof(g_rx_buff) );
erase_block
(
BARSTART_X
+
1
,
BARSTART_Y
+
1
,
BARSTART_X
+
99
,
BAREND_Y
-
1
);
...
...
@@ -108,14 +114,17 @@ void __FINISHED_INTERRUPT_HANDLER__() {
display_stepper
((
int8_t
)
g_rx_buff
[
2
],
(
int8_t
)
g_rx_buff
[
3
]);
display_mouse
((
int8_t
)
g_rx_buff
[
4
],
(
int8_t
)
g_rx_buff
[
5
]);
display_orientation
((
uint16_t
)
g_rx_buff
[
6
]
|
(
uint16_t
)
g_rx_buff
[
7
]
<<
8
);
set_reset_pixel
(
xcoord
,
ycoord
,
mouse_map
[
xcoord
][
ycoord
]);
}
/*
signed char odox=g_rx_buff[2]; //cent
signed char odoy=g_rx_buff[3];
signed char mousex=g_rx_buff[4]; //cent/1000
signed char mousey=g_rx_buff[5];
uint16_t orientation = (g_rx_buff[6]) | ((uint16_t)g_rx_buff[7] << 8); //deg
*/
*/
}
void
initInterrupts
(){
...
...
@@ -141,6 +150,7 @@ int main() {
initialize
(
20
);
initInterrupts
();
MSS_UART_set_rx_handler
(
&
g_mss_uart1
,
uart1_rx_handler
,
MSS_UART_FIFO_SINGLE_BYTE
);
UART_init
(
&
g_uart
,
COREUARTAPB0_BASE_ADDR
,
BAUD_VALUE_115200
,(
DATA_8_BITS
|
NO_PARITY
));
...
...
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