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
d279ba2f
Unverified
Commit
d279ba2f
authored
Nov 11, 2020
by
Lukáš Voborský
Committed by
GitHub
Nov 11, 2020
Browse files
BME280 Lua module - `(config[3] & 0xFC) | BME280_FORCED_MODE` workaround bug fix (#3325)
parent
c4baa9f3
Changes
1
Show whitespace changes
Inline
Side-by-side
lua_modules/bme280/bme280.lua
View file @
d279ba2f
...
@@ -130,8 +130,8 @@ function bme280_startreadout(self, callback, delay, alt)
...
@@ -130,8 +130,8 @@ function bme280_startreadout(self, callback, delay, alt)
delay
=
delay
or
BME280_SAMPLING_DELAY
delay
=
delay
or
BME280_SAMPLING_DELAY
if
self
.
_isbme
then
write_reg
(
self
.
id
,
self
.
addr
,
BME280_REGISTER_CONTROL_HUM
,
self
.
_config
[
2
])
end
if
self
.
_isbme
then
write_reg
(
self
.
id
,
self
.
addr
,
BME280_REGISTER_CONTROL_HUM
,
self
.
_config
[
2
])
end
write_reg
(
self
.
id
,
self
.
addr
,
BME280_REGISTER_CONTROL
,
math_floor
(
self
.
_config
[
3
]:
byte
(
1
)
/
4
)
+
1
)
write_reg
(
self
.
id
,
self
.
addr
,
BME280_REGISTER_CONTROL
,
4
*
math_floor
(
self
.
_config
[
3
]:
byte
(
1
)
/
4
)
+
1
)
-- math_floor(self._config[3]:byte(1)/4)+ 1
--
4*
math_floor(self._config[3]:byte(1)/4)+ 1
-- an awful way to avoid bit operations but calculate (config[3] & 0xFC) | BME280_FORCED_MODE
-- an awful way to avoid bit operations but calculate (config[3] & 0xFC) | BME280_FORCED_MODE
-- Lua 5.3 integer division // would be more suitable
-- Lua 5.3 integer division // would be more suitable
...
...
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