{"action":"closed","number":1599,"pull_request":{"url":"https://api.github.com/repos/micropython/micropython/pulls/1599","id":50034034,"html_url":"https://github.com/micropython/micropython/pull/1599","diff_url":"https://github.com/micropython/micropython/pull/1599.diff","patch_url":"https://github.com/micropython/micropython/pull/1599.patch","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1599","number":1599,"state":"closed","locked":false,"title":"delayed RTC initialization with LSI fallback","user":{"login":"chuckbook","id":15228620,"avatar_url":"https://avatars.githubusercontent.com/u/15228620?v=3","gravatar_id":"","url":"https://api.github.com/users/chuckbook","html_url":"https://github.com/chuckbook","followers_url":"https://api.github.com/users/chuckbook/followers","following_url":"https://api.github.com/users/chuckbook/following{/other_user}","gists_url":"https://api.github.com/users/chuckbook/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckbook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckbook/subscriptions","organizations_url":"https://api.github.com/users/chuckbook/orgs","repos_url":"https://api.github.com/users/chuckbook/repos","events_url":"https://api.github.com/users/chuckbook/events{/privacy}","received_events_url":"https://api.github.com/users/chuckbook/received_events","type":"User","site_admin":false},"body":"Also included:\r\n MICROPY_HW_RTC_USE_US\r\n        option to present datetime sub-seconds in µs\r\n MICROPY_HW_RTC_USE_LASTFREQ\r\n        hold pyb.freq() parameters in RTC backup reg\r\n MICROPY_HW_RTC_USE_CALOUT\r\n        option to enable RTC calibration output\r\n\r\nSample main.py to test some parameters:\r\n\r\n```\r\nimport pyb\r\nstupt=pyb.micros()\r\nimport stm\r\n\r\nrtc=pyb.RTC()\r\ninfo0=rtc.info()\r\nts0=pyb.micros()\r\nres=rtc.datetime()\r\nstm.mem32[stm.RTC+0x60]+=1\r\nif False:\r\n#if res[6] // 10 != 0:\r\n stm.mem32[stm.RTC+stm.RTC_BKP17R]=stm.mem32[stm.RTC+stm.RTC_BKP16R]\r\n stm.mem32[stm.RTC+stm.RTC_BKP16R]=(stm.mem32[stm.RTC] << 8) | (stm.mem32[stm.RTC+stm.RTC_SSR] & 0xff)\r\n stm.mem32[stm.RTC+stm.RTC_BKP19R]+=1\r\n import mymain\r\n\r\ndt=rtc.datetime()\r\ninfo1=rtc.info()\r\nts1=pyb.micros()\r\n\r\nprint('\\n%d us 0x%x %d us 0x%x %d us LSx_dt: %d us' % (stupt, info0, ts0-stupt, info1, ts1-stupt, ts1-ts0))\r\nprint('%d-%02d-%02d %02d:%02d:%02d.%06d' % (res[0], res[1], res[2], res[4], res[5], res[6], res[7]))\r\nadc=pyb.ADCAll(12)\r\ntry:\r\n    vref = adc.read_vref()\r\nexcept:\r\n    vref = 3.3\r\n\r\nprint('Tcore: %.1f C Vcore_ref: %.3f V Vbat: %.3f V Vref: %.3f V' % (adc.read_core_temp(), adc.read_core_vref(), adc.read_core_vbat(), vref))\r\nprint('freq: ', pyb.freq())\r\n\r\n```\r\n\r\nSample mymain.py\r\n\r\n```\r\nimport pyb\r\nrtc = pyb.RTC()\r\nrtc.wakeup(10000-96)\r\npyb.standby()\r\n```","created_at":"2015-11-07T11:24:52Z","updated_at":"2015-11-14T16:35:47Z","closed_at":"2015-11-14T16:35:47Z","merged_at":null,"merge_commit_sha":"3882d131867732320d2ccf6022480756fd13ccd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/micropython/micropython/pulls/1599/commits","review_comments_url":"https://api.github.com/repos/micropython/micropython/pulls/1599/comments","review_comment_url":"https://api.github.com/repos/micropython/micropython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1599/comments","statuses_url":"https://api.github.com/repos/micropython/micropython/statuses/9bad631e84ba74fc12b088d353438fb6186c8e64","head":{"label":"chuckbook:chuckbook_delayed_rtc","ref":"chuckbook_delayed_rtc","sha":"9bad631e84ba74fc12b088d353438fb6186c8e64","user":{"login":"chuckbook","id":15228620,"avatar_url":"https://avatars.githubusercontent.com/u/15228620?v=3","gravatar_id":"","url":"https://api.github.com/users/chuckbook","html_url":"https://github.com/chuckbook","followers_url":"https://api.github.com/users/chuckbook/followers","following_url":"https://api.github.com/users/chuckbook/following{/other_user}","gists_url":"https://api.github.com/users/chuckbook/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckbook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckbook/subscriptions","organizations_url":"https://api.github.com/users/chuckbook/orgs","repos_url":"https://api.github.com/users/chuckbook/repos","events_url":"https://api.github.com/users/chuckbook/events{/privacy}","received_events_url":"https://api.github.com/users/chuckbook/received_events","type":"User","site_admin":false},"repo":{"id":45341294,"name":"micropython","full_name":"chuckbook/micropython","owner":{"login":"chuckbook","id":15228620,"avatar_url":"https://avatars.githubusercontent.com/u/15228620?v=3","gravatar_id":"","url":"https://api.github.com/users/chuckbook","html_url":"https://github.com/chuckbook","followers_url":"https://api.github.com/users/chuckbook/followers","following_url":"https://api.github.com/users/chuckbook/following{/other_user}","gists_url":"https://api.github.com/users/chuckbook/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckbook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckbook/subscriptions","organizations_url":"https://api.github.com/users/chuckbook/orgs","repos_url":"https://api.github.com/users/chuckbook/repos","events_url":"https://api.github.com/users/chuckbook/events{/privacy}","received_events_url":"https://api.github.com/users/chuckbook/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chuckbook/micropython","description":"MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems","fork":true,"url":"https://api.github.com/repos/chuckbook/micropython","forks_url":"https://api.github.com/repos/chuckbook/micropython/forks","keys_url":"https://api.github.com/repos/chuckbook/micropython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chuckbook/micropython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chuckbook/micropython/teams","hooks_url":"https://api.github.com/repos/chuckbook/micropython/hooks","issue_events_url":"https://api.github.com/repos/chuckbook/micropython/issues/events{/number}","events_url":"https://api.github.com/repos/chuckbook/micropython/events","assignees_url":"https://api.github.com/repos/chuckbook/micropython/assignees{/user}","branches_url":"https://api.github.com/repos/chuckbook/micropython/branches{/branch}","tags_url":"https://api.github.com/repos/chuckbook/micropython/tags","blobs_url":"https://api.github.com/repos/chuckbook/micropython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chuckbook/micropython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chuckbook/micropython/git/refs{/sha}","trees_url":"https://api.github.com/repos/chuckbook/micropython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chuckbook/micropython/statuses/{sha}","languages_url":"https://api.github.com/repos/chuckbook/micropython/languages","stargazers_url":"https://api.github.com/repos/chuckbook/micropython/stargazers","contributors_url":"https://api.github.com/repos/chuckbook/micropython/contributors","subscribers_url":"https://api.github.com/repos/chuckbook/micropython/subscribers","subscription_url":"https://api.github.com/repos/chuckbook/micropython/subscription","commits_url":"https://api.github.com/repos/chuckbook/micropython/commits{/sha}","git_commits_url":"https://api.github.com/repos/chuckbook/micropython/git/commits{/sha}","comments_url":"https://api.github.com/repos/chuckbook/micropython/comments{/number}","issue_comment_url":"https://api.github.com/repos/chuckbook/micropython/issues/comments{/number}","contents_url":"https://api.github.com/repos/chuckbook/micropython/contents/{+path}","compare_url":"https://api.github.com/repos/chuckbook/micropython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chuckbook/micropython/merges","archive_url":"https://api.github.com/repos/chuckbook/micropython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chuckbook/micropython/downloads","issues_url":"https://api.github.com/repos/chuckbook/micropython/issues{/number}","pulls_url":"https://api.github.com/repos/chuckbook/micropython/pulls{/number}","milestones_url":"https://api.github.com/repos/chuckbook/micropython/milestones{/number}","notifications_url":"https://api.github.com/repos/chuckbook/micropython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chuckbook/micropython/labels{/name}","releases_url":"https://api.github.com/repos/chuckbook/micropython/releases{/id}","created_at":"2015-11-01T13:25:53Z","updated_at":"2015-11-01T13:26:05Z","pushed_at":"2015-11-07T11:23:54Z","git_url":"git://github.com/chuckbook/micropython.git","ssh_url":"git@github.com:chuckbook/micropython.git","clone_url":"https://github.com/chuckbook/micropython.git","svn_url":"https://github.com/chuckbook/micropython","homepage":"","size":22140,"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":"micropython:master","ref":"master","sha":"e6dccaf18eaaf7aeb80c51c796c2d2036ff49b6b","user":{"login":"micropython","id":6298560,"avatar_url":"https://avatars.githubusercontent.com/u/6298560?v=3","gravatar_id":"","url":"https://api.github.com/users/micropython","html_url":"https://github.com/micropython","followers_url":"https://api.github.com/users/micropython/followers","following_url":"https://api.github.com/users/micropython/following{/other_user}","gists_url":"https://api.github.com/users/micropython/gists{/gist_id}","starred_url":"https://api.github.com/users/micropython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micropython/subscriptions","organizations_url":"https://api.github.com/users/micropython/orgs","repos_url":"https://api.github.com/users/micropython/repos","events_url":"https://api.github.com/users/micropython/events{/privacy}","received_events_url":"https://api.github.com/users/micropython/received_events","type":"Organization","site_admin":false},"repo":{"id":15337142,"name":"micropython","full_name":"micropython/micropython","owner":{"login":"micropython","id":6298560,"avatar_url":"https://avatars.githubusercontent.com/u/6298560?v=3","gravatar_id":"","url":"https://api.github.com/users/micropython","html_url":"https://github.com/micropython","followers_url":"https://api.github.com/users/micropython/followers","following_url":"https://api.github.com/users/micropython/following{/other_user}","gists_url":"https://api.github.com/users/micropython/gists{/gist_id}","starred_url":"https://api.github.com/users/micropython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micropython/subscriptions","organizations_url":"https://api.github.com/users/micropython/orgs","repos_url":"https://api.github.com/users/micropython/repos","events_url":"https://api.github.com/users/micropython/events{/privacy}","received_events_url":"https://api.github.com/users/micropython/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/micropython/micropython","description":"MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems","fork":false,"url":"https://api.github.com/repos/micropython/micropython","forks_url":"https://api.github.com/repos/micropython/micropython/forks","keys_url":"https://api.github.com/repos/micropython/micropython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/micropython/micropython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/micropython/micropython/teams","hooks_url":"https://api.github.com/repos/micropython/micropython/hooks","issue_events_url":"https://api.github.com/repos/micropython/micropython/issues/events{/number}","events_url":"https://api.github.com/repos/micropython/micropython/events","assignees_url":"https://api.github.com/repos/micropython/micropython/assignees{/user}","branches_url":"https://api.github.com/repos/micropython/micropython/branches{/branch}","tags_url":"https://api.github.com/repos/micropython/micropython/tags","blobs_url":"https://api.github.com/repos/micropython/micropython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/micropython/micropython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/micropython/micropython/git/refs{/sha}","trees_url":"https://api.github.com/repos/micropython/micropython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/micropython/micropython/statuses/{sha}","languages_url":"https://api.github.com/repos/micropython/micropython/languages","stargazers_url":"https://api.github.com/repos/micropython/micropython/stargazers","contributors_url":"https://api.github.com/repos/micropython/micropython/contributors","subscribers_url":"https://api.github.com/repos/micropython/micropython/subscribers","subscription_url":"https://api.github.com/repos/micropython/micropython/subscription","commits_url":"https://api.github.com/repos/micropython/micropython/commits{/sha}","git_commits_url":"https://api.github.com/repos/micropython/micropython/git/commits{/sha}","comments_url":"https://api.github.com/repos/micropython/micropython/comments{/number}","issue_comment_url":"https://api.github.com/repos/micropython/micropython/issues/comments{/number}","contents_url":"https://api.github.com/repos/micropython/micropython/contents/{+path}","compare_url":"https://api.github.com/repos/micropython/micropython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/micropython/micropython/merges","archive_url":"https://api.github.com/repos/micropython/micropython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/micropython/micropython/downloads","issues_url":"https://api.github.com/repos/micropython/micropython/issues{/number}","pulls_url":"https://api.github.com/repos/micropython/micropython/pulls{/number}","milestones_url":"https://api.github.com/repos/micropython/micropython/milestones{/number}","notifications_url":"https://api.github.com/repos/micropython/micropython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/micropython/micropython/labels{/name}","releases_url":"https://api.github.com/repos/micropython/micropython/releases{/id}","created_at":"2013-12-20T11:47:07Z","updated_at":"2015-11-14T01:09:24Z","pushed_at":"2015-11-14T15:55:17Z","git_url":"git://github.com/micropython/micropython.git","ssh_url":"git@github.com:micropython/micropython.git","clone_url":"https://github.com/micropython/micropython.git","svn_url":"https://github.com/micropython/micropython","homepage":"","size":50721,"stargazers_count":2436,"watchers_count":2436,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":481,"mirror_url":null,"open_issues_count":177,"forks":481,"open_issues":177,"watchers":2436,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/micropython/micropython/pulls/1599"},"html":{"href":"https://github.com/micropython/micropython/pull/1599"},"issue":{"href":"https://api.github.com/repos/micropython/micropython/issues/1599"},"comments":{"href":"https://api.github.com/repos/micropython/micropython/issues/1599/comments"},"review_comments":{"href":"https://api.github.com/repos/micropython/micropython/pulls/1599/comments"},"review_comment":{"href":"https://api.github.com/repos/micropython/micropython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/micropython/micropython/pulls/1599/commits"},"statuses":{"href":"https://api.github.com/repos/micropython/micropython/statuses/9bad631e84ba74fc12b088d353438fb6186c8e64"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":2,"review_comments":4,"commits":1,"additions":333,"deletions":138,"changed_files":7}}