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
0bdcb815
Commit
0bdcb815
authored
Oct 20, 2018
by
Natalia
Committed by
Arnim Läuger
Oct 20, 2018
Browse files
u8g2 i2c multibus support (#2526)
* u8g2 support for more than only one i2c bus * Removed unnecessary #include
parent
67567af9
Changes
1
Show whitespace changes
Inline
Side-by-side
app/platform/u8x8_nodemcu_hal.c
View file @
0bdcb815
...
...
@@ -133,11 +133,11 @@ uint8_t u8x8_byte_nodemcu_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *
switch
(
msg
)
{
case
U8X8_MSG_BYTE_SEND
:
if
(
hal
->
id
==
0
)
{
if
(
hal
->
id
<
NUM_I2C
)
{
data
=
(
uint8_t
*
)
arg_ptr
;
while
(
arg_int
>
0
)
{
platform_i2c_send_byte
(
0
,
*
data
);
platform_i2c_send_byte
(
hal
->
id
,
*
data
);
data
++
;
arg_int
--
;
}
...
...
@@ -164,9 +164,9 @@ uint8_t u8x8_byte_nodemcu_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *
break
;
case
U8X8_MSG_BYTE_START_TRANSFER
:
if
(
hal
->
id
==
0
)
{
platform_i2c_send_start
(
0
);
platform_i2c_send_address
(
0
,
u8x8_GetI2CAddress
(
u8x8
),
PLATFORM_I2C_DIRECTION_TRANSMITTER
);
if
(
hal
->
id
<
NUM_I2C
)
{
platform_i2c_send_start
(
hal
->
id
);
platform_i2c_send_address
(
hal
->
id
,
u8x8_GetI2CAddress
(
u8x8
),
PLATFORM_I2C_DIRECTION_TRANSMITTER
);
}
else
{
// invalid id
...
...
@@ -175,8 +175,8 @@ uint8_t u8x8_byte_nodemcu_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *
break
;
case
U8X8_MSG_BYTE_END_TRANSFER
:
if
(
hal
->
id
==
0
)
{
platform_i2c_send_stop
(
0
);
if
(
hal
->
id
<
NUM_I2C
)
{
platform_i2c_send_stop
(
hal
->
id
);
}
else
{
// invalid id
...
...
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