Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
c674f02d
Commit
c674f02d
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Plain Diff
Merge pull request #231 from iabdalkader/master
Fix implicit double conversion warning
parents
c7aa9fca
8d3b0a9f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
py/objcomplex.c
+2
-2
2 additions, 2 deletions
py/objcomplex.c
py/objfloat.c
+1
-1
1 addition, 1 deletion
py/objfloat.c
stm/lcd.c
+10
-0
10 additions, 0 deletions
stm/lcd.c
stm/printf.c
+3
-0
3 additions, 0 deletions
stm/printf.c
with
16 additions
and
3 deletions
py/objcomplex.c
+
2
−
2
View file @
c674f02d
...
...
@@ -24,9 +24,9 @@ mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag);
void
complex_print
(
void
(
*
print
)(
void
*
env
,
const
char
*
fmt
,
...),
void
*
env
,
mp_obj_t
o_in
,
mp_print_kind_t
kind
)
{
mp_obj_complex_t
*
o
=
o_in
;
if
(
o
->
real
==
0
)
{
print
(
env
,
"%.8gj"
,
o
->
imag
);
print
(
env
,
"%.8gj"
,
(
double
)
o
->
imag
);
}
else
{
print
(
env
,
"(%.8g+%.8gj)"
,
o
->
real
,
o
->
imag
);
print
(
env
,
"(%.8g+%.8gj)"
,
(
double
)
o
->
real
,
(
double
)
o
->
imag
);
}
}
...
...
This diff is collapsed.
Click to expand it.
py/objfloat.c
+
1
−
1
View file @
c674f02d
...
...
@@ -21,7 +21,7 @@ mp_obj_t mp_obj_new_float(mp_float_t value);
static
void
float_print
(
void
(
*
print
)(
void
*
env
,
const
char
*
fmt
,
...),
void
*
env
,
mp_obj_t
o_in
,
mp_print_kind_t
kind
)
{
mp_obj_float_t
*
o
=
o_in
;
print
(
env
,
"%.8g"
,
o
->
value
);
print
(
env
,
"%.8g"
,
(
double
)
o
->
value
);
}
static
mp_obj_t
float_make_new
(
mp_obj_t
type_in
,
uint
n_args
,
uint
n_kw
,
const
mp_obj_t
*
args
)
{
...
...
This diff is collapsed.
Click to expand it.
stm/lcd.c
+
10
−
0
View file @
c674f02d
...
...
@@ -41,6 +41,16 @@
#define PYB_LCD_BL_PORT (GPIOB)
#define PYB_LCD_BL_PIN (GPIO_Pin_1) // Y12 = PB1
*/
#elif defined(STM32F4DISC)
/* Configure if needed */
#define PYB_LCD_PORT (GPIOA)
#define PYB_LCD_CS1_PIN (GPIO_Pin_2) // X3
#define PYB_LCD_RST_PIN (GPIO_Pin_3) // X4
#define PYB_LCD_A0_PIN (GPIO_Pin_4) // X5
#define PYB_LCD_SCL_PIN (GPIO_Pin_5) // X6
#define PYB_LCD_SI_PIN (GPIO_Pin_7) // X8
#define PYB_LCD_BL_PORT (GPIOC)
#define PYB_LCD_BL_PIN (GPIO_Pin_5) // X12
#endif
#define LCD_INSTR (0)
...
...
This diff is collapsed.
Click to expand it.
stm/printf.c
+
3
−
0
View file @
c674f02d
...
...
@@ -6,6 +6,7 @@
#include
"misc.h"
#include
"systick.h"
#include
"mpconfig.h"
#include
"mpconfigport.h"
#include
"qstr.h"
#include
"obj.h"
#include
"lcd.h"
...
...
@@ -247,7 +248,9 @@ void stdout_print_strn(void *data, const char *str, unsigned int len) {
any
=
true
;
}
if
(
!
any
)
{
#if MICROPY_HW_HAS_LCD
lcd_print_strn
(
str
,
len
);
#endif
}
}
...
...
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