Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

[sensor] Fix sensor to pass unit test #791

Merged
merged 2 commits into from
Mar 8, 2017

Conversation

jimmy-huang
Copy link
Contributor

Sensor tests are broken because because the callstack is corrupted
when sending IPM messages, and this patch rewrite the start sensor
logic to have a callback that's called from the mainloop instead
for a smaller call stack. Also fixed an issue where stop fails
on AmbientLightSensor

Signed-off-by: Jimmy Huang [email protected]

Sensor tests are broken because because the callstack is corrupted
when sending IPM messages, and this patch rewrite the start sensor
logic to have a callback that's called from the mainloop instead
for a smaller call stack.  Also fixed an issue where stop fails
on AmbientLightSensor

Signed-off-by: Jimmy Huang <[email protected]>
src/zjs_sensor.c Outdated
@@ -450,7 +496,7 @@ static jerry_value_t zjs_sensor_create(const jerry_value_t function_obj,
enum sensor_channel channel)
{
double frequency = DEFAULT_SAMPLING_FREQUENCY;
uint32_t pin;
uint32_t pin = -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not assign negative numbers to unsigned ints, even if it works. :)

I guess use 0xffffffff?

Signed-off-by: Jimmy Huang <[email protected]>
@jimmy-huang
Copy link
Contributor Author

@grgustaf updated patch

@grgustaf
Copy link
Contributor

grgustaf commented Mar 8, 2017

+1

@grgustaf grgustaf merged commit 70a30cc into intel:master Mar 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants