{"id":410687,"date":"2024-06-29T21:31:43","date_gmt":"2024-06-29T21:31:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=410687"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=410687","title":{"rendered":"<span>\u041f\u0438\u0448\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043d\u0430 \u0421<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/60c\/ab5\/33f\/60cab533f360373b6f581eb93703a92a.png\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/60c\/ab5\/33f\/60cab533f360373b6f581eb93703a92a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0433\u0435\u043a\u0441\u0430\u043f\u043e\u0434\u043e\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043d\u0438\u043c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0442\u0435\u0441\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Linux \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0434\u043b\u044f \u0433\u0435\u043a\u0441\u0430\u043f\u043e\u0434\u0430? \u042f \u0431\u044b\u043b \u0443\u0434\u0438\u0432\u043b\u0435\u043d, \u0447\u0442\u043e \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 &#171;STM32 terminal&#187; \u043d\u0435 \u0431\u044b\u043b\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041d\u0443 \u0440\u0430\u0437 \u043d\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0445, \u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0440\u0430\u0434\u043e\u0441\u0442\u0435\u0439, \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u2192 <a href=\"https:\/\/github.com\/NeoProg2013\/terminal-server\" rel=\"noopener noreferrer nofollow\">Github<\/a><\/p>\n<h2>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u0438\u044f<\/h2>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b, \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u2014 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c (KiTTY, PuTTY \u0438 \u043f\u0440\u043e\u0447\u0438\u0435). \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (PC). \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0432\u0438\u0434\u0435 KiTTY.<\/p>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u044f \u0438 \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<h2>\u0410\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c STM32F030. \u041e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 MCU \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0440\u0435\u0437 USB-USART \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c CH340E.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/444\/aef\/b7e\/444aefb7ebc72b6f59a237e9e3f5a5e1.jpg\" alt=\"CH340E\" title=\"CH340E\" width=\"150\" height=\"135\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/444\/aef\/b7e\/444aefb7ebc72b6f59a237e9e3f5a5e1.jpg\" data-blurred=\"true\"\/><figcaption>CH340E<\/figcaption><\/figure>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430? \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0442.\u0435. \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0430\u043d\u0430\u043b\u043e\u0433 TCP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0432 \u0436\u0435\u043b\u0435\u0437\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0438 \u044d\u0442\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u2014 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c DTR. \u041f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u044d\u0442\u043e\u0442 \u0432\u044b\u0432\u043e\u0434 \u0438 \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u043e\u0433\u0443 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<ul>\n<li>\n<p>DTR=Low \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043a\u0440\u044b\u043b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b;<\/p>\n<\/li>\n<li>\n<p>DTR=High \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043a\u0440\u044b\u043b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b;<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 &#171;\u0437\u0430\u0431\u044b\u0442\u044c&#187; \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e \u0438 \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0431\u0443\u0444\u0435\u0440\u044b. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043d\u0435\u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e \u043a\u0430\u043d\u043e\u043d\u0443 \ud83d\ude42<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e 4 \u043f\u0440\u043e\u0432\u043e\u0434\u0430: RX, TX, DTR, GND. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u2014 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432. \u041d\u0430 \u044d\u0442\u043e\u043c \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c.<\/p>\n<h2>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u0423\u041f) \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b (\u0423\u0421)<\/h2>\n<p>\u0427\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b? \u0412\u0441\u044f \u0432\u043e\u0442 \u044d\u0442\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u0440\u0430\u0437\u043d\u043e\u0446\u0432\u0435\u0442\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043a\u0430 \u044d\u0442\u043e &#171;\u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440&#187;, \u043d\u0435\u0432\u0430\u0436\u043d\u043e SSH \u0442\u0430\u043c \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u041d\u0443\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043e \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445 \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0423\u041f \u0438 \u0423\u0421.<\/p>\n<h4>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 (\u0423\u041f)<\/h4>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0423\u041f \u043a\u0430\u043a \u043d\u0435\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u0443\u0440\u0441\u043e\u0440 \u0432\u043b\u0435\u0432\u043e (\u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440), \u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u043a-\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0431 \u044d\u0442\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0423\u041f.<\/p>\n<p>\u0423\u041f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 ESC (0\u04451\u0412), \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0434\u0443\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0439\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0432\u043b\u0435\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434: [0x1B 0x5B 0x44]. <\/p>\n<h4>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b (\u0423\u0421)<\/h4>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0423\u041f \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c 1 \u0431\u0430\u0439\u0442. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \\r (0x0D) \u0438 \\n (0x0A). \u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 ANSII \u0442\u0430\u0431\u043b\u0438\u0446\u044b [0x00 &#8212; 0x31, 0x7F] \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0441 \u043d\u0438\u043c\u0438 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0442\u043e \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0435 Ctrl+C. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044d\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b 0x03 (End of text). \u0414\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0435\u0441\u0441\u0438\u0438 Ctrl+D, \u044d\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 0x04 (End of transmission) \u0438 \u0442.\u0434.<\/p>\n<h3>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0423\u041f \u0438 \u0423\u0421, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0447\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435. <a href=\"https:\/\/en.wikipedia.org\/wiki\/ANSI_escape_code\" rel=\"noopener noreferrer nofollow\">\u0411\u043e\u043b\u0435\u0435 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u0438\u0445 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0443\u0442<\/a><\/p>\n<ul>\n<li>\n<p>&#171;\\x0D&#187; \u2014 Carriage Return (CR, \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043a\u0430\u0440\u0435\u0442\u043a\u0438), \u043e\u043d \u0436\u0435 \\r;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x0A&#187; \u2014 Line Feed  (LF, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043a\u0430\u0440\u0435\u0442\u043a\u0438), \u043e\u043d \u0436\u0435 \\n;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x0D&#187; \u2014 TAB button (\u043d\u0443 \u043a\u0443\u0434\u0430 \u0436\u0435 \u0431\u0435\u0437 \u0430\u0432\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434);<\/p>\n<\/li>\n<li>\n<p>&#171;\\x7F&#187; \u0438 &#171;\\x08&#187; \u2014 BACKSPACE button;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[3~&#187; \u2014 DEL button;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[A&#187; \u0438 &#171;\\x1B[B&#187; \u2014 arrow up \\ down;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[D&#187; \u0438 &#171;\\x1B[C&#187; \u2014 arrow left \\ right;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[4~&#187; \u2014 END button;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[1~&#187; \u2014 HOME button;<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0423\u041f \u0438 \u0423\u0421 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u0434\u0432\u0435 \u0445\u0438\u0442\u0440\u044b\u0445 \u0423\u041f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0431\u0443\u0434\u0443 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443. \u041f\u0440\u0438 \u043f\u043e\u0441\u044b\u043b\u043a\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0430 \u0435\u0433\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b, \u043d\u043e \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u0443\u0440\u0441\u043e\u0440. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0423\u041f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0435\u0436\u0435\u043d\u0438\u0435 \u0437\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0438 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e USART. <\/p>\n<ul>\n<li>\n<p>&#171;\\x1B[s&#187; \u2014 \u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[u&#187; \u2014 \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430;<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u043a\u0438\u043d\u0435\u043c \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">static inline void save_cursor_pos() { send_data(\"\\x1B[s\", 3); } static inline void load_cursor_pos() { send_data(\"\\x1B[u\", 3); }<\/code><\/pre>\n<p><em>\u0412\u0430\u0436\u043d\u043e: \u043d\u0435 \u0432\u0441\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u044d\u0442\u043e \u0432\u0432\u0438\u0434\u0443.<\/em><\/p>\n<h2>\u041d\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u0434 \u043f\u043e\u043f\u0438\u0448\u0435\u043c<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u2014 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 USART. \u0412\u0436\u0443\u0445 \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0433\u043e\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">int main() {     system_init(); \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, FLASH latency \u0438 \u0442.\u043f.         \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f USART1     RCC->APB2ENR |= RCC_APB2ENR_USART1EN;     while ((RCC->APB2ENR &amp; RCC_APB2ENR_USART1EN) == 0);          \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 TX \u0432\u044b\u0432\u043e\u0434\u0430     gpio_set_mode        (GPIOA, USART_TX_PIN, GPIO_MODE_AF); \/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0438\u043d\u043e\u043c \u043f\u0435\u0440\u0435\u0444\u0435\u0440\u0438\u0438      gpio_set_output_speed(GPIOA, USART_TX_PIN, GPIO_SPEED_HIGH); \/\/ \u041d\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0438\u043d\u0430     gpio_set_pull        (GPIOA, USART_TX_PIN, GPIO_PULL_NO); \/\/ \u0411\u0435\u0437 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u043e\u0440\u043e\u0432 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f     gpio_set_af          (GPIOA, USART_TX_PIN, 1); \/\/ \u041a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u0438\u043d, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 USART1          \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 RX \u0432\u044b\u0432\u043e\u0434\u0430     gpio_set_mode        (GPIOA, USART_RX_PIN, GPIO_MODE_AF);     gpio_set_output_speed(GPIOA, USART_RX_PIN, GPIO_SPEED_HIGH);     gpio_set_pull        (GPIOA, USART_RX_PIN, GPIO_PULL_UP);     gpio_set_af          (GPIOA, USART_RX_PIN, 1);      \/\/ \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f USART: 8N1, 115200     RCC->APB2RSTR |= RCC_APB2RSTR_USART1RST;     RCC->APB2RSTR &amp;= ~RCC_APB2RSTR_USART1RST;     USART1->BRR = SYSTEM_CLOCK_FREQUENCY \/ 115200;      \/\/ \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c USART1     USART1->CR1 |= USART_CR1_UE;     USART1->CR1 |= USART_CR1_TE | USART_CR1_RE;          while (true) {         if (USART1->ISR &amp; USART_ISR_RXNE) {             uint8_t data = USART1->RDR;         }     } }  void send_data(const char* data, uint8_t size) {     while (size) {         while ((USART1->ISR &amp; USART_ISR_TXE) != USART_ISR_TXE);         USART1->TDR = *data;         ++data;         --size;     } }<\/code><\/pre>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431\u0449\u0443\u044e \u0438\u0434\u0435\u044e. \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 (polling) \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0438 DMA. \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u044d\u0442\u043e \u0432 \u0443\u0433\u043e\u0434\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043a\u0430 \u0432 \u043d\u0438\u043a\u0443\u0434\u0430, \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0435\u0451 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0442 \u043c\u043e\u0433 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0442\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 (\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0438 \u0432\u0441\u0435 \u0442\u0430\u043a\u043e\u0435).<\/p>\n<h2>\u041f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438<\/h2>\n<p>&#171;\u041d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438&#187; \u0437\u0432\u0443\u0447\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e. \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0435\u0451 \u0441\u043a\u0430\u043d-\u043a\u043e\u0434, \u0430 \u0442\u043e\u0442 \u0443\u0436\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u0447\u0442\u043e \u0441 \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u0441\u043a\u0430\u043d-\u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0423\u041f.<\/p>\n<p><em>\u0423\u041f \u0438 <\/em>\u0423\u0421<em> \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u043e \u0441\u0443\u0442\u0438 \u0442\u043e \u043e\u043d\u0438 \u043d\u0438 \u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/em><\/p>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0432\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0423\u041f \u0438 \u0423\u0421 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440. \u0415\u0449\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0418 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cpp\">typedef struct {     char cmd[MAX_COMMAND_LENGTH];     uint16_t length; } cmd_info_t;   static term_srv_cmd_t esc_seq_list[ESCAPE_SEQUENCES_COUNT] = {     { .cmd = \"\\x0D\",    .len = 1, .handler = esc_return_handler,    },     { .cmd = \"\\x0A\",    .len = 1, .handler = esc_return_handler,    },     { .cmd = \"\\x7F\",    .len = 1, .handler = esc_backspace_handler, },     { .cmd = \"\\x08\",    .len = 1, .handler = esc_backspace_handler, },     { .cmd = \"\\x1B[3~\", .len = 4, .handler = esc_del_handler,       },     { .cmd = \"\\x1B[A\",  .len = 3, .handler = esc_up_handler,        },     { .cmd = \"\\x1B[B\",  .len = 3, .handler = esc_down_handler,      },     { .cmd = \"\\x1B[D\",  .len = 3, .handler = esc_left_handler,      },     { .cmd = \"\\x1B[C\",  .len = 3, .handler = esc_right_handler,     },     { .cmd = \"\\x1B[4~\", .len = 4, .handler = esc_end_handler,       },     { .cmd = \"\\x1B[1~\", .len = 4, .handler = esc_home_handler,      } };  static void(*send_data)(const char* data, uint16_t) = NULL; \/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 static term_srv_cmd_t* ext_cmd_list = NULL; \/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 static uint8_t ext_cmd_count = 0; \/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434  static uint16_t cursor_pos = 0; \/\/ \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 static cmd_info_t current_cmd = {0}; \/\/ \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0432\u043e\u0434\u0438\u043c\u043e\u0439 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 static char esc_seq_buffer[10] = {0}; \/\/ \u0411\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 static uint16_t esc_seq_length = 0; \/\/ \u0414\u043b\u0438\u043d\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442  static cmd_info_t history_elements[MAX_COMMAND_HISTORY_LENGTH] = {0}; \/\/ \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u0442\u043e\u0440\u0438\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 static cmd_info_t* history[MAX_COMMAND_HISTORY_LENGTH] = {0}; \/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u0412\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 static int16_t history_len = 0; \/\/ \u0414\u043b\u0438\u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u043d\u0435\u0439) static int16_t history_pos = -1; \/\/ \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/code><\/pre>\n<p><strong>esc_seq_list <\/strong>\u044d\u0442\u043e \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0423\u041f \u0438 \u0423\u0421, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0431\u0443\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0435\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430, \u0435\u0451 \u0434\u043b\u0438\u043d\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0438 \u0442.\u043f.)<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c (\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b):<\/p>\n<pre><code class=\"cpp\">#ifndef _TERM_SRV_H_ #define _TERM_SRV_H_ #include &lt;stdint.h>  \/\/ Settings #define MAX_COMMAND_HISTORY_LENGTH          (3)     \/\/ Command count in history #define MAX_COMMAND_LENGTH                  (64)    \/\/ Command length in bytes #define GREETING_STRING                     (\"\\x1B[36mroot@hexapod-AIWM: \\x1B[0m\") #define UNKNOWN_COMMAND_STRING              (\"\\x1B[31m - command not found\\x1B[0m\")   typedef struct {     char* cmd;     uint16_t len;     void(*handler)(const char* cmd); } term_srv_cmd_t;   extern void term_srv_init(void(*_send_data)(const char*, uint16_t), term_srv_cmd_t* _ext_cmd_list, uint8_t _ext_cmd_count); extern void term_srv_attach(void); extern void term_srv_detach(void); extern void term_srv_process(char symbol);   #endif \/\/ _TERM_SRV_H_ <\/code><\/pre>\n<p><strong>term_srv_init<\/strong> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0412 \u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u0412 \u0441\u0430\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0435\u0451 \u0434\u043b\u0438\u043d\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p><strong>term_srv_process<\/strong> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0412 \u043d\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b. \u0415\u0451 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 USART \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0435\u043c\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430.<\/p>\n<p><strong>term_srv_attach <\/strong>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u0412 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>term_srv_detach<\/strong> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0431\u0440\u043e\u0441\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430 DTR \u043f\u0438\u043d\u0435 \u0438\u043b\u0438 \u0435\u0449\u0435 \u043f\u0440\u0438 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0438. <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438? \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e:<\/p>\n<pre><code class=\"cpp\">void term_srv_init(void(*_send_data)(const char*, uint16_t), term_srv_cmd_t* _ext_cmd_list, uint8_t _ext_cmd_count) {     send_data = _send_data;     ext_cmd_list = _ext_cmd_list;     ext_cmd_count = _ext_cmd_count;     term_srv_detach(); }  void term_srv_attach(void) {     send_data(\"\\r\\n\", 2);     send_data(GREETING_STRING, strlen(GREETING_STRING)); }  void term_srv_detach(void) {     cursor_pos = 0;     memset(&amp;current_cmd, 0, sizeof(current_cmd));          esc_seq_length = 0;     memset(esc_seq_buffer, 0, sizeof(esc_seq_buffer));          memset(history_elements, 0, sizeof(history_elements));     for (int16_t i = 0; i &lt; MAX_COMMAND_HISTORY_LENGTH; ++i) {         history[i] = &amp;history_elements[i];     }     history_len = 0;     history_pos = 0; }<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 init \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 detach \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451. \u041a\u0430\u043a-\u0431\u0443\u0434\u0442\u043e \u043d\u0435\u0447\u0435\u0433\u043e \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e. \u0412 attach \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432<\/p>\n<pre><code class=\"cpp\">void term_srv_process(char symbol) {     if (current_cmd.length + 1 >= MAX_COMMAND_LENGTH) {         return; \/\/ Incoming buffer is overflow     }          if (esc_seq_length == 0) {         \/\/ Check escape signature         if (symbol &lt;= 0x1F || symbol == 0x7F) {             esc_seq_buffer[esc_seq_length++] = symbol;         }         \/\/ Print symbol if escape sequence signature is not found         if (esc_seq_length == 0) {             if (cursor_pos &lt; current_cmd.length) {                 memmove(&amp;current_cmd.cmd[cursor_pos + 1], &amp;current_cmd.cmd[cursor_pos], current_cmd.length - cursor_pos); \/\/ Offset symbols after cursor                 save_cursor_pos();                 send_data(&amp;current_cmd.cmd[cursor_pos], current_cmd.length - cursor_pos + 1);                 load_cursor_pos();             }             current_cmd.cmd[cursor_pos++] = symbol;             ++current_cmd.length;             send_data(&amp;symbol, 1);          }     } else {         esc_seq_buffer[esc_seq_length++] = symbol;     }          \/\/ Process escape sequence     if (esc_seq_length != 0) {         int8_t possible_esc_seq_count = 0;         int8_t possible_esc_idx = 0;         for (int8_t i = 0; i &lt; ESCAPE_SEQUENCES_COUNT; ++i) {             if (esc_seq_length &lt;= esc_seq_list[i].len &amp;&amp; memcmp(esc_seq_buffer, esc_seq_list[i].cmd, esc_seq_length) == 0) {                 ++possible_esc_seq_count;                 possible_esc_idx = i;             }         }                  switch (possible_esc_seq_count) {         case 0: \/\/ No sequence - display all symbols             for (int8_t i = 0; i &lt; esc_seq_length &amp;&amp; current_cmd.len + 1 &lt; MAX_COMMAND_LENGTH; ++i) {                 if (esc_seq_buffer[i] &lt;= 0x1F || esc_seq_buffer[i] == 0x7F) {                     esc_seq_buffer[i] = '?';                 }                 current_cmd.cmd[cursor_pos + i] = esc_seq_buffer[i];                 ++current_cmd.len;             }             send_data(&amp;current_cmd.cmd[cursor_pos], esc_seq_length);             cursor_pos += esc_seq_length;             esc_seq_length = 0;             break;                  case 1: \/\/ We found one possible sequence - check size and call handler             if (esc_seq_list[possible_esc_idx].len == esc_seq_length) {                 esc_seq_length = 0;                 esc_seq_list[possible_esc_idx].handler();             }             break;                  default: \/\/ We found few possible sequences             break;         }     } }<\/code><\/pre>\n<p>\u041f\u043e\u0433\u043d\u0430\u043b\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u043c.<\/p>\n<ul>\n<li>\n<p>8-10: \u0442\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043d\u0430 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u0423\u041f \u0438 \u0423\u0421, \u0435\u0441\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0435\u0451 \u0435\u0449\u0435 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438. \u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u0441\u0435 \u0436\u0435 \u043d\u0430\u0448\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435, \u0442\u043e \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u0443\u0444\u0435\u0440 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0435\u0436\u0438\u043c \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (esc_seq_length != 0);<\/p>\n<\/li>\n<li>\n<p>12-21: \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u043d\u0430\u0448\u043b\u0438 \u043f\u0440\u0438\u0447\u0438\u043d \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0423\u041f \u0438\u043b\u0438 \u0423\u0421, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u0431\u0443\u0444\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>13-18: \u044d\u0442\u043e\u0442 \u043a\u0435\u0439\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0435\u0433\u043e \u0440\u0430\u043d\u0435\u0435). \u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u0441\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432\u043f\u0440\u0430\u0432\u043e \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0422\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f save_cursor_pos \u0438 load_cursor_pos, \u0447\u0442\u043e\u0431\u044b \u0440\u0443\u043a\u0430\u043c\u0438 \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a\u0443\u0440\u0441\u043e\u0440\u0430 &#8212; \u043f\u0443\u0441\u0442\u044c \u0437\u0430 \u043d\u0430\u0441 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442;<\/p>\n<\/li>\n<li>\n<p>29-36: \u0441\u044e\u0434\u0430 \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0423\u041f \u0438 \u0423\u0421. \u0422\u0443\u0442 \u043c\u044b \u0431\u0435\u0433\u0430\u0435\u043c \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043f\u0438\u0441\u043a\u0443 \u0438 \u0438\u0449\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439.<br \/>&#8212; <em>possible_esc_seq_count<\/em> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0442\u0430\u043a\u0438\u0445 \u043d\u0430\u0448\u043b\u0438, <br \/>&#8212; <em>possible_esc_idx<\/em> \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>40-50: \u0441\u044e\u0434\u0430 \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c, \u0435\u0441\u043b\u0438 \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u0423\u041f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0435 \u0423\u041f, \u043b\u0438\u0431\u043e \u043c\u044b \u0435\u0451 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0451 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0430 &#8216;?&#8217;;<\/p>\n<\/li>\n<li>\n<p>47-52: \u0441\u044e\u0434\u0430 \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c, \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0423\u041f \u0438\u043b\u0438 \u0423\u0421, \u043d\u043e \u043c\u043e\u0433\u043b\u0438 \u0435\u0451 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043d\u044f\u0442\u044c (\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0451 \u0434\u043b\u0438\u043d\u0443). \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0435\u0451 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u2014 \u0434\u0435\u0440\u0433\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0430\u043c\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u044b \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0423\u041f \u0438 \u0423\u0421<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u0435\u0449\u0435\u0439: \\r \u0438 \\n, \u0441\u0442\u0440\u0435\u043b\u043e\u043a \u0432\u043b\u0435\u0432\u043e\\\u0432\u043f\u0440\u0430\u0432\u043e, home, end.<\/p>\n<pre><code class=\"cpp\">static void esc_return_handler(const char* cmd) {     send_data(\"\\r\\n\", 2);          \/\/ Add command into history     if (current_cmd.len) {         if (history_len >= MAX_COMMAND_HISTORY_LENGTH) {             \/\/ If history is overflow -- offset all items to begin by 1 position, first item move to end             void* temp_addr = history[0];             for (int16_t i = 0; i &lt; MAX_COMMAND_HISTORY_LENGTH - 1; ++i) {                 history[i] = history[i + 1];             }             history[MAX_COMMAND_HISTORY_LENGTH - 1] = temp_addr;             --history_len;         }         memcpy(history[history_len++], &amp;current_cmd, sizeof(current_cmd));         history_pos = history_len;     }          \/\/ Calc command length without args     void* addr = memchr(current_cmd.cmd, ' ', current_cmd.len);     int16_t cmd_len = current_cmd.len;     if (addr != NULL) {         cmd_len = (uint32_t)addr - (uint32_t)current_cmd.cmd;     }          \/\/ Search command     bool is_find = false;     for (int16_t i = 0; i &lt; ext_cmd_count; ++i) {         if (cmd_len == ext_cmd_list[i].len &amp;&amp; memcmp(ext_cmd_list[i].cmd, current_cmd.cmd, cmd_len) == 0) {             ext_cmd_list[i].handler(current_cmd.cmd);             send_data(\"\\r\\n\", 2);             is_find = true;             break;         }     }     if (!is_find &amp;&amp; cmd_len) {         send_data(current_cmd.cmd, cmd_len);         send_data(UNKNOWN_COMMAND_STRING, strlen(UNKNOWN_COMMAND_STRING));         send_data(\"\\r\\n\", 2);     }     send_data(GREETING_STRING, strlen(GREETING_STRING));      \/\/ Clear buffer to new command     memset(&amp;current_cmd, 0, sizeof(current_cmd));     cursor_pos = 0; } static void esc_left_handler(const char* cmd) {     if (cursor_pos > 0) {         send_data(\"\\x1B[D\", 3);         --cursor_pos;     } } static void esc_right_handler(const char* cmd) {     if (cursor_pos &lt; current_cmd.length) {         send_data(\"\\x1B[C\", 3);         ++cursor_pos;     } } static void esc_home_handler(const char* cmd) {     while (cursor_pos > 0) {         send_data(\"\\x1B[D\", 3);         --cursor_pos;     } } static void esc_end_handler(const char* cmd) {     while (cursor_pos &lt; current_cmd.length) {         send_data(\"\\x1B[C\", 3);         ++cursor_pos;     } }<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e. <\/p>\n<p><em>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 cmd \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 NULL, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 term_srv_cmd_t, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0438\u0437-\u0437\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0432 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0435.<\/em><\/p>\n<ul>\n<li>\n<p><strong>esc_return_handler:<\/strong> \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 &#171;\\r\\n&#187;, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443 \u043a\u0430\u0440\u0435\u0442\u043a\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0435\u0451 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0438\u0449\u0435\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0434\u0435\u0440\u0433\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 <em>(\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e &#171;root@hexapod-AIWM: &#171;)<\/em> <\/p>\n<\/li>\n<li>\n<p><strong>esc_right_handler \u0438 esc_left_handler: <\/strong>\u0442\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043c\u0435\u0449\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u043c \u0423\u041f &#171;\\x1B[C&#187; \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u0443\u0440\u0441\u043e\u0440 \u0443\u0436\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0434\u043b\u044f esc_left_handler, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443.<\/p>\n<\/li>\n<li>\n<p><strong>esc_home_handler<\/strong> \u0438 <strong>esc_end_handler: <\/strong>\u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0442\u0435 \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0432\u043b\u0435\u0432\u043e\\\u0432\u043f\u0440\u0430\u0432\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u043d\u0430 \u043e\u0434\u043d\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u2014 \u0446\u0438\u043a\u043b \u0441 \u043f\u043e\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0443\u0436\u043d\u043e\u0439 \u0423\u041f (&#171;\\x1B[D&#187; \u0432\u043b\u0435\u0432\u043e, &#171;\\x1B[C&#187; \u0432\u043f\u0440\u0430\u0432\u043e).<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0442\u044c Enter. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u2014 \u0423\u0421 backspace \u0438 \u0423\u0421 delete \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442, \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0441\u0442\u0438\u0440\u0430\u0442\u044c.<\/p>\n<pre><code class=\"cpp\">static void esc_backspace_handler(const char* cmd) {     if (cursor_pos > 0) {         memmove(&amp;current_cmd.cmd[cursor_pos - 1], &amp;current_cmd.cmd[cursor_pos], current_cmd.length - cursor_pos); \/\/ Remove symbol from buffer         current_cmd.cmd[current_cmd.length - 1] = 0; \/\/ Clear last symbol         --current_cmd.length;         --cursor_pos;          send_data(\"\\x7F\", 1); \/\/ Remove symbol         save_cursor_pos();         send_data(&amp;current_cmd.cmd[cursor_pos], current_cmd.length - cursor_pos); \/\/ Replace old symbols         send_data(\" \", 1);    \/\/ Hide last symbol         load_cursor_pos();     } } static void esc_del_handler(const char* cmd) {     if (cursor_pos &lt; current_cmd.length) {         memmove(&amp;current_cmd.cmd[cursor_pos], &amp;current_cmd.cmd[cursor_pos + 1], current_cmd.length - cursor_pos); \/\/ Remove symbol from buffer         current_cmd.cmd[current_cmd.length - 1] = 0; \/\/ Clear last symbol         --current_cmd.length;          save_cursor_pos();         send_data(&amp;current_cmd.cmd[cursor_pos], current_cmd.length - cursor_pos);         send_data(\" \", 1); \/\/ Hide last symbol         load_cursor_pos();     } }<\/code><\/pre>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u0434\u0443\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043e\u0442 \u0442\u0443\u0434\u0430 \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u043e\u0434 \u043a\u0443\u0440\u0441\u043e\u0440\u043e\u043c \u0438 \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c \u0432\u0441\u0451 \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u0432\u043b\u0435\u0432\u043e. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0438\u0430\u043b\u043e\u0433 \u0442\u0438\u043f\u0430 &#171;\u0423\u0434\u0430\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0432\u043b\u0435\u0432\u043e, \u0441\u043e\u0445\u0440\u0430\u043d\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a\u0443\u0440\u0441\u043e\u0440\u0430, \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e, \u0437\u0430\u043c\u0435\u043d\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430&#187;. <\/p>\n<p>\u0421 delete \u0432\u0441\u0435 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b \u0441\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430.<\/p>\n<h3>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0438 \u0430\u0432\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438 \u0432\u0432\u0435\u0440\u0445 \u0438 \u0432\u043d\u0438\u0437. \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0441\u0430\u043c\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 + \u0434\u043b\u0438\u043d\u0430 + \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a). \u0422\u0443\u0442 \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043e\u0434\u043d\u0443 \u0437\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0435\u0435.<\/p>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e \u0443\u0447\u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u0438\u043d\u043d\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0451 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043e\u043d\u0435\u0446 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438, \u0438 \u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0445\u0432\u043e\u0441\u0442\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"cpp\">static void esc_up_handler(const char* cmd) {     if (history_pos - 1 &lt; 0) {         return;     }     --history_pos;      \/\/ Calculate diff between current command and command from history     int16_t remainder = current_cmd.len - history[history_pos]->len;      \/\/ Move cursor to begin of command     while (cursor_pos) {       send_data(\"\\x1B[D\", 3);       --cursor_pos;     }      \/\/ Print new command     memcpy(&amp;current_cmd, history[history_pos], sizeof(current_cmd));     send_data(current_cmd.cmd, current_cmd.len);     cursor_pos += current_cmd.len;      \/\/ Clear others symbols     save_cursor_pos();     for (int16_t i = 0; i &lt; remainder; ++i) {         send_data(\" \", 1);     }     load_cursor_pos(); }  static void esc_down_handler(const char* cmd) {     if (history_pos + 1 > history_len) {         return;     }     ++history_pos;      int16_t remainder = 0;     if (history_pos &lt; history_len) {         \/\/ Calculate diff between current command and command from history        remainder = current_cmd.len - history[history_pos]->len;         \/\/ Move cursor to begin of command        while (cursor_pos) {            send_data(\"\\x1B[D\", 3);            --cursor_pos;        }         \/\/ Print new command        memcpy(&amp;current_cmd, history[history_pos], sizeof(current_cmd));        send_data(current_cmd.cmd, current_cmd.len);        cursor_pos += current_cmd.len;     }      else {        remainder = current_cmd.len;         \/\/ Move cursor to begin of command        while (cursor_pos) {            send_data(\"\\x1B[D\", 3);            --cursor_pos;        }         memset(&amp;current_cmd, 0, sizeof(current_cmd));     }      \/\/ Clear others symbols     save_cursor_pos();     for (int16_t i = 0; i &lt; remainder; ++i) {         send_data(\" \", 1);     }     load_cursor_pos(); }<\/code><\/pre>\n<p>\u0412\u043e\u0442, \u043a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0443\u0440\u0441\u043e\u0440 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<pre><code class=\"cpp\">while (cursor_pos) {     send_data(\"\\x1B[D\", 3);     --cursor_pos; }<\/code><\/pre>\n<p>\u0410\u0432\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435. \u042f \u043d\u0435 \u0441\u0442\u0430\u043b \u0437\u0430\u043f\u0430\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0443\u043c\u043d\u044b\u043c \u0430\u0432\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u043e \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u043c\u0443 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e. \u0422.\u0435. \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (<em>command1<\/em>, <em>command2<\/em>), \u0442\u043e \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 <em>&#171;comm&#187;<\/em> \u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 TAB \u0430\u0432\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <em>command1<\/em> \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0432 \u0441\u0432\u043e\u0435\u043c \u0440\u043e\u0434\u0435, \u0442\u043e \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 <em>&#171;co&#187;<\/em> \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u043f\u0438\u0448\u0435\u0442\u0441\u044f.<\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/927\/ad5\/b60\/927ad5b60ca2c271a947ef3d9681fb9c.gif\" width=\"690\" height=\"388\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/927\/ad5\/b60\/927ad5b60ca2c271a947ef3d9681fb9c.gif\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043e\u043d \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/572630\/\"> https:\/\/habr.com\/ru\/articles\/572630\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0433\u0435\u043a\u0441\u0430\u043f\u043e\u0434\u043e\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043d\u0438\u043c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0442\u0435\u0441\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Linux \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0434\u043b\u044f \u0433\u0435\u043a\u0441\u0430\u043f\u043e\u0434\u0430? \u042f \u0431\u044b\u043b \u0443\u0434\u0438\u0432\u043b\u0435\u043d, \u0447\u0442\u043e \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 &#171;STM32 terminal&#187; \u043d\u0435 \u0431\u044b\u043b\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041d\u0443 \u0440\u0430\u0437 \u043d\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0445, \u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0440\u0430\u0434\u043e\u0441\u0442\u0435\u0439, \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u2192 <a href=\"https:\/\/github.com\/NeoProg2013\/terminal-server\" rel=\"noopener noreferrer nofollow\">Github<\/a><\/p>\n<h2>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u0438\u044f<\/h2>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b, \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u2014 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c (KiTTY, PuTTY \u0438 \u043f\u0440\u043e\u0447\u0438\u0435). \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (PC). \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0432\u0438\u0434\u0435 KiTTY.<\/p>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u044f \u0438 \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<h2>\u0410\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c STM32F030. \u041e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 MCU \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0440\u0435\u0437 USB-USART \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c CH340E.<\/p>\n<figure class=\"\"><figcaption>CH340E<\/figcaption><\/figure>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430? \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0442.\u0435. \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0430\u043d\u0430\u043b\u043e\u0433 TCP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0432 \u0436\u0435\u043b\u0435\u0437\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0438 \u044d\u0442\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u2014 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c DTR. \u041f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u044d\u0442\u043e\u0442 \u0432\u044b\u0432\u043e\u0434 \u0438 \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u043e\u0433\u0443 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<ul>\n<li>\n<p>DTR=Low \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043a\u0440\u044b\u043b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b;<\/p>\n<\/li>\n<li>\n<p>DTR=High \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043a\u0440\u044b\u043b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b;<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 &#171;\u0437\u0430\u0431\u044b\u0442\u044c&#187; \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e \u0438 \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0431\u0443\u0444\u0435\u0440\u044b. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043d\u0435\u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e \u043a\u0430\u043d\u043e\u043d\u0443 \ud83d\ude42<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e 4 \u043f\u0440\u043e\u0432\u043e\u0434\u0430: RX, TX, DTR, GND. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u2014 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432. \u041d\u0430 \u044d\u0442\u043e\u043c \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c.<\/p>\n<h2>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u0423\u041f) \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b (\u0423\u0421)<\/h2>\n<p>\u0427\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b? \u0412\u0441\u044f \u0432\u043e\u0442 \u044d\u0442\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u0440\u0430\u0437\u043d\u043e\u0446\u0432\u0435\u0442\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043a\u0430 \u044d\u0442\u043e &#171;\u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440&#187;, \u043d\u0435\u0432\u0430\u0436\u043d\u043e SSH \u0442\u0430\u043c \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u041d\u0443\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043e \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445 \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0423\u041f \u0438 \u0423\u0421.<\/p>\n<h4>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 (\u0423\u041f)<\/h4>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0423\u041f \u043a\u0430\u043a \u043d\u0435\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u0443\u0440\u0441\u043e\u0440 \u0432\u043b\u0435\u0432\u043e (\u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440), \u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u043a-\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0431 \u044d\u0442\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0423\u041f.<\/p>\n<p>\u0423\u041f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 ESC (0\u04451\u0412), \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0434\u0443\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0439\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0432\u043b\u0435\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434: [0x1B 0x5B 0x44]. <\/p>\n<h4>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b (\u0423\u0421)<\/h4>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0423\u041f \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c 1 \u0431\u0430\u0439\u0442. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \\r (0x0D) \u0438 \\n (0x0A). \u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 ANSII \u0442\u0430\u0431\u043b\u0438\u0446\u044b [0x00 &#8212; 0x31, 0x7F] \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0441 \u043d\u0438\u043c\u0438 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0442\u043e \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0435 Ctrl+C. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044d\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b 0x03 (End of text). \u0414\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0435\u0441\u0441\u0438\u0438 Ctrl+D, \u044d\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 0x04 (End of transmission) \u0438 \u0442.\u0434.<\/p>\n<h3>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0423\u041f \u0438 \u0423\u0421, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0447\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435. <a href=\"https:\/\/en.wikipedia.org\/wiki\/ANSI_escape_code\" rel=\"noopener noreferrer nofollow\">\u0411\u043e\u043b\u0435\u0435 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u0438\u0445 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0443\u0442<\/a><\/p>\n<ul>\n<li>\n<p>&#171;\\x0D&#187; \u2014 Carriage Return (CR, \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043a\u0430\u0440\u0435\u0442\u043a\u0438), \u043e\u043d \u0436\u0435 \\r;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x0A&#187; \u2014 Line Feed  (LF, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043a\u0430\u0440\u0435\u0442\u043a\u0438), \u043e\u043d \u0436\u0435 \\n;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x0D&#187; \u2014 TAB button (\u043d\u0443 \u043a\u0443\u0434\u0430 \u0436\u0435 \u0431\u0435\u0437 \u0430\u0432\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434);<\/p>\n<\/li>\n<li>\n<p>&#171;\\x7F&#187; \u0438 &#171;\\x08&#187; \u2014 BACKSPACE button;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[3~&#187; \u2014 DEL button;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[A&#187; \u0438 &#171;\\x1B[B&#187; \u2014 arrow up \\ down;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[D&#187; \u0438 &#171;\\x1B[C&#187; \u2014 arrow left \\ right;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[4~&#187; \u2014 END button;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[1~&#187; \u2014 HOME button;<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0423\u041f \u0438 \u0423\u0421 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u0434\u0432\u0435 \u0445\u0438\u0442\u0440\u044b\u0445 \u0423\u041f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0431\u0443\u0434\u0443 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443. \u041f\u0440\u0438 \u043f\u043e\u0441\u044b\u043b\u043a\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0430 \u0435\u0433\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b, \u043d\u043e \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u0443\u0440\u0441\u043e\u0440. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0423\u041f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0435\u0436\u0435\u043d\u0438\u0435 \u0437\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0438 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e USART. <\/p>\n<ul>\n<li>\n<p>&#171;\\x1B[s&#187; \u2014 \u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>&#171;\\x1B[u&#187; \u2014 \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430;<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u043a\u0438\u043d\u0435\u043c \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">static inline void save_cursor_pos() { send_data(\"\\x1B[s\", 3); } static inline void load_cursor_pos() { send_data(\"\\x1B[u\", 3); }<\/code><\/pre>\n<p><em>\u0412\u0430\u0436\u043d\u043e: \u043d\u0435 \u0432\u0441\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u044d\u0442\u043e \u0432\u0432\u0438\u0434\u0443.<\/em><\/p>\n<h2>\u041d\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u0434 \u043f\u043e\u043f\u0438\u0448\u0435\u043c<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u2014 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 USART. \u0412\u0436\u0443\u0445 \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0433\u043e\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">int main() {     system_init(); \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, FLASH latency \u0438 \u0442.\u043f.         \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f USART1     RCC->APB2ENR |= RCC_APB2ENR_USART1EN;     while ((RCC->APB2ENR &amp; RCC_APB2ENR_USART1EN) == 0);          \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 TX \u0432\u044b\u0432\u043e\u0434\u0430     gpio_set_mode        (GPIOA, USART_TX_PIN, GPIO_MODE_AF); \/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0438\u043d\u043e\u043c \u043f\u0435\u0440\u0435\u0444\u0435\u0440\u0438\u0438      gpio_set_output_speed(GPIOA, USART_TX_PIN, GPIO_SPEED_HIGH); \/\/ \u041d\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0438\u043d\u0430     gpio_set_pull        (GPIOA, USART_TX_PIN, GPIO_PULL_NO); \/\/ \u0411\u0435\u0437 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u043e\u0440\u043e\u0432 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f     gpio_set_af          (GPIOA, USART_TX_PIN, 1); \/\/ \u041a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u0438\u043d, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 USART1          \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 RX \u0432\u044b\u0432\u043e\u0434\u0430     gpio_set_mode        (GPIOA, USART_RX_PIN, GPIO_MODE_AF);     gpio_set_output_speed(GPIOA, USART_RX_PIN, GPIO_SPEED_HIGH);     gpio_set_pull        (GPIOA, USART_RX_PIN, GPIO_PULL_UP);     gpio_set_af          (GPIOA, USART_RX_PIN, 1);      \/\/ \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f USART: 8N1, 115200     RCC->APB2RSTR |= RCC_APB2RSTR_USART1RST;     RCC->APB2RSTR &amp;= ~RCC_APB2RSTR_USART1RST;     USART1->BRR = SYSTEM_CLOCK_FREQUENCY \/ 115200;      \/\/ \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c USART1     USART1->CR1 |= USART_CR1_UE;     USART1->CR1 |= USART_CR1_TE | USART_CR1_RE;          while (true) {         if (USART1->ISR &amp; USART_ISR_RXNE) {             uint8_t data = USART1->RDR;         }     } }  void send_data(const char* data, uint8_t size) {     while (size) {         while ((USART1->ISR &amp; USART_ISR_TXE) != USART_ISR_TXE);         USART1->TDR = *data;         ++data;         --size;     } }<\/code><\/pre>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431\u0449\u0443\u044e \u0438\u0434\u0435\u044e. \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 (polling) \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0438 DMA. \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u044d\u0442\u043e \u0432 \u0443\u0433\u043e\u0434\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043a\u0430 \u0432 \u043d\u0438\u043a\u0443\u0434\u0430, \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0435\u0451 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0442 \u043c\u043e\u0433 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0442\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 (\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0438 \u0432\u0441\u0435 \u0442\u0430\u043a\u043e\u0435).<\/p>\n<h2>\u041f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438<\/h2>\n<p>&#171;\u041d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438&#187; \u0437\u0432\u0443\u0447\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e. \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0435\u0451 \u0441\u043a\u0430\u043d-\u043a\u043e\u0434, \u0430 \u0442\u043e\u0442 \u0443\u0436\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u0447\u0442\u043e \u0441 \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u0441\u043a\u0430\u043d-\u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0423\u041f.<\/p>\n<p><em>\u0423\u041f \u0438 <\/em>\u0423\u0421<em> \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u043e \u0441\u0443\u0442\u0438 \u0442\u043e \u043e\u043d\u0438 \u043d\u0438 \u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/em><\/p>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0432\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0423\u041f \u0438 \u0423\u0421 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440. \u0415\u0449\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0418 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cpp\">typedef struct {     char cmd[MAX_COMMAND_LENGTH];     uint16_t length; } cmd_info_t;   static term_srv_cmd_t esc_seq_list[ESCAPE_SEQUENCES_COUNT] = {     { .cmd = \"\\x0D\",    .len = 1, .handler = esc_return_handler,    },     { .cmd = \"\\x0A\",    .len = 1, .handler = esc_return_handler,    },     { .cmd = \"\\x7F\",    .len = 1, .handler = esc_backspace_handler, },     { .cmd = \"\\x08\",    .len = 1, .handler = esc_backspace_handler, },     { .cmd = \"\\x1B[3~\", .len = 4, .handler = esc_del_handler,       },     { .cmd = \"\\x1B[A\",  .len = 3, .handler = esc_up_handler,        },     { .cmd = \"\\x1B[B\",  .len = 3, .handler = esc_down_handler,      },     { .cmd = \"\\x1B[D\",  .len = 3, .handler = esc_left_handler,      },     { .cmd = \"\\x1B[C\",  .len = 3, .handler = esc_right_handler,     },     { .cmd = \"\\x1B[4~\", .len = 4, .handler = esc_end_handler,       },     { .cmd = \"\\x1B[1~\", .len = 4, .handler = esc_home_handler,      } };  static void(*send_data)(const char* data, uint16_t) = NULL; \/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 static term_srv_cmd_t* ext_cmd_list = NULL; \/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 static uint8_t ext_cmd_count = 0; \/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434  static uint16_t cursor_pos = 0; \/\/ \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 static cmd_info_t current_cmd = {0}; \/\/ \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0432\u043e\u0434\u0438\u043c\u043e\u0439 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 static char esc_seq_buffer[10] = {0}; \/\/ \u0411\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 static uint16_t esc_seq_length = 0; \/\/ \u0414\u043b\u0438\u043d\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442  static cmd_info_t history_elements[MAX_COMMAND_HISTORY_LENGTH] = {0}; \/\/ \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u0442\u043e\u0440\u0438\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 static cmd_info_t* history[MAX_COMMAND_HISTORY_LENGTH] = {0}; \/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u0412\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 static int16_t history_len = 0; \/\/ \u0414\u043b\u0438\u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u043d\u0435\u0439) static int16_t history_pos = -1; \/\/ \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/code><\/pre>\n<p><strong>esc_seq_list <\/strong>\u044d\u0442\u043e \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0423\u041f \u0438 \u0423\u0421, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0431\u0443\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0435\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430, \u0435\u0451 \u0434\u043b\u0438\u043d\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0438 \u0442.\u043f.)<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c (\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b):<\/p>\n<pre><code class=\"cpp\">#ifndef _TERM_SRV_H_ #define _TERM_SRV_H_ #include &lt;stdint.h>  \/\/ Settings #define MAX_COMMAND_HISTORY_LENGTH          (3)     \/\/ Command count in history #define MAX_COMMAND_LENGTH                  (64)    \/\/ Command length in bytes #define GREETING_STRING                     (\"\\x1B[36mroot@hexapod-AIWM: \\x1B[0m\") #define UNKNOWN_COMMAND_STRING              (\"\\x1B[31m - command not found\\x1B[0m\")<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-410687","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=410687"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410687\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=410687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=410687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=410687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}