Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
st7789_mpy
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
st7789_mpy
Commits
27d7a24b
Commit
27d7a24b
authored
Jun 27, 2020
by
Russ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change malloc to alloca for STM based boards
parent
b8b4b8e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
st7789/st7789.c
st7789/st7789.c
+7
-0
No files found.
st7789/st7789.c
View file @
27d7a24b
...
...
@@ -23,6 +23,7 @@
*/
#define __ST7789_VERSION__ "0.1.4"
#include <stdlib.h>
#include "py/obj.h"
#include "py/objmodule.h"
...
...
@@ -419,7 +420,11 @@ STATIC mp_obj_t st7789_ST7789_text(size_t n_args, const mp_obj_t *args) {
uint8_t
wide
=
width
/
8
;
uint16_t
buf_size
=
width
*
height
*
2
;
#ifdef MICROPY_PY_STM
uint16_t
*
c_buffer
=
alloca
(
buf_size
);
#else
uint16_t
*
c_buffer
=
malloc
(
buf_size
);
#endif
if
(
c_buffer
)
{
uint8_t
chr
;
...
...
@@ -451,7 +456,9 @@ STATIC mp_obj_t st7789_ST7789_text(size_t n_args, const mp_obj_t *args) {
x0
+=
width
;
}
}
#ifndef MICROPY_PY_STM
free
(
c_buffer
);
#endif
}
return
mp_const_none
;
}
...
...
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