Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Haun
firmware
Commits
82b5b21f
Commit
82b5b21f
authored
Jul 27, 2019
by
schneider
Committed by
Rahix
Jul 27, 2019
Browse files
feat(bootloader): Reset when system says done
parent
a43065c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
bootloader/bootloader-usb.c
View file @
82b5b21f
...
...
@@ -114,11 +114,17 @@ void delay_us(unsigned int usec)
mxc_delay
(
usec
);
}
void
bootloader_stop
(
void
)
{
card10_reset
();
}
void
bootloader_dirty
(
void
)
{
Paint_DrawString_EN
(
0
,
16
*
3
,
"Writing."
,
&
Font16
,
0x0000
,
0xf000
);
LCD_Update
();
}
void
bootloader_clean
(
void
)
{
Paint_DrawString_EN
(
0
,
16
*
3
,
"Ready. "
,
&
Font16
,
0x0000
,
0xffff
);
...
...
bootloader/main.c
View file @
82b5b21f
...
...
@@ -210,15 +210,7 @@ static inline void boot(const void *vtable)
static
void
pmic_button
(
bool
falling
)
{
if
(
falling
)
{
printf
(
"Resetting ...
\n
"
);
/*
* Give the UART fifo time to clear.
* TODO: Do this properly
*/
for
(
int
i
=
0
;
i
<
0x1000000
;
i
++
)
{
__asm
volatile
(
"nop"
);
}
MXC_GCR
->
rstr0
=
MXC_F_GCR_RSTR0_SYSTEM
;
card10_reset
();
}
}
...
...
bootloader/mscmem.c
View file @
82b5b21f
...
...
@@ -3,6 +3,7 @@
#include
<stdio.h>
#include
"mx25lba.h"
void
bootloader_stop
(
void
);
void
bootloader_dirty
(
void
);
void
bootloader_clean
(
void
);
...
...
@@ -50,7 +51,9 @@ int mscmem_start()
int
mscmem_stop
()
{
printf
(
"%s
\n
"
,
__func__
);
return
mx25_stop
();
int
ret
=
mx25_stop
();
bootloader_stop
();
return
ret
;
}
/******************************************************************************/
...
...
lib/card10/card10.c
View file @
82b5b21f
...
...
@@ -216,6 +216,19 @@ void card10_poll(void)
pmic_poll
();
}
void
card10_reset
(
void
)
{
printf
(
"Resetting ...
\n
"
);
/*
* Give the UART fifo time to clear.
* TODO: Do this properly
*/
for
(
int
i
=
0
;
i
<
0x1000000
;
i
++
)
{
__asm
volatile
(
"nop"
);
}
MXC_GCR
->
rstr0
=
MXC_F_GCR_RSTR0_SYSTEM
;
}
void
GPIO0_IRQHandler
(
void
)
{
GPIO_Handler
(
PORT_0
);
...
...
lib/card10/card10.h
View file @
82b5b21f
...
...
@@ -13,4 +13,5 @@ void core1_start(void);
void
core1_stop
(
void
);
void
card10_poll
(
void
);
void
card10_reset
(
void
);
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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