Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
13e92e12
Commit
13e92e12
authored
Dec 04, 2018
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/mboot: Provide led_state_all function to reduce code size.
parent
9262f541
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
ports/stm32/mboot/main.c
ports/stm32/mboot/main.c
+11
-15
No files found.
ports/stm32/mboot/main.c
View file @
13e92e12
...
...
@@ -298,6 +298,12 @@ void led_state(int led, int val) {
}
}
void
led_state_all
(
unsigned
int
mask
)
{
led_state
(
LED0
,
mask
&
1
);
led_state
(
LED1
,
mask
&
2
);
led_state
(
LED2
,
mask
&
4
);
}
/******************************************************************************/
// USR BUTTON
...
...
@@ -1100,9 +1106,7 @@ static int get_reset_mode(void) {
reset_mode
=
1
;
}
uint8_t
l
=
RESET_MODE_LED_STATES
>>
((
reset_mode
-
1
)
*
4
);
led_state
(
LED0
,
l
&
1
);
led_state
(
LED1
,
l
&
2
);
led_state
(
LED2
,
l
&
4
);
led_state_all
(
l
);
}
if
(
!
usrbtn_state
())
{
break
;
...
...
@@ -1111,14 +1115,10 @@ static int get_reset_mode(void) {
}
// Flash the selected reset mode
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
led_state
(
LED0
,
0
);
led_state
(
LED1
,
0
);
led_state
(
LED2
,
0
);
led_state_all
(
0
);
mp_hal_delay_ms
(
50
);
uint8_t
l
=
RESET_MODE_LED_STATES
>>
((
reset_mode
-
1
)
*
4
);
led_state
(
LED0
,
l
&
1
);
led_state
(
LED1
,
l
&
2
);
led_state
(
LED2
,
l
&
4
);
led_state_all
(
l
);
mp_hal_delay_ms
(
50
);
}
mp_hal_delay_ms
(
300
);
...
...
@@ -1127,9 +1127,7 @@ static int get_reset_mode(void) {
}
static
void
do_reset
(
void
)
{
led_state
(
LED0
,
0
);
led_state
(
LED1
,
0
);
led_state
(
LED2
,
0
);
led_state_all
(
0
);
mp_hal_delay_ms
(
50
);
pyb_usbdd_shutdown
();
#if defined(MBOOT_I2C_SCL)
...
...
@@ -1235,9 +1233,7 @@ enter_bootloader:
i2c_init
(
initial_r0
);
#endif
led_state
(
LED0
,
0
);
led_state
(
LED1
,
0
);
led_state
(
LED2
,
0
);
led_state_all
(
0
);
#if USE_USB_POLLING
uint32_t
ss
=
systick_ms
;
...
...
Write
Preview
Markdown
is supported
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