{"id":260713,"date":"2015-07-05T01:43:02","date_gmt":"2015-07-04T21:43:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=260713"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=260713","title":{"rendered":"STM32, C++ \u0438 FreeRTOS. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441 \u043d\u0443\u043b\u044f. \u0427\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"<br \/>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043c\u043e\u0439 \u043e\u0442\u0434\u0435\u043b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e. \u041e\u043f\u044b\u0442\u043d\u044b\u043c \u0438 \u0443\u043c\u043d\u044b\u043c \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0430\u0440\u043f\u043b\u0430\u0442\u044b, \u0430 \u043c\u043e\u043b\u043e\u0434\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0432 \u043d\u0430\u0448\u0435\u043c \u0433\u043e\u0440\u043e\u0434\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434 \u043f\u0430\u0442\u0440\u043e\u043d\u0430\u0436\u0435\u043c \u043d\u0430\u0448\u0435\u0439 \u0434\u043e\u0431\u043b\u0435\u0441\u0442\u043d\u043e\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441\u043e \u0448\u0442\u0430\u0431 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u043e\u0439 \u0433\u0434\u0435-\u0442\u043e \u0432 \u0421\u0435\u043d\u0442 \u041b\u0443\u0438\u0441\u0435, \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0430\u0442\u0443\u0440\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c, \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u0445 \u0434\u0432\u0430 \u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e, \u0430 \u0443\u0436\u0435 \u0442\u0430\u043c \u0441\u0430\u043c\u0438\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0445 \u201c\u0442\u043e\u043b\u043a\u043e\u0432\u044b\u0445\u201d \u0435\u0441\u043b\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0432\u0434\u0440\u0443\u0433 \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438. \u042d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0435\u043d\u0442\u043e\u0432. <br \/>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u044e \u043e\u0442 \u0442\u0435\u043c\u044b, \u0441\u0430\u043c \u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0432\u043d\u043e, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 \u0421#, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 (PIC16 \u043d\u0430 \u0437\u044b\u043a\u0435 \u0421\u0438) \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0432 \u0434\u0430\u043b\u0435\u043a\u043e\u043c 2007 \u0433\u043e\u0434\u0443.<br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u0438\u043a\u0440\u043e\u043d\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438, \u044f\u0437\u044b\u043a\u043e\u043c \u0421++ \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<br \/>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u041e\u0421\u0420\u0412 \u0438 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043d\u0430 \u0421++, \u043d\u043e \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u044f \u0432 \u043d\u0438\u0445 \u043d\u0435 \u0443\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e, \u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c <s>\u0442\u0443\u043d\u0435\u044f\u0434\u0441\u0442\u0432\u043e\u043c<\/s> \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u041f\u041e. <\/p>\n<h4>\u0412\u044b\u0431\u043e\u0440<\/h4>\n<p>  \u0412\u0440\u0435\u043c\u0435\u043d\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u0434\u0430\u043d\u043e 1 \u043c\u0435\u0441\u044f\u0446. \u0421 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u044e\u043d\u044f 2015 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u044e\u043b\u044f 2015, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0432 \u043e\u0442\u043f\u0443\u0441\u043a, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043b\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0447\u0435\u0442\u043a\u043e.<br \/>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438, \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u043c\u043e\u0434\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 ARM Cortex \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u044f\u0434\u0440\u0430 \u0438 \u0438\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u043f\u043b\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0430\u0437\u0430\u0442\u044c Olimex STM32P152 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u043b\u0438 25 \u0434\u043e\u043b\u043b\u0430\u0440\u043e\u0432. \u041e\u043d\u0438 \u043f\u0440\u0438\u0448\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u2014 6 \u043f\u043b\u0430\u0442 \u043f\u043e \u0446\u0435\u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 2000 \u0440\u0443\u0431\u043b\u0435\u0439. \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u0438 \u043f\u043b\u0430\u0442\u044b \u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u0443\u043f\u043b\u0435\u043d\u044b \u043d\u0430\u043c\u0438 \u0434\u043b\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430, \u0433\u0434\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0443\u0440\u0441.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/32f\/807\/a31\/32f807a31f76405380da7e50d996a805.png\" alt=\"image\"\/><\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0426\u0435\u043b\u044c<\/h4>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0447\u0442\u043e \u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430\u043c. \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 STM32, \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0421++ \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 FreeRTOS, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0418\u0442\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0435\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Olimex STM32P152, \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0442\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443), \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++ \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 FreeRTOS.<br \/>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043d\u0435\u043d\u0430\u0432\u044f\u0437\u0447\u0438\u0432\u044b\u043c, \u0431\u0435\u0437 \u0437\u0430\u0443\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u0445 \u044f\u0437\u044b\u043a\u0443 \u0421++. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 UML. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<p>  \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 (\u0438\u043c\u0435\u0442\u044c \u0442\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445): <u>\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/u>, <u>\u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 VDDA<\/u>, <u>\u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0430<\/u><br \/>  SR1: \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 <b>\u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440<\/b>.<br \/>  SR2: \u0415\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f <u>\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/u> \u2014 \u0433\u0440\u0430\u0434\u0443\u0441\u044b \u0426\u0435\u043b\u044c\u0441\u0438\u044f, \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u2014 \u0432\u043e\u043b\u044c\u0442\u044b.<br \/>  SR3: \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 <b>\u043a\u043d\u043e\u043f\u043a\u0443 1<\/b>, \u043d\u0430 <b>\u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0435<\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u043a\u0440\u0430\u043d \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, <br \/>  SR4: \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 <b>\u043a\u043d\u043e\u043f\u043a\u0443 1<\/b> <b> \u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 1<\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<br \/>  SR5: \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 <b>\u043a\u043d\u043e\u043f\u043a\u0443 2<\/b>, \u043d\u0430 <b>\u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0435<\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 (\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u043a\u0440\u0430\u043d\u044b \u0440\u0430\u0437 \u0432 1.5 \u0441\u0435\u043a\u0443\u043d\u0434\u044b) \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435, <br \/>  SR6: \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 <b>\u043a\u043d\u043e\u043f\u043a\u0443 2<\/b> <b>\u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 2 <\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<br \/>  SR7: <b>\u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 3<\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u043e\u0440\u0433\u0430\u0442\u044c \u0440\u0430\u0437 \u0432 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.<\/p>\n<p>  \u0412\u043a\u0440\u0430\u0442\u0446\u0435 \u2014 \u044d\u0442\u043e \u0432\u0441\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<br \/>  \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u0430\u044f, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b <\/h4>\n<p>  \u0418 \u0442\u0430\u043a \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 IAR \u0434\u043b\u044f C++, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0442\u0443\u0442 \u043d\u0435\u0442. \u0412\u043e\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 <a href=\"http:\/\/chipspace.ru\/cplusplus\/\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 C++ \u0432 IAR \u0434\u043b\u044f STM32<\/a>. \u0417\u0434\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. <\/p>\n<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f FreeRTOS <\/h4>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f \u0441\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0421++, \u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0421\u0438, \u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0421++ \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f FreeRTOS. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b\u0430 \u043f\u043e\u0434 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u041e\u0421\u0420\u0412, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0442\u0438\u043f\u0430 \u041e\u0421\u0420\u0412, \u043d\u043e \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u0438 \u043e\u0431\u0435\u0440\u043d\u0443\u043b, \u0442\u0443\u043f\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0432 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. <br \/>  \u0422\u0430\u043a\u0436\u0435 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 static void run(void *parameters); \u042d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438. <br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435, \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 iActiveObject \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 virtual void run(void) = 0; \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">iActiveObject.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;types.h&quot;          \/\/\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 class iActiveObject {   public:                   virtual void run(void) = 0;     void *taskHandle; }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0447\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0435\u0439 (\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c) \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 run(). \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e run() \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<br \/>  \u041d\u0430 \u0431\u0443\u043c\u0430\u0433\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u044d\u0442\u043e \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2f6\/114\/e32\/2f6114e322ce498f8960968286ff0f64.png\" alt=\"image\"\/><br \/>  \u0417\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u044f \u043f\u043e\u0440\u0443\u0447\u0438\u043b \u043e\u0434\u0430\u0440\u0435\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u043b\u043e\u0434\u043e\u043c\u0443 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0441 \u043d\u0435\u0439 \u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439 \u0432\u044b\u0434\u0430\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 IAR 6.50<br \/>  <a href=\"https:\/\/yadi.sk\/d\/ku1eZwzDhfaBk\">\u041f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 FreeRTOS \u0432 IAR 6.50<\/a><\/p>\n<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u041e\u0431\u0449\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h4>\n<p>  \u041f\u043e\u043a\u0430 \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0434\u0435\u043b\u0430\u043b \u043e\u0431\u0435\u0440\u0442\u043a\u0443, \u044f \u043f\u0440\u0438\u043a\u0438\u0434\u044b\u0432\u0430\u043b \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u041f\u041e. \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b 3 \u043f\u0430\u043a\u0435\u0442\u0430:<br \/>  AHardware \u2014 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0443\u0440\u043e\u0439 (\u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b, \u0418\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440, \u0410\u0426\u041f \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435)<br \/>  Application \u2014 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438 \u043f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u043e \u0436\u0435\u043b\u0435\u0437\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0440\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u0443 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u043d\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c \u0441\u043d\u0435\u0436\u0438\u043d\u043a\u043e\u0439. \u0410 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a:)<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7d6\/53a\/05e\/7d653a05e4b446b7891ed0263748c094.png\" alt=\"image\"\/><br \/>  FreeRTOS \u2014 \u043f\u0430\u043a\u0435\u0442 \u0441 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043a\u043e\u0439 \u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 \u0434\u043b\u044f \u043d\u0435\u0451.<br \/>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0438\u0441\u043e\u0432\u0430\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/37b\/99a\/ac1\/37b99aac1dcf44c6b665c4432696fc8b.png\" alt=\"image\"\/><\/p>\n<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u041c\u043e\u0440\u0433\u0430\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c<\/h4>\n<p>  \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \ud83d\ude42 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f SR7: <b>\u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 3<\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u043e\u0440\u0433\u0430\u0442\u044c \u0440\u0430\u0437 \u0432 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043c\u043d\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043e\u0441\u0432\u043e\u0438\u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u043c\u043e\u0433\u0443 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0432\u043f\u0435\u0440\u0435\u0434.<br \/>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b. \u0418 \u043d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0430 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0435 8 \u043b\u0435\u0442 \u0441 \u043c\u043e\u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043c\u043d\u043e\u0433\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0438 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0438\u0437\u0438. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u0442\u0430\u0449\u0438\u0442 \u043f\u043e \u044d\u0442\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 \u0440\u0430\u0437\u044b \u0431\u043e\u043b\u044c\u0448\u0435 (\u0447\u0435\u043c \u0432 PIC 16).<br \/>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0440\u0442\u043e\u0432 \u0431\u044b\u043b\u0430 \u0432\u044b\u043a\u0438\u043d\u0443\u0442\u0430 \u0432 __low_level_init(). \u0418 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0436\u0435\u043b\u0435\u0437\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0445\u043e\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u044f \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b \u0432 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 main(), \u0434\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u0434\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">   \/\/\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0440\u0442\u043e\u0432 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430    \/\/PE.10, PE.11 - \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b stat3 \u0438 stat4    \/\/PA.4, PA.5 - \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b stat1 \u0438 stat 2    \/\/\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0440\u0442\u044b PE.10, PE.11, PA.4, PA.5 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434, c\u0442\u0440.174 CD00240194.pdf    GPIOE-&gt;MODER |=  GPIO_MODER_MODER10_0;    GPIOE-&gt;MODER |=  GPIO_MODER_MODER11_0;    GPIOA-&gt;MODER |=  GPIO_MODER_MODER4_0;    GPIOA-&gt;MODER |=  GPIO_MODER_MODER5_0; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435 \u0436\u0435\u043b\u0435\u0437\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0438 \u044f \u043e\u043f\u044f\u0442\u044c \u0441\u0435\u043b \u0437\u0430 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u2014 \u043a\u043b\u0430\u0441\u0441\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u0434\u0430\u043c\u0438. \u0427\u0435\u0440\u0435\u0437 \u043f\u043e\u043b \u0447\u0430\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u044d\u0442\u043e:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/41a\/acf\/44c\/41aacf44ccfc4d21b4f9cc76fc3b15ef.png\" alt=\"image\"\/><br \/>  \u0418 \u0442\u0443\u0442 \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u0433\u043e \u0447\u0443\u0434\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">LedsDriver.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;types.h&quot;            \/\/\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 tU8 #define LEDS_NUMBER    4 class cLedsDriver {   public:     explicit cLedsDriver(void);     void ledOn(const tU8 led);     void ledOff(const tU8 led);     void ledToggle(const tU8 led);   private:     static tPort ledsPort[LEDS_NUMBER];     static const tU16 ledsPin[LEDS_NUMBER]; }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ledsdriver.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;ledsdriver.h&quot;       \/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0442\u0438\u043f tLeds #include &lt;stm32l1xx.h&gt;        \/\/\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b STM32 #include &quot;susuassert.h&quot;       \/\/ for ASSERT #include &quot;types.h&quot;            \/\/ \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 tPort, tU16, tU8 #include &quot;bitutil.h&quot;          \/\/ \u0434\u043b\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0442\u0430\u043c\u0438  #define LED1_PIN        GPIO_OTYPER_ODR_4 #define LED1_PORT\tGPIOA #define LED2_PIN        GPIO_OTYPER_ODR_5 #define LED2_PORT       GPIOA #define LED3_PIN        GPIO_OTYPER_ODR_10 #define LED3_PORT       GPIOE #define LED4_PIN        GPIO_OTYPER_ODR_11 #define LED4_PORT       GPIOE tPort cLedsDriver::ledsPort[LEDS_NUMBER] = {LED1_PORT, LED2_PORT, LED3_PORT, LED4_PORT}; const tU16 cLedsDriver::ledsPin[LEDS_NUMBER] = {LED1_PIN, LED2_PIN, LED3_PIN, LED4_PIN}; \/******************************************************************************* * Function:  constructor * Description:  ******************************************************************************\/ cLedsDriver::cLedsDriver(void)  { }  \/******************************************************************************* * Function:  ledOn * Description: \u0417\u0430\u0436\u0438\u0433\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u0434 ******************************************************************************\/ void cLedsDriver::ledOn(const tU8 led) {   ASSERT(led &lt; LEDS_NUMBER);    SETBIT(this-&gt;ledsPort[led]-&gt;ODR, this-&gt;ledsPin[led]);    }  \/******************************************************************************* * Function:  ledOff * Description: \u0413\u0430\u0441\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u0434 ******************************************************************************\/ void cLedsDriver::ledOff(const tU8 led) {   ASSERT(led &lt; LEDS_NUMBER);    CLRBIT(this-&gt;ledsPort[led]-&gt;ODR, this-&gt;ledsPin[led]); } \/******************************************************************************* * Function:  ledToggle * Description: \u041c\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 ******************************************************************************\/ void cLedsDriver::ledToggle(const tU8 led) {   ASSERT(led &lt; LEDS_NUMBER);    TOGGLEBIT(this-&gt;ledsPort[led]-&gt;ODR, this-&gt;ledsPin[led]); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043d\u043e\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432 \u2014 \u043a\u043b\u0430\u0441\u0441\u0430 cLedsDirector. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0442.\u0435. \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f run(), \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0434\u0430\u0447\u0435. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u0432\u0441\u0435 \u043c\u043e\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 iActiveObject. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0438\u0441\u0443\u043d\u043e\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0ef\/6c6\/025\/0ef6c6025c764df0a841f48bb71c38c2.png\" alt=\"image\"\/><br \/>  \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u043f\u043e \u0441\u0438\u043b\u0430\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0435 \u0441\u043d\u0435\u0436\u0438\u043d\u043a\u0435, \u0432\u0440\u043e\u0434\u0435 \u043c\u0435\u043d\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ledsdirector.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;ledsdriver.h&quot;    \/\/\u0434\u043b\u044f cLedsDriver #include &quot;iactiveobject.h&quot;  \/\/\u0434\u043b\u044f iActiveObject typedef enum  {   LD_led1 = 0,   LD_led2 = 1,   LD_led3 = 2,   LD_led4 = 3,   LD_none = 4 } tLeds; class cLedsDirector: public iActiveObject {   public:     explicit cLedsDirector(void);     void run(void);         private:     cLedsDriver* pLedsDriver; }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ledsdirector.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;ledsdirector.h&quot;      \/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 #include &quot;frtoswrapper.h&quot;   \/\/ \u0434\u043b\u044f oRTOS #include &quot;types.h&quot;             \/\/ l\u043b\u044f \u0442\u0438\u043f\u043e\u0432  #define LED_DELAY (tU32)500\/portTICK_PERIOD_MS \/******************************************************************************* * Function:  constructor * Description: \u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 cLedsDriver ******************************************************************************\/ cLedsDirector::cLedsDirector(void)   {   this-&gt;pLedsDriver =  new cLedsDriver();    } \/******************************************************************************* * Function:  runTask * Description: \u0417\u0430\u0434\u0430\u0447\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0435\u0434\u0430\u043c\u0438. led3 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0440\u0433\u0430\u0435\u0442 ******************************************************************************\/ void cLedsDirector::run(void) {   for(;;)   {     oRTOS.taskDelay(LED_DELAY);     this-&gt;pLedsDriver-&gt;ledToggle(LD_led3);       } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435 \u0432\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u0430\u044f \u043c\u0430\u043b\u043e\u0441\u0442\u044c \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 cLedsDirector \u0438 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 main() \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0444\u0443\u043d\u043a\u0446\u0438\u044f main()<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#define LEDSDIRECTOR_STACK_SIZE configMINIMAL_STACK_SIZE #define LEDSDIRECTOR_PRIORITY (tU32)2 \/\/ \u041d\u0435 \u043e\u0445\u043e\u0442\u0430 \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u043e\u043c, \u0441\u0434\u0435\u043b\u0430\u043b oRTOS \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \/\/ \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441RTOS \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c, \u043d\u043e \u0447\u0435-\u0442\u043e \u0442\u043e\u0436\u0435 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a \u043c\u043d\u043e\u0433\u043e \/\/ \u0437\u0430\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u0441\u0435\u043c \u043d\u0443\u0436\u0435\u043d  cRTOS oRTOS; .... void main(void) {     cLedsDirector *pLedsDirector = new cLedsDirector();   oRTOS.taskCreate(pLedsDirector, LEDSDIRECTOR_STACK_SIZE, LEDSDIRECTOR_PRIORITY, &quot;Leds&quot;);    oRTOS.startScheduler(); }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u043f\u043b\u0430\u0442\u0435, \u0438 \u043e \u0447\u0443\u0434\u043e \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430. \u0417\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0415\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f. \u0411\u0443\u0434\u0435\u043c \u0438\u0434\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435. \u0410 \u043f\u043e\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442<br \/>  <a href=\"https:\/\/yadi.sk\/d\/Et1nxVnXhfeJh\">\u041f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0440\u0433\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u0432 IAR 6.50<\/a><\/p>\n<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u041a\u043d\u043e\u043f\u043a\u0438<\/h4>\n<p>  \u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f SR6: \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 <b>\u043a\u043d\u043e\u043f\u043a\u0443 2<\/b> <b>\u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 2 <\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 SR4: \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 <b>\u043a\u043d\u043e\u043f\u043a\u0443 1<\/b> <b>\u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 1 <\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<br \/>  \u041a\u043d\u043e\u043f\u043a\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0434\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0445\u043e\u0442\u044f \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u044f \u0442\u0430\u043a \u0440\u0435\u0448\u0438\u043b.<br \/>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435 \u0440\u0438\u0441\u0443\u0435\u043c \u043a\u043b\u0430\u0441\u0441 cButtonsDriver. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4f2\/997\/91b\/4f299791b139478985e13ba43e85610f.png\" alt=\"image\"\/><br \/>  \u0422\u0443\u0442 \u043d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0432\u0435\u0449\u044c, \u0447\u0442\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u0443 \u043c\u0435\u043d\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u0442\u043e\u0447\u043d\u0435\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430. \u0412\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043e\u0434\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u0430 \u043a \u043d\u0443\u043b\u044e, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u043a \u0435\u0434\u0438\u043d\u0438\u0446\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0443 \u043d\u0438\u0445 \u043f\u043e \u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u044f \u0438 \u0432\u0432\u0435\u043b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 -buttonsTrigger (\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e). \u041e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0436\u0430\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e 0 \u0438\u043b\u0438 \u043f\u043e 1. \u0418 \u0432\u043e\u0442 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0432\u0441\u0435 \u0441\u0442\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0447\u0430\u0441\u044b.<br \/>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">buttonsdriver.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;stm32l1xx.h&gt;        \/\/\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b STM32 #include &quot;types.h&quot;            \/\/\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f tU16 \u0438 tU8 #define BUTTONS_NUMBER    2 typedef enum {   BS_buttonNotPressed = 0,   BS_buttonPressed = 1 } tButtonState; class cButtonsDriver {   public:     explicit  cButtonsDriver();     tButtonState getButtonState(const tU8 button);   private:     static tPort buttonsPort[BUTTONS_NUMBER];     static const tU16 buttonsPin[BUTTONS_NUMBER];     static const tBoolean buttonsTrigger[BUTTONS_NUMBER];  }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">buttonsdriver.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;buttonsdriver.h&quot;    \/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0442\u0438\u043f tLeds #include &lt;stm32l1xx.h&gt;        \/\/\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b STM32 #include &quot;susuassert.h&quot;       \/\/for ASSERT #include &quot;types.h&quot;            \/\/\u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 tPort, tU16, tU8 #define BUTTON1_PIN         GPIO_OTYPER_IDR_13 #define BUTTON1_PORT\t    GPIOC #define BUTTON2_PIN         GPIO_OTYPER_IDR_0 #define BUTTON2_PORT        GPIOA tPort cButtonsDriver::buttonsPort[BUTTONS_NUMBER] = {BUTTON1_PORT, BUTTON2_PORT}; const tU16 cButtonsDriver::buttonsPin[BUTTONS_NUMBER] = {BUTTON1_PIN, BUTTON2_PIN}; \/\/ \u043f\u0435\u0440\u0432\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430\u0436\u0430\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 0, \u0432\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u0433\u0434\u0430 1 const tBoolean cButtonsDriver::buttonsTrigger[BUTTONS_NUMBER]  =  {FALSE, TRUE};  \/******************************************************************************* * Function:  constructor * Description:  ******************************************************************************\/ cButtonsDriver::cButtonsDriver() { } \/******************************************************************************* * Function:  getButtonState * Description: \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438, \u043d\u0430\u0436\u0430\u0442\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442 ******************************************************************************\/ tButtonState cButtonsDriver::getButtonState(const tU8 button) {   tButtonState eState = BS_buttonNotPressed;     ASSERT(button &lt; BUTTONS_NUMBER);    \/\/\u0423 \u043d\u0430\u0441 \u043a\u043d\u043e\u043f\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e \u0440\u0430\u0437\u043d\u043e\u043c\u0443, \u043e\u0434\u043d\u0430 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u0430 \u043a 1, \u0432\u0442\u043e\u0440\u0430\u044f \u043a 0,   \/\/\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0443\u0442 \u0442\u0430\u043d\u0446\u044b \u0441 \u0431\u0443\u0431\u043d\u043e\u043c, \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043f\u043a\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c   \/\/\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0444\u043e\u0432 \u0438 \u043a\u0435\u0439\u0437\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043a\u043d\u043e\u043f\u043a\u0438   \/\/\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0449\u0435\u0433\u043e \u0438\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0435\u0451 \u043d\u0430\u0436\u0430\u0442\u0438.     tBoolean isLogicalZero = !(this-&gt;buttonsPort[button]-&gt;IDR &                               this-&gt;buttonsPin[button]);   if(isLogicalZero ^ this-&gt;buttonsTrigger[button])   {     eState = BS_buttonPressed;   }     return eState;    } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435 \u0441 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c \u043f\u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043f\u0440\u043e \u0437\u0430\u0434\u0430\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438. <br \/>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432, \u043e\u043d\u043e \u0438 \u0432\u0435\u0440\u043d\u043e, \u0447\u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c90\/2d9\/5fb\/c902d95fb01c4536894471f0f433dbc2.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0430\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0434\u043e\u043b\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0442\u044c \u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0427\u0435\u0440\u0435\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043b\u0438\u0431\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0434\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c freeRTOS \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 (Notify).<br \/>  \u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u0432\u0435 \u0432\u0435\u0449\u0438: \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b 1 \u0438 2, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0430 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0435 \u043c\u0435\u043d\u044f\u0442\u0441\u044f \u0440\u0435\u0436\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u044d\u043a\u0440\u0430\u043d\u044b. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043d\u044f\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0435 \u0443\u0437\u043d\u0430\u0435\u0442, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0430. \u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0441\u043a\u0430\u0436\u0435\u043c \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u0442 \u043a\u043d\u043e\u043f\u043e\u043a \u0437\u0430\u0434\u0430\u0447\u0435 \u0418\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430. \u0427\u0442\u043e-\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u043d\u044f \u043d\u0435 \u0443\u0441\u0442\u0440\u043e\u0438\u043b\u043e, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u043a\u0442\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u0422.\u0435 \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u043f\u0440\u043e\u0441\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0443\u0436\u043d\u044b.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438 \u0431\u044b\u043b \u0437\u0430\u0432\u0435\u0434\u0435\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 pTaskToNotify \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0442\u044c.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">buttonscontroller.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;types.h&quot;            \/\/\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 tU32 #include &quot;iactiveobject.h&quot;    \/\/\u0434\u043b\u044f iActiveObject #include &quot;buttonsdriver.h&quot;    \/\/\u0434\u043b\u044f cButtonsDriver #include &quot;frtosWrapper.h&quot;     \/\/ \u0434\u043b\u044f tTaskHandle typedef enum  {   BT_button1 = 0,   BT_button2 = 1,   BT_none = 2 } tButtons; class cButtonsController: public iActiveObject {   public:     explicit  cButtonsController(const tTaskHandle *pTaskToNotify,                                   const tU32 countOfNotifiedTask);     tButtons  getPressedButton(void) const { return pressedButton; };     void run(void);   private:     cButtonsDriver* pButtonsDriver;     tButtons getButton(void);     tButtons pressedButton;     const tTaskHandle *pTaskToNotify;     tU32 countOfNotifiedTask;     }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">buttonscontroller.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;buttonscontroller.h&quot; \/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 #include &lt;stm32l1xx.h&gt;         \/\/\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b STM32 #include &quot;susuassert.h&quot;       \/\/ \u0434\u043b\u044f ASSERT #include &quot;types.h&quot;            \/\/ \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 tPort, tU16, tU8 #include &quot;bitutil.h&quot;          \/\/ \u0434\u043b\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0442\u0430\u043c\u0438   #define BUTTON_TASK_DELAY   (tU32) 50\/portTICK_PERIOD_MS #define NEXT_PRESS_DELAY    (tU32) 500\/portTICK_PERIOD_MS  \/******************************************************************************* * Function:  constructor * Description: \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447 \u0434\u043b\u044f \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0430\u0447 *              \u0434\u043b\u044f \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043a\u043d\u043e\u043f\u043e\u043a. ******************************************************************************\/ cButtonsController::cButtonsController(const tTaskHandle *pTaskToNotify,                                         const tU32 countOfNotifiedTask) {   ASSERT(pTaskToNotify != NULL);     this-&gt;pButtonsDriver =  new cButtonsDriver();   this-&gt;pTaskToNotify = pTaskToNotify;   this-&gt;countOfNotifiedTask = countOfNotifiedTask;   } \/******************************************************************************* * Function:  run * Description: \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u044f\u0435\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u044b\u043c  *              \u043d\u0443\u0436\u043d\u044b\u043c \u0437\u0430\u0434\u0430\u0447\u0430\u043c ******************************************************************************\/ void cButtonsController::run(void) {    tRtosStatus eStatus = RS_fail;    tButtons eButtonPreviousState = BT_none;    tButtons  eButtonCurrentState = BT_none;    const tTaskHandle *pTaskHandle;    tU32 i = 0;    for(;;)    {      eButtonPreviousState = this-&gt;getButton();      if (eButtonPreviousState != BT_none)      {        \/\/\u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043b\u044f \u0430\u043d\u0442\u0438\u0431\u0440\u0435\u0431\u0435\u0437\u0433\u0430        oRTOS.taskDelay(BUTTON_TASK_DELAY);        eButtonCurrentState = this-&gt;getButton();        if (eButtonPreviousState == eButtonCurrentState)        {          pTaskHandle = this-&gt;pTaskToNotify;          i = 0;          \/\/\u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u043c \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u0438 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0435\u043c \u0438\u0445          while ((pTaskHandle != NULL) && (i != countOfNotifiedTask))          {            eStatus = oRTOS.taskNotify(*(pTaskHandle), (tU32)eButtonCurrentState,                                        eSetValueWithOverwrite);            if(eStatus == RS_fail)             {              ;\/\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043a\u0438            }                       pTaskHandle++;            i++;          }          \/\/\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438  \u0432 0.5 \u0441\u0435\u043a          oRTOS.taskDelay(NEXT_PRESS_DELAY);        }      }      oRTOS.taskDelay(BUTTON_TASK_DELAY);    } } \/******************************************************************************* * Function:  getPressedButton * Description: \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u044f\u0435\u0442 \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u043a\u043e\u043d\u043e\u043f\u043e\u043a \u043d\u0430\u0436\u0430\u0442\u0430 ******************************************************************************\/ tButtons cButtonsController::getButton(void) {   tButtons eButton =  BT_none;   if (BS_buttonPressed == this-&gt;pButtonsDriver-&gt;getButtonState(BT_button1))   {     eButton = BT_button1;       }   else if (BS_buttonPressed == this-&gt;pButtonsDriver-&gt;getButtonState(BT_button2))   {     eButton = BT_button2;       }   this-&gt;pressedButton = eButton;   return eButton; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 main \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447 \u0434\u043b\u044f \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043b\u044f \u043e\u043f\u0440\u043e\u0441\u0430 \u043a\u043d\u043e\u043f\u043e\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">main.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;stm32l1xx.h&gt;          \/\/ \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b STM2 #include &quot;ledsdirector.h&quot;       \/\/ \u0414\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 cLedsDirector #include &quot;buttonscontroller.h&quot;  \/\/ \u0414\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 cButtonsController #include &quot;types.h&quot;              \/\/ \u0414\u043b\u044f \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 #include &quot;frtoswrapper.h&quot;       \/\/ \u0434\u043b\u044f cRtos #define LEDS_TASK_HANDLE_INDEX          0 #define BUTTON_TASKS_NOTYFIED_NUM       1 #define LEDSDIRECTOR_STACK_SIZE configMINIMAL_STACK_SIZE #define LEDSDIRECTOR_PRIORITY (tU32)2 #define BUTTONSCONTROLLER_STACK_SIZE 256\/\/configMINIMAL_STACK_SIZE #define BUTTONSCONTROLLER_PRIORITY (tU32)3 \/\/ \u041d\u0435 \u043e\u0445\u043e\u0442\u0430 \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u043e\u043c, \u0441\u0434\u0435\u043b\u0430\u043b oRTOS \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \/\/ \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441RTOS \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c, \u043d\u043e \u0447\u0435-\u0442\u043e \u0442\u043e\u0436\u0435 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a \u043c\u043d\u043e\u0433\u043e \/\/ \u0437\u0430\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u0441\u0435\u043c \u043d\u0443\u0436\u0435\u043d :) cRTOS oRTOS; .. void main( void ) {     \/\/\u0437\u0430\u0434\u0430\u0447\u0430 ButtonControllera \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0438   \/\/\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430    \/\/\u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0442\u044c   static tTaskHandle tasksToNotifyFromButton[BUTTON_TASKS_NOTYFIED_NUM];   cLedsDirector *pLedsDirector = new cLedsDirector();   oRTOS.taskCreate(pLedsDirector, LEDSDIRECTOR_STACK_SIZE, LEDSDIRECTOR_PRIORITY, &quot;Leds&quot;);    tasksToNotifyFromButton[LEDS_TASK_HANDLE_INDEX] = pLedsDirector-&gt;taskHandle;   cButtonsController *pButtonsController =  new cButtonsController(tasksToNotifyFromButton, BUTTON_TASKS_NOTYFIED_NUM);   oRTOS.taskCreate(pButtonsController, BUTTONSCONTROLLER_STACK_SIZE, BUTTONSCONTROLLER_PRIORITY, &quot;Buttons&quot;);      oRTOS.startScheduler(); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u2014 \u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \ud83d\ude42 \u0412\u043e\u0442 \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c.<br \/>  \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442:<br \/>  <a href=\"https:\/\/yadi.sk\/d\/GO8wDJF2hfm3f\">\u041f\u0440\u043e\u0435\u043a\u0442 \u041a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b \u0434\u043b\u044f IAR 6.50<\/a><br \/>  \u0410 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u0434\u044f\u0442\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ad3\/818\/415\/ad3818415a3c4a22bb870004156865a6.png\" alt=\"image\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0437\u0430 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0442\u0440\u0438 \u0434\u043d\u044f \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0442\u0440\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u043d\u0435 \u043f\u043b\u043e\u0445\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u0443 \u043c\u0435\u043d\u044f \u0438\u0445 7. \u0418 \u0440\u0435\u0448\u0438\u0432, \u0447\u0442\u043e \u0437\u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 2.5 \u043d\u0435\u0434\u0435\u043b\u0438 \u044f \u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u044e, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0434\u043d\u044f \u043d\u0430 \u043e\u0437\u0435\u0440\u043e. <br \/>  \u041a\u0430\u043a \u043f\u043e\u0442\u043e\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0437\u0440\u044f \u044f \u0442\u0430\u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u0432\u0435\u0449\u0438, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0443\u0436\u0435 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/261807\/\"> http:\/\/habrahabr.ru\/post\/261807\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043c\u043e\u0439 \u043e\u0442\u0434\u0435\u043b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e. \u041e\u043f\u044b\u0442\u043d\u044b\u043c \u0438 \u0443\u043c\u043d\u044b\u043c \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0430\u0440\u043f\u043b\u0430\u0442\u044b, \u0430 \u043c\u043e\u043b\u043e\u0434\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0432 \u043d\u0430\u0448\u0435\u043c \u0433\u043e\u0440\u043e\u0434\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434 \u043f\u0430\u0442\u0440\u043e\u043d\u0430\u0436\u0435\u043c \u043d\u0430\u0448\u0435\u0439 \u0434\u043e\u0431\u043b\u0435\u0441\u0442\u043d\u043e\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441\u043e \u0448\u0442\u0430\u0431 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u043e\u0439 \u0433\u0434\u0435-\u0442\u043e \u0432 \u0421\u0435\u043d\u0442 \u041b\u0443\u0438\u0441\u0435, \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0430\u0442\u0443\u0440\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c, \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u0445 \u0434\u0432\u0430 \u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e, \u0430 \u0443\u0436\u0435 \u0442\u0430\u043c \u0441\u0430\u043c\u0438\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0445 \u201c\u0442\u043e\u043b\u043a\u043e\u0432\u044b\u0445\u201d \u0435\u0441\u043b\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0432\u0434\u0440\u0443\u0433 \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438. \u042d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0435\u043d\u0442\u043e\u0432. <br \/>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u044e \u043e\u0442 \u0442\u0435\u043c\u044b, \u0441\u0430\u043c \u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0432\u043d\u043e, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 \u0421#, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 (PIC16 \u043d\u0430 \u0437\u044b\u043a\u0435 \u0421\u0438) \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0432 \u0434\u0430\u043b\u0435\u043a\u043e\u043c 2007 \u0433\u043e\u0434\u0443.<br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u0438\u043a\u0440\u043e\u043d\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438, \u044f\u0437\u044b\u043a\u043e\u043c \u0421++ \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<br \/>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u041e\u0421\u0420\u0412 \u0438 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043d\u0430 \u0421++, \u043d\u043e \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u044f \u0432 \u043d\u0438\u0445 \u043d\u0435 \u0443\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e, \u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c <s>\u0442\u0443\u043d\u0435\u044f\u0434\u0441\u0442\u0432\u043e\u043c<\/s> \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u041f\u041e. <\/p>\n<h4>\u0412\u044b\u0431\u043e\u0440<\/h4>\n<p>  \u0412\u0440\u0435\u043c\u0435\u043d\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u0434\u0430\u043d\u043e 1 \u043c\u0435\u0441\u044f\u0446. \u0421 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u044e\u043d\u044f 2015 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u044e\u043b\u044f 2015, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0432 \u043e\u0442\u043f\u0443\u0441\u043a, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043b\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0447\u0435\u0442\u043a\u043e.<br \/>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438, \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u043c\u043e\u0434\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 ARM Cortex \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u044f\u0434\u0440\u0430 \u0438 \u0438\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u043f\u043b\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0430\u0437\u0430\u0442\u044c Olimex STM32P152 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u043b\u0438 25 \u0434\u043e\u043b\u043b\u0430\u0440\u043e\u0432. \u041e\u043d\u0438 \u043f\u0440\u0438\u0448\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u2014 6 \u043f\u043b\u0430\u0442 \u043f\u043e \u0446\u0435\u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 2000 \u0440\u0443\u0431\u043b\u0435\u0439. \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u0438 \u043f\u043b\u0430\u0442\u044b \u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u0443\u043f\u043b\u0435\u043d\u044b \u043d\u0430\u043c\u0438 \u0434\u043b\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430, \u0433\u0434\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0443\u0440\u0441.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/32f\/807\/a31\/32f807a31f76405380da7e50d996a805.png\" alt=\"image\"\/><\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0426\u0435\u043b\u044c<\/h4>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0447\u0442\u043e \u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430\u043c. \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 STM32, \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0421++ \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 FreeRTOS, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0418\u0442\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0435\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Olimex STM32P152, \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0442\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443), \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++ \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 FreeRTOS.<br \/>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043d\u0435\u043d\u0430\u0432\u044f\u0437\u0447\u0438\u0432\u044b\u043c, \u0431\u0435\u0437 \u0437\u0430\u0443\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u0445 \u044f\u0437\u044b\u043a\u0443 \u0421++. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 UML.   <\/p>\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-260713","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260713","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=260713"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260713\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}