{"action":"created","comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/comments/33529951","id":33529951,"diff_hunk":"@@ -1,232 +1,358 @@\n-// Module for interfacing with timer\n+/*guys, srsly, turn on warnings in the makefile*/","path":"app/modules/tmr.c","position":2,"original_position":2,"commit_id":"2691383696aa5d2ca3dedc158891f5eddc8a414c","original_commit_id":"2691383696aa5d2ca3dedc158891f5eddc8a414c","user":{"login":"creationix","id":89353,"avatar_url":"https://avatars.githubusercontent.com/u/89353?v=3","gravatar_id":"","url":"https://api.github.com/users/creationix","html_url":"https://github.com/creationix","followers_url":"https://api.github.com/users/creationix/followers","following_url":"https://api.github.com/users/creationix/following{/other_user}","gists_url":"https://api.github.com/users/creationix/gists{/gist_id}","starred_url":"https://api.github.com/users/creationix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creationix/subscriptions","organizations_url":"https://api.github.com/users/creationix/orgs","repos_url":"https://api.github.com/users/creationix/repos","events_url":"https://api.github.com/users/creationix/events{/privacy}","received_events_url":"https://api.github.com/users/creationix/received_events","type":"User","site_admin":false},"body":"+1","created_at":"2015-06-30T00:27:52Z","updated_at":"2015-06-30T00:27:52Z","html_url":"https://github.com/nodemcu/nodemcu-firmware/pull/519#discussion_r33529951","pull_request_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519","_links":{"self":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/comments/33529951"},"html":{"href":"https://github.com/nodemcu/nodemcu-firmware/pull/519#discussion_r33529951"},"pull_request":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519"}}},"pull_request":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519","id":38809026,"html_url":"https://github.com/nodemcu/nodemcu-firmware/pull/519","diff_url":"https://github.com/nodemcu/nodemcu-firmware/pull/519.diff","patch_url":"https://github.com/nodemcu/nodemcu-firmware/pull/519.patch","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/519","number":519,"state":"open","locked":false,"title":"rewrote the timer module from scratch","user":{"login":"md5crypt","id":6748075,"avatar_url":"https://avatars.githubusercontent.com/u/6748075?v=3","gravatar_id":"","url":"https://api.github.com/users/md5crypt","html_url":"https://github.com/md5crypt","followers_url":"https://api.github.com/users/md5crypt/followers","following_url":"https://api.github.com/users/md5crypt/following{/other_user}","gists_url":"https://api.github.com/users/md5crypt/gists{/gist_id}","starred_url":"https://api.github.com/users/md5crypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/md5crypt/subscriptions","organizations_url":"https://api.github.com/users/md5crypt/orgs","repos_url":"https://api.github.com/users/md5crypt/repos","events_url":"https://api.github.com/users/md5crypt/events{/privacy}","received_events_url":"https://api.github.com/users/md5crypt/received_events","type":"User","site_admin":false},"body":"#### new timer module\r\n* rewritten from scratch\r\n* 6 new api calls\r\n* old api still works\r\n* better rtc precision (arithmetic errors do not accumulate)\r\n* software watchdog\r\n* clean code\r\n\r\n#### api doc:\r\n```\r\ntmr.wdclr() -- not changed\r\ntmr.now()   -- not changed\r\ntmr.time()  -- not changed\r\ntmr.delay() -- not changed\r\ntmr.alarm() -- not changed\r\ntmr.stop()  -- changed, see below. use tmr.unregister for old functionality\r\n\r\ntmr.register(id, interval, mode, function)\r\n\tbind function with timer and set the interval in ms\r\n\tthe mode can be:\r\n\t\ttmr.ALARM_SINGLE for a single run alarm\r\n\t\ttmr.ALARM_SEMI for a multiple single run alarm\r\n\t\ttmr.ALARM_AUTO for a repating alarm\r\n\ttmr.register does NOT start the timer\r\n\ttmr.alarm is a tmr.register & tmr.start macro\r\ntmr.unregister(id)\r\n\tstop alarm, unbind function and clean up memory\r\n\tnot needed for ALARM_SINGLE, as it unregisters itself\r\ntmr.start(id)\r\n\tret: bool\r\n\tstart a alarm, returns true on success\r\ntmr.stop(id)\r\n\tret: bool\r\n\tstops a alarm, returns true on success\r\n\tthis call dose not free any memory, to do so use tmr.unregister\r\n\tstopped alarms can be started with start\r\ntmr.interval(id, interval)\r\n\tset alarm interval, running alarm will be restarted\r\ntmr.state(id)\r\n\tret: (bool, int) or nil\r\n\treturns alarm status (true=started/false=stopped) and mode\r\n\tnil if timer is unregistered\r\ntmr.softwd(int)\r\n\tset a negative value to stop the timer\r\n\tany other value starts the timer, when the\r\n\tcountdown reaches zero, the device restarts\r\n\tthe timer units are seconds\r\n```\r\n\r\nand why, why, why are compilation warnings off? I had to #pragma them at the top of the file","created_at":"2015-06-29T19:35:36Z","updated_at":"2015-06-30T00:27:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16e43047b3f103b0e09e05a391c875c759829bcd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519/commits","review_comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519/comments","review_comment_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/519/comments","statuses_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/statuses/2691383696aa5d2ca3dedc158891f5eddc8a414c","head":{"label":"md5crypt:tmr_module","ref":"tmr_module","sha":"2691383696aa5d2ca3dedc158891f5eddc8a414c","user":{"login":"md5crypt","id":6748075,"avatar_url":"https://avatars.githubusercontent.com/u/6748075?v=3","gravatar_id":"","url":"https://api.github.com/users/md5crypt","html_url":"https://github.com/md5crypt","followers_url":"https://api.github.com/users/md5crypt/followers","following_url":"https://api.github.com/users/md5crypt/following{/other_user}","gists_url":"https://api.github.com/users/md5crypt/gists{/gist_id}","starred_url":"https://api.github.com/users/md5crypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/md5crypt/subscriptions","organizations_url":"https://api.github.com/users/md5crypt/orgs","repos_url":"https://api.github.com/users/md5crypt/repos","events_url":"https://api.github.com/users/md5crypt/events{/privacy}","received_events_url":"https://api.github.com/users/md5crypt/received_events","type":"User","site_admin":false},"repo":{"id":38008666,"name":"nodemcu-firmware","full_name":"md5crypt/nodemcu-firmware","owner":{"login":"md5crypt","id":6748075,"avatar_url":"https://avatars.githubusercontent.com/u/6748075?v=3","gravatar_id":"","url":"https://api.github.com/users/md5crypt","html_url":"https://github.com/md5crypt","followers_url":"https://api.github.com/users/md5crypt/followers","following_url":"https://api.github.com/users/md5crypt/following{/other_user}","gists_url":"https://api.github.com/users/md5crypt/gists{/gist_id}","starred_url":"https://api.github.com/users/md5crypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/md5crypt/subscriptions","organizations_url":"https://api.github.com/users/md5crypt/orgs","repos_url":"https://api.github.com/users/md5crypt/repos","events_url":"https://api.github.com/users/md5crypt/events{/privacy}","received_events_url":"https://api.github.com/users/md5crypt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/md5crypt/nodemcu-firmware","description":"lua based interactive firmware for mcu like esp8266","fork":true,"url":"https://api.github.com/repos/md5crypt/nodemcu-firmware","forks_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/forks","keys_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/teams","hooks_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/hooks","issue_events_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/events","assignees_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/tags","blobs_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/languages","stargazers_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/stargazers","contributors_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/contributors","subscribers_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/subscribers","subscription_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/subscription","commits_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/merges","archive_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/downloads","issues_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/labels{/name}","releases_url":"https://api.github.com/repos/md5crypt/nodemcu-firmware/releases{/id}","created_at":"2015-06-24T20:16:11Z","updated_at":"2015-06-24T20:16:14Z","pushed_at":"2015-06-29T21:17:11Z","git_url":"git://github.com/md5crypt/nodemcu-firmware.git","ssh_url":"git@github.com:md5crypt/nodemcu-firmware.git","clone_url":"https://github.com/md5crypt/nodemcu-firmware.git","svn_url":"https://github.com/md5crypt/nodemcu-firmware","homepage":"http://nodemcu.com","size":9061,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodemcu:dev","ref":"dev","sha":"dce0d2c2a8a11ea419e34687968df66dc3a3be61","user":{"login":"nodemcu","id":9865736,"avatar_url":"https://avatars.githubusercontent.com/u/9865736?v=3","gravatar_id":"","url":"https://api.github.com/users/nodemcu","html_url":"https://github.com/nodemcu","followers_url":"https://api.github.com/users/nodemcu/followers","following_url":"https://api.github.com/users/nodemcu/following{/other_user}","gists_url":"https://api.github.com/users/nodemcu/gists{/gist_id}","starred_url":"https://api.github.com/users/nodemcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodemcu/subscriptions","organizations_url":"https://api.github.com/users/nodemcu/orgs","repos_url":"https://api.github.com/users/nodemcu/repos","events_url":"https://api.github.com/users/nodemcu/events{/privacy}","received_events_url":"https://api.github.com/users/nodemcu/received_events","type":"User","site_admin":false},"repo":{"id":26917568,"name":"nodemcu-firmware","full_name":"nodemcu/nodemcu-firmware","owner":{"login":"nodemcu","id":9865736,"avatar_url":"https://avatars.githubusercontent.com/u/9865736?v=3","gravatar_id":"","url":"https://api.github.com/users/nodemcu","html_url":"https://github.com/nodemcu","followers_url":"https://api.github.com/users/nodemcu/followers","following_url":"https://api.github.com/users/nodemcu/following{/other_user}","gists_url":"https://api.github.com/users/nodemcu/gists{/gist_id}","starred_url":"https://api.github.com/users/nodemcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodemcu/subscriptions","organizations_url":"https://api.github.com/users/nodemcu/orgs","repos_url":"https://api.github.com/users/nodemcu/repos","events_url":"https://api.github.com/users/nodemcu/events{/privacy}","received_events_url":"https://api.github.com/users/nodemcu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nodemcu/nodemcu-firmware","description":"lua based interactive firmware for mcu like esp8266","fork":false,"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware","forks_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/forks","keys_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/teams","hooks_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/hooks","issue_events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/events","assignees_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/tags","blobs_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/languages","stargazers_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/stargazers","contributors_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/contributors","subscribers_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/subscribers","subscription_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/subscription","commits_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/merges","archive_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/downloads","issues_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/labels{/name}","releases_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/releases{/id}","created_at":"2014-11-20T15:06:45Z","updated_at":"2015-06-29T17:46:53Z","pushed_at":"2015-06-29T21:17:12Z","git_url":"git://github.com/nodemcu/nodemcu-firmware.git","ssh_url":"git@github.com:nodemcu/nodemcu-firmware.git","clone_url":"https://github.com/nodemcu/nodemcu-firmware.git","svn_url":"https://github.com/nodemcu/nodemcu-firmware","homepage":"http://nodemcu.com","size":46871,"stargazers_count":979,"watchers_count":979,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":414,"mirror_url":null,"open_issues_count":142,"forks":414,"open_issues":142,"watchers":979,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519"},"html":{"href":"https://github.com/nodemcu/nodemcu-firmware/pull/519"},"issue":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/519"},"comments":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/519/comments"},"review_comments":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519/comments"},"review_comment":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/pulls/519/commits"},"statuses":{"href":"https://api.github.com/repos/nodemcu/nodemcu-firmware/statuses/2691383696aa5d2ca3dedc158891f5eddc8a414c"}}}}