{"action":"opened","issue":{"url":"https://api.github.com/repos/k12a-cpu/rtl/issues/7","repository_url":"https://api.github.com/repos/k12a-cpu/rtl","labels_url":"https://api.github.com/repos/k12a-cpu/rtl/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/k12a-cpu/rtl/issues/7/comments","events_url":"https://api.github.com/repos/k12a-cpu/rtl/issues/7/events","html_url":"https://github.com/k12a-cpu/rtl/issues/7","id":157395354,"number":7,"title":"Deal with the situation where holding a button will cause the CPU to repeatedly awake from halt","user":{"login":"kierdavis","id":845652,"avatar_url":"https://avatars.githubusercontent.com/u/845652?v=3","gravatar_id":"","url":"https://api.github.com/users/kierdavis","html_url":"https://github.com/kierdavis","followers_url":"https://api.github.com/users/kierdavis/followers","following_url":"https://api.github.com/users/kierdavis/following{/other_user}","gists_url":"https://api.github.com/users/kierdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/kierdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kierdavis/subscriptions","organizations_url":"https://api.github.com/users/kierdavis/orgs","repos_url":"https://api.github.com/users/kierdavis/repos","events_url":"https://api.github.com/users/kierdavis/events{/privacy}","received_events_url":"https://api.github.com/users/kierdavis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-29T17:01:27Z","updated_at":"2016-05-29T17:01:27Z","closed_at":null,"body":"A typical usage of the \"wake\" functionality is to halt while waiting for a button press. When a button is pressed, control flow resumes and the program processes the button input. It will then usually halt again, waiting for another input. If the CPU processes the input quickly enough, the button may still be held by the time the second halt instruction is encountered, causing the CPU to immediately execute that button's action again.\r\n\r\nThis issue could be solved either in hardware or software.\r\n\r\n### Hardware solution\r\n\r\nImplement an 8-bit mask register. When transition from halt state to fetch state is made as a result of a button being held down, the bit corresponding to that button is set in the mask register. Buttons whose mask register bits are set are excluded from the computation of the 'wake' signal. Mask register bits are cleared upon release of the button.\r\n\r\n### Software solution\r\n\r\nEssentially emulate the mask register in software. This needs to be investigated."}}
{"actor":{"display_login":"kierdavis"}}