{"action":"created","issue":{"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/32","repository_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers","labels_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/32/comments","events_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/32/events","html_url":"https://github.com/ev3dev/lego-linux-drivers/pull/32","id":153649567,"number":32,"title":"Add NXT Temperature Sensor support","user":{"login":"kortschak","id":275221,"avatar_url":"https://avatars.githubusercontent.com/u/275221?v=3","gravatar_id":"","url":"https://api.github.com/users/kortschak","html_url":"https://github.com/kortschak","followers_url":"https://api.github.com/users/kortschak/followers","following_url":"https://api.github.com/users/kortschak/following{/other_user}","gists_url":"https://api.github.com/users/kortschak/gists{/gist_id}","starred_url":"https://api.github.com/users/kortschak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kortschak/subscriptions","organizations_url":"https://api.github.com/users/kortschak/orgs","repos_url":"https://api.github.com/users/kortschak/repos","events_url":"https://api.github.com/users/kortschak/events{/privacy}","received_events_url":"https://api.github.com/users/kortschak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-08T11:06:58Z","updated_at":"2016-05-11T14:58:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/32","html_url":"https://github.com/ev3dev/lego-linux-drivers/pull/32","diff_url":"https://github.com/ev3dev/lego-linux-drivers/pull/32.diff","patch_url":"https://github.com/ev3dev/lego-linux-drivers/pull/32.patch"},"body":"@dlech Please take a look. No testing yet, since I'm wanting to make sure it will be safe before I do.\r\n\r\nI don't think this is quite right - the scaling looks to me like I should not need to do what I am doing, but the raw_min and raw_max are u32 and I need negative values. Hence the approach I'm taking.\r\n\r\nI'm also not sure about how mode state is retained - the device has a variety of modes (word width and one-shot v continuous), but (sanely) imperial is not supported, so unit mode state needs to be retained somewhere else - I am assuming the lego sensor module handles that, but I can't find any indication of that.\r\n\r\nAnyway, when you have time please make some suggestions."},"comment":{"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/comments/218485784","html_url":"https://github.com/ev3dev/lego-linux-drivers/pull/32#issuecomment-218485784","issue_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/32","id":218485784,"user":{"login":"dlech","id":963645,"avatar_url":"https://avatars.githubusercontent.com/u/963645?v=3","gravatar_id":"","url":"https://api.github.com/users/dlech","html_url":"https://github.com/dlech","followers_url":"https://api.github.com/users/dlech/followers","following_url":"https://api.github.com/users/dlech/following{/other_user}","gists_url":"https://api.github.com/users/dlech/gists{/gist_id}","starred_url":"https://api.github.com/users/dlech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlech/subscriptions","organizations_url":"https://api.github.com/users/dlech/orgs","repos_url":"https://api.github.com/users/dlech/repos","events_url":"https://api.github.com/users/dlech/events{/privacy}","received_events_url":"https://api.github.com/users/dlech/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T14:58:25Z","updated_at":"2016-05-11T14:58:25Z","body":"> Sorry, the implied question is how do I go about debugging this?\r\n\r\nAdd `printk` statements to look at what you need to see.\r\n\r\n    printk(\"I'm debugging %d\\n\", variable);\r\n\r\nThen check `dmesg` for the messages. I usually use a serial console on input port 1 for watching kernel messages. This is the only way to catch crashes, but it requires additional hardware (USB/Serial converter) and some extra configuration. Opening a second terminal window and running `dmesg -w` should work just as well as long as you aren't crashing the kernel."}}