Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
af870d7a
Commit
af870d7a
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix bugs in SLCD test and in SLCD CODEC
parent
5bb3a187
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arch/arm/src/stm32/stm32_lse.c
+15
-0
15 additions, 0 deletions
arch/arm/src/stm32/stm32_lse.c
configs/stm32ldiscovery/src/stm32_lcd.c
+1
-1
1 addition, 1 deletion
configs/stm32ldiscovery/src/stm32_lcd.c
libc/misc/lib_slcddecode.c
+16
-24
16 additions, 24 deletions
libc/misc/lib_slcddecode.c
with
32 additions
and
25 deletions
arch/arm/src/stm32/stm32_lse.c
+
15
−
0
View file @
af870d7a
...
...
@@ -41,6 +41,7 @@
#include
"up_arch.h"
#include
"stm32_pwr.h"
#include
"stm32_rcc.h"
#include
"stm32_waste.h"
...
...
@@ -78,6 +79,16 @@
#ifdef CONFIG_STM32_STM32L15XX
void
stm32_rcc_enablelse
(
void
)
{
uint16_t
pwrcr
;
/* The LSE is in the RTC domain and write access is denied to this domain
* after reset, you have to enable write access using DBP bit in the PWR CR
* register before to configuring the LSE.
*/
pwrcr
=
getreg16
(
STM32_PWR_CR
);
putreg16
(
pwrcr
|
PWR_CR_DBP
,
STM32_PWR_CR
);
/* Enable the External Low-Speed (LSE) oscillator by setting the LSEON bit
* the RCC CSR register.
*/
...
...
@@ -110,6 +121,10 @@ void stm32_rcc_enablelse(void)
modifyreg32
(
STM32_RCC_CSR
,
0
,
RCC_CSR_RTCEN
);
#endif
#endif
/* Restore the previous state of the DBP bit */
putreg16
(
pwrcr
,
STM32_PWR_CR
);
}
#else
...
...
This diff is collapsed.
Click to expand it.
configs/stm32ldiscovery/src/stm32_lcd.c
+
1
−
1
View file @
af870d7a
...
...
@@ -841,7 +841,7 @@ static void slcd_writech(uint8_t ch, uint8_t curpos, uint8_t options)
{
segset
|=
0x0002
;
}
else
if
((
options
&
SCLD_
DP
)
!=
0
)
else
if
((
options
&
SCLD_
COLON
)
!=
0
)
{
segset
|=
0x0020
;
}
...
...
This diff is collapsed.
Click to expand it.
libc/misc/lib_slcddecode.c
+
16
−
24
View file @
af870d7a
...
...
@@ -109,7 +109,7 @@ static uint8_t slcd_nibble(uint8_t ascii)
* Name: slcd_reget
*
* Description:
* We have unused characters from the last, unsuccessful decode attempt.
* We have unused characters from the last, unsuccessful decode attempt.
* Return one of these instead of the new character from the stream.
*
* Input Parameters:
...
...
@@ -260,9 +260,14 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
if
(
!
IS_HEX
(
ch
))
{
/* Decode the value following the bracket */
code
=
CODE_RETURN
(
ch
);
count
=
0
;
/* Verify the special CLCD action code */
if
(
c
h
<
(
int
)
FIRST_SLCDCODE
||
c
h
>
(
int
)
LAST_SLCDCODE
)
if
(
c
ode
<
(
int
)
FIRST_SLCDCODE
||
c
ode
>
(
int
)
LAST_SLCDCODE
)
{
/* Not a special command code.. put the character in the reget
* buffer.
...
...
@@ -275,11 +280,6 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
return
slcd_reget
(
state
,
pch
,
parg
);
}
/* Provide the return values */
code
=
CODE_RETURN
(
ch
);
count
=
0
;
}
else
{
...
...
@@ -312,7 +312,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
return
slcd_reget
(
state
,
pch
,
parg
);
}
/* Save the second character of the two byte hexidecimal number */
state
->
buf
[
NDX_COUNTL
]
=
(
uint8_t
)
ch
;
...
...
@@ -337,28 +337,21 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
state
->
buf
[
NDX_CODE5
]
=
(
uint8_t
)
ch
;
state
->
nch
=
NCH_CODE5
;
/* Verify the special CLCD action code */
if
(
ch
<
(
int
)
FIRST_SLCDCODE
||
ch
>
(
int
)
LAST_SLCDCODE
)
{
/* Not a special command code. Return the ESC now and the rest
* of the characters later.
*/
return
slcd_reget
(
state
,
pch
,
parg
);
}
/* Provide the return values */
/* Get the code and the count values. All count values must be greater
* than 0 or something is wrong.
*/
code
=
CODE_RETURN
(
ch
);
count
=
slcd_nibble
(
state
->
buf
[
NDX_COUNTH
])
<<
4
;
slcd_nibble
(
state
->
buf
[
NDX_COUNTL
]);
/*
All count values must be greater than 0 or something is wrong
*/
/*
Verify the special CLCD action code
*/
if
(
count
<
1
)
if
(
code
<
(
int
)
FIRST_SLCDCODE
||
code
>
(
int
)
LAST_SLCDCODE
||
count
<
1
)
{
/* Return the ESC now and the rest of the characters later. */
/* Not a special command code. Return the ESC now and the rest
* of the characters later.
*/
return
slcd_reget
(
state
,
pch
,
parg
);
}
...
...
@@ -374,4 +367,3 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
state
->
nch
=
0
;
return
SLCDRET_SPEC
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment