Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
220abca3
Commit
220abca3
authored
Jan 30, 2017
by
Damien George
Browse files
stmhal: Use LED constants from PYBv4 onwards.
parent
30beed11
Changes
2
Hide whitespace changes
Inline
Side-by-side
stmhal/main.c
View file @
220abca3
...
...
@@ -72,14 +72,14 @@ mp_vfs_mount_t mp_vfs_mount_flash;
void
flash_error
(
int
n
)
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
led_state
(
PYB_LED_R
1
,
1
);
led_state
(
PYB_LED_
R2
,
0
);
led_state
(
PYB_LED_R
ED
,
1
);
led_state
(
PYB_LED_
GREEN
,
0
);
HAL_Delay
(
250
);
led_state
(
PYB_LED_R
1
,
0
);
led_state
(
PYB_LED_
R2
,
1
);
led_state
(
PYB_LED_R
ED
,
0
);
led_state
(
PYB_LED_
GREEN
,
1
);
HAL_Delay
(
250
);
}
led_state
(
PYB_LED_
R2
,
0
);
led_state
(
PYB_LED_
GREEN
,
0
);
}
void
NORETURN
__fatal_error
(
const
char
*
msg
)
{
...
...
@@ -183,7 +183,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
// no filesystem, or asked to reset it, so create a fresh one
// LED on to indicate creation of LFS
led_state
(
PYB_LED_
R2
,
1
);
led_state
(
PYB_LED_
GREEN
,
1
);
uint32_t
start_tick
=
HAL_GetTick
();
uint8_t
working_buf
[
_MAX_SS
];
...
...
@@ -218,7 +218,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
// keep LED on for at least 200ms
sys_tick_wait_at_least
(
start_tick
,
200
);
led_state
(
PYB_LED_
R2
,
0
);
led_state
(
PYB_LED_
GREEN
,
0
);
}
else
if
(
res
==
FR_OK
)
{
// mount sucessful
}
else
{
...
...
@@ -245,7 +245,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
// doesn't exist, create fresh file
// LED on to indicate creation of boot.py
led_state
(
PYB_LED_
R2
,
1
);
led_state
(
PYB_LED_
GREEN
,
1
);
uint32_t
start_tick
=
HAL_GetTick
();
FIL
fp
;
...
...
@@ -257,7 +257,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
// keep LED on for at least 200ms
sys_tick_wait_at_least
(
start_tick
,
200
);
led_state
(
PYB_LED_
R2
,
0
);
led_state
(
PYB_LED_
GREEN
,
0
);
}
}
...
...
stmhal/storage.c
View file @
220abca3
...
...
@@ -149,7 +149,7 @@ static uint8_t *flash_cache_get_addr_for_write(uint32_t flash_addr) {
flash_cache_sector_size
=
flash_sector_size
;
}
flash_flags
|=
FLASH_FLAG_DIRTY
;
led_state
(
PYB_LED_R
1
,
1
);
// indicate a dirty cache with LED on
led_state
(
PYB_LED_R
ED
,
1
);
// indicate a dirty cache with LED on
flash_tick_counter_last_write
=
HAL_GetTick
();
return
(
uint8_t
*
)
CACHE_MEM_START_ADDR
+
flash_addr
-
flash_sector_start
;
}
...
...
@@ -261,7 +261,7 @@ void storage_irq_handler(void) {
// clear the flash flags now that we have a clean cache
flash_flags
=
0
;
// indicate a clean cache with LED off
led_state
(
PYB_LED_R
1
,
0
);
led_state
(
PYB_LED_R
ED
,
0
);
}
#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