Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
3b37f092
Commit
3b37f092
authored
Mar 13, 2015
by
devsaurus
Browse files
res optional
parent
429bf57d
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/u8g.c
View file @
3b37f092
...
...
@@ -1037,7 +1037,7 @@ static int lu8g_ssd1306_128x64_i2c( lua_State *L )
return
1
;
}
// Lua: object = u8g.ssd1306_128x64_spi( cs, dc )
// Lua: object = u8g.ssd1306_128x64_spi( cs, dc
, [res]
)
static
int
lu8g_ssd1306_128x64_spi
(
lua_State
*
L
)
{
unsigned
cs
=
luaL_checkinteger
(
L
,
1
);
...
...
@@ -1046,6 +1046,7 @@ static int lu8g_ssd1306_128x64_spi( lua_State *L )
unsigned
dc
=
luaL_checkinteger
(
L
,
2
);
if
(
dc
==
0
)
return
luaL_error
(
L
,
"D/C pin required"
);
unsigned
res
=
luaL_optinteger
(
L
,
3
,
U8G_PIN_NONE
);
lu8g_userdata_t
*
lud
=
(
lu8g_userdata_t
*
)
lua_newuserdata
(
L
,
sizeof
(
lu8g_userdata_t
)
);
...
...
@@ -1069,9 +1070,9 @@ static int lu8g_ssd1306_128x64_spi( lua_State *L )
return
luaL_error
(
L
,
"out of memory"
);
// and finally init device using specific interface init function
u8g_InitHWSPI
(
LU8G
,
&
(
lud
->
dev
),
cs
,
dc
,
U8G_PIN_NONE
);
u8g_InitHWSPI
(
LU8G
,
&
(
lud
->
dev
),
cs
,
dc
,
res
);
#else
u8g_InitHWSPI
(
LU8G
,
&
u8g_dev_ssd1306_128x64_spi
,
cs
,
dc
,
U8G_PIN_NONE
);
u8g_InitHWSPI
(
LU8G
,
&
u8g_dev_ssd1306_128x64_spi
,
cs
,
dc
,
res
);
#endif
...
...
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