{"action":"opened","issue":{"url":"https://api.github.com/repos/mon80/hello-world2/issues/2","repository_url":"https://api.github.com/repos/mon80/hello-world2","labels_url":"https://api.github.com/repos/mon80/hello-world2/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mon80/hello-world2/issues/2/comments","events_url":"https://api.github.com/repos/mon80/hello-world2/issues/2/events","html_url":"https://github.com/mon80/hello-world2/issues/2","id":183458143,"number":2,"title":"test2","user":{"login":"mon80","id":22886334,"avatar_url":"https://avatars.githubusercontent.com/u/22886334?v=3","gravatar_id":"","url":"https://api.github.com/users/mon80","html_url":"https://github.com/mon80","followers_url":"https://api.github.com/users/mon80/followers","following_url":"https://api.github.com/users/mon80/following{/other_user}","gists_url":"https://api.github.com/users/mon80/gists{/gist_id}","starred_url":"https://api.github.com/users/mon80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mon80/subscriptions","organizations_url":"https://api.github.com/users/mon80/orgs","repos_url":"https://api.github.com/users/mon80/repos","events_url":"https://api.github.com/users/mon80/events{/privacy}","received_events_url":"https://api.github.com/users/mon80/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-17T16:04:27Z","updated_at":"2016-10-17T16:04:27Z","closed_at":null,"body":"I am facing following error while using FT232RL under Windows environment.\r\n\r\n&gt;rl78flash -m 2 -b 250000 -iav COM14 cotton_sketch.mot\r\nFAILED\r\nSynchronization failed\r\n\r\nI have debugged this problem for a while and I get an idea to fix this problem.\r\n\r\nfile: serial_win32.c\r\n\r\nport_handle_t serial_open(const char *port)\r\n{\r\n&nbsp;&nbsp;&nbsp;&nbsp;port_handle_t fd;\r\n&nbsp;&nbsp;&nbsp;&nbsp;char port_full_name[20];\r\n&nbsp;&nbsp;&nbsp;&nbsp;snprintf(port_full_name, sizeof port_full_name - 2u,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sizeof error_string,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fprintf(stderr, \"Unable to open port: (%i) %s\\n\", error_num, error_string);\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;else\r\n&nbsp;&nbsp;&nbsp;&nbsp;{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DCB dcbSerialParams;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetCommState(fd, &dcbSerialParams);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dcbSerialParams.BaudRate = CBR_115200;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dcbSerialParams.ByteSize = 8;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dcbSerialParams.StopBits = TWOSTOPBITS;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dcbSerialParams.Parity = NOPARITY;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dcbSerialParams.fDtrControl = DTR_CONTROL_DISABLE;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dcbSerialParams.fRtsControl = RTS_CONTROL_DISABLE;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetCommState(fd, &dcbSerialParams);\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMTIMEOUTS timeouts;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeouts.ReadIntervalTimeout=50;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeouts.ReadTotalTimeoutConstant=50;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeouts.ReadTotalTimeoutMultiplier=10;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeouts.WriteTotalTimeoutConstant=0;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeouts.WriteTotalTimeoutMultiplier=0;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetCommTimeouts(fd, &timeouts);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FlushFileBuffers(fd);\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;return fd;\r\n}\r\n"}}
{"actor":{"display_login":"mon80"}}