{"id":260723,"date":"2015-07-05T15:00:02","date_gmt":"2015-07-05T11:00:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=260723"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=260723","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 2"},"content":{"rendered":"<br \/>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/261807\/\">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<\/a> \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, <s>\u043a\u0430\u043a \u0443\u0435\u0445\u0430\u043b \u043d\u0430 \u043e\u0437\u0435\u0440\u043e<\/s> \u043a\u0430\u043a \u0431\u044b\u043b\u0438 \u0440\u0435\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f SR7, SR4 \u0438 SR6. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<br \/>  SR0: \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<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u0410\u0426\u041f<\/h4>\n<p>  \u0420\u0435\u0448\u0438\u0432 \u0447\u0442\u043e \u044f \u043f\u043e\u0441\u0442\u0438\u0433 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0443\u0434\u0440\u043e\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u044f\u0442\u044c \u0441\u0430\u043c\u043e\u0435 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 SR0 \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u2014 \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c 3 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0410\u0426\u041f. \u0420\u0435\u0448\u0438\u0432 \u0432\u0437\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0441 \u043b\u0435\u0442\u0443, \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0432\u043e\u043e\u043e\u0440\u0443\u0436\u0438\u0432\u0448\u0438\u0441\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0443\u043b\u043e\u043c Crt-C \u0438 Ctr-V, \u044f \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043a\u043e\u043f\u0438\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438 \u0438 \u043a\u043d\u043e\u043f\u043e\u043a.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e5d\/dc2\/b60\/e5ddc2b607fc4bff88befde4aed96ce6.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u043e \u043d\u0430\u0447\u0430\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0439 \u0447\u0443\u0434\u043d\u044b\u0439 \u0440\u0438\u0441\u0443\u043d\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439, \u0443\u0432\u043b\u0435\u043a\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0430\u043d\u0430\u043b DMA. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439, \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0431\u043b\u043e\u043a, \u043d\u043e \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<a name=\"habracut\"><\/a><br \/>  \u0418 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b \u0432\u0441\u0435 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/83b\/5f5\/10f\/83b5f510f43742d9a1be2ca816a2f8ee.png\" alt=\"image\"\/><\/p>\n<p>  \u0412\u0441\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0433\u043e\u0442\u043e\u0432\u0430, \u0438 \u0442\u0443\u0442 \u044f \u0437\u0430\u0432\u0438\u0441. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0410\u0426\u041f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0447\u0435\u043c \u043f\u043e\u0440\u0442\u044b, \u0434\u0430 \u0438 \u0443 \u043c\u0435\u043d\u044f \u0443\u043f\u043e\u0440\u043d\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u043d\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. \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0435\u0441\u0442\u044c, Vdda \u0435\u0441\u0442\u044c, \u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0438\u043a\u0430 \u043d\u0438\u043a\u0430\u043a. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0410\u0426\u041f \u043f\u043e\u043c\u043e\u0433 \u043e\u043f\u044f\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0440\u0435\u0441\u0443\u0440\u0441, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433 \u043c\u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"http:\/\/chipspace.ru\/stm32l-discovery-adc\/\">STM32L. ADC \u2014 \u0410\u043d\u0430\u043b\u043e\u0433\u043e-\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/a> \u0438 <a href=\"http:\/\/chipspace.ru\/stm32l-dma\/\">STM32L. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 DMA.<\/a> \u0410 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0438\u043a\u043e\u043c \u0434\u0435\u043c\u043e-\u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0439 \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u044b Olimex. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u043e\u0436\u043a\u043e\u0439 PortD.Pin1 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u0432\u0441\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0436\u0435\u043b\u0435\u0437\u0430 \u044f \u0432\u044b\u043a\u0438\u043d\u0443\u043b \u0432 __low_level_init()  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a \u0410\u0426\u041f \u0438 DMA<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">  \/\/\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440(\u0422\u0440\u0438\u043c\u043c\u0435\u0440) PORTD_PIN1     GPIOD-&gt;MODER |= GPIO_MODER_MODER1_0;    GPIOD-&gt;PUPDR |= GPIO_PUPDR_PUPDR1_0;    GPIOD-&gt;OSPEEDR |= GPIO_OSPEEDER_OSPEEDR1;    \/\/\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0410\u0426\u041f, 12 \u0431\u0438\u0442, \u043a\u0430\u043d\u0430\u043b 16- \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u0435\u043d\u0441\u043e\u0440, 17 - VDDA,    \/\/ 22 - \u0442\u0440\u0438\u043c\u043c\u0435\u0440 \u0432 \u043a\u043e\u043d\u0442\u0438\u043d\u0438\u0443\u0441 \u0440\u0435\u0436\u0438\u043c\u0435,     \/\/\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043a\u0430\u043d\u0430\u043b\u044b, \u0441\u043a\u0430\u043d \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u043a\u0438\u043d\u0443\u0442    \/\/ EOC, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 EOC \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u0440\u0438\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u0441\u043c http:\/\/chipspace.ru\/stm32l-discovery-adc\/    \/\/ \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043c\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u043d\u0430\u043b\u044b 16(\u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443) \u0438 17(vdda) \u0438       \/\/ 22(\u0442\u0440\u0438\u043c\u043c\u0435\u0440)\u043f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, 2- vdda, 3- \u0442\u0440\u0438\u043c\u043c\u0435\u0440    ADC1-&gt;CR2 |= (ADC_CR2_DELS_2 | ADC_CR2_CONT);    ADC1-&gt;CR1 |= ADC_CR1_SCAN;       \/\/\u041f\u043e\u0440\u0442 GPIOE.7 \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0445\u043e\u0434 - \u0442\u0440\u0438\u043c\u043c\u0435\u0440     GPIOE-&gt;MODER |= GPIO_MODER_MODER7;    \/\/3 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f       ADC1-&gt;SQR1 |= ADC_SQR1_L_1;    \/\/\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c ADC_IN 16 \u0434\u043b\u044f 1 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0442\u0440 305    \/\/\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c ADC_IN 17 \u0434\u043b\u044f 2 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0442\u0440 305    \/\/\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c ADC_IN 22 \u0434\u043b\u044f 3 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0442\u0440 305    ADC1-&gt;SQR5 |= ADC_SQR5_SQ1_4 | ADC_SQR5_SQ2_0 | ADC_SQR5_SQ2_4 | ADC_SQR5_SQ3_1 | ADC_SQR5_SQ3_2 | ADC_SQR5_SQ3_4;    \/\/\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f 16 \u0438 17  \u0438 22 \u043a\u0430\u043d\u0430\u043b\u0430 \u0441\u0442\u0440 301 \u0438 279    ADC1-&gt;SMPR2 |= ADC_SMPR2_SMP16 | ADC_SMPR2_SMP17_2;    ADC1-&gt;SMPR1 |= ADC_SMPR1_SMP22_2;    \/\/ \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u044b \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0438\u0437\u043c\u0440\u0435\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0441\u0435\u043d\u0441\u043e\u0440\u0430 \u0438 VDDA       ADC-&gt;CCR |= ADC_CCR_TSVREFE;      \/\/ DMA    ADC1-&gt;CR2 |= (ADC_CR2_DMA | ADC_CR2_DDS);    \/\/\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 DMA    \/\/\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 - \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438, \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c.    DMA1_Channel1-&gt;CCR &= ~DMA_CCR1_DIR;      \/\/\u0410\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 \u043d\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0438.     DMA1_Channel1-&gt;CCR &= ~DMA_CCR1_PINC;    \/\/\u0410\u0434\u0440\u0435\u0441 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0438.     DMA1_Channel1-&gt;CCR |= DMA_CCR1_MINC;     \/\/\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 - 16 \u0431\u0438\u0442.    DMA1_Channel1-&gt;CCR |= DMA_CCR1_PSIZE_0;     \/\/\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 - 16 \u0431\u0438\u0442    DMA1_Channel1-&gt;CCR |= DMA_CCR1_MSIZE_0;    \/\/\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 - \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u0438\u0439 (Very High)    DMA1_Channel1-&gt;CCR |= DMA_CCR1_PL;     DMA1_Channel1-&gt;CCR |= DMA_CCR1_CIRC;     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">adc.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 #define SENSORTEMPERATURE_CHANNEL       0 #define VDDA_CHANNEL                    1  #define TRIMMER_CHANNEL                 2 class cAdc {   public:     explicit  cAdc(const tU32 memoryBaseAddr, const tU8 measureCount);     tBoolean switchOn(void);     tBoolean startConversion(void);     tBoolean isConversionReady(void);     tF32 getValue(void) const;   private:     void initDma(const tU32 memoryBaseAddr, const tU8 measureCount); }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">adc.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;adc.h&quot;                  \/\/ \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 #include &quot;susuassert.h&quot;      \/\/for ASSERT #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 SETBIT, CLRBIT #define ADC1_DR_ADDRESS    ((tU32)0x40012458) \/******************************************************************************* * Function:  constructor * Description: \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0443\u0440\u0435\u0442 \u043a\u0430\u043d\u0430\u043b DMA \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0432 RAM, \u043a\u0443\u0434\u0430 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 *              \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 ******************************************************************************\/ cAdc::cAdc(const tU32 memoryBaseAddr, const tU8 measureCount) {   ASSERT(measureCount != 0);    this-&gt;initDma(memoryBaseAddr, measureCount); } \/******************************************************************************* * Function:  switchOn * Description: \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0410\u0426\u041f ******************************************************************************\/ tBoolean cAdc::switchOn(void) {   tBoolean  result = FALSE;   \/\/\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0410\u0426\u041f, \u0441\u0442\u0440 299 CD00240194.pdf   SETBIT(ADC1-&gt;CR2, ADC_CR2_ADON);   result =  tBoolean(CHECK_BIT_SET(ADC1-&gt;SR, ADC_SR_ADONS));   return result;      } \/******************************************************************************* * Function:  startConversion() * Description: \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ******************************************************************************\/ tBoolean cAdc::startConversion(void) {   tBoolean  result = FALSE;   \/\/\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0410\u0426\u041f, \u0441\u0442\u0440 299 CD00240194.pdf   SETBIT(ADC1-&gt;CR2, ADC_CR2_SWSTART);   result = tBoolean(CHECK_BIT_SET(ADC1-&gt;SR, ADC_SR_STRT));   return result; } \/******************************************************************************* * Function:  getValue() * Description: \u0447\u0438\u0442\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f ******************************************************************************\/ tF32 cAdc::getValue(void) const {   tF32  result = ADC1-&gt;DR;   return result;  } \/******************************************************************************* * Function:  isConversionReady() * Description: \u0433\u043e\u0442\u043e\u0432\u043e \u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435? ******************************************************************************\/ tBoolean cAdc::isConversionReady(void) {   tBoolean result = tBoolean(CHECK_BIT_SET(ADC1-&gt;SR, ADC_SR_EOC));   return result; } \/******************************************************************************* * Function:  initDma() * Description: \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u0430\u043d\u0430\u043b DMA ******************************************************************************\/ void cAdc::initDma(const tU32 memoryBaseAddr, const tU8 measureCount) {   \/\/\u0417\u0430\u0434\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 - \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0410\u0426\u041f \u0434\u043b\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043a\u0430\u043d\u0430\u043b\u043e\u0432.    DMA1_Channel1-&gt;CPAR = ADC1_DR_ADDRESS;   \/\/\u0417\u0430\u0434\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043f\u0430\u043c\u044f\u0442\u0438 - \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 RAM.   DMA1_Channel1-&gt;CMAR = memoryBaseAddr;   DMA1_Channel1-&gt;CNDTR = measureCount;   \/\/\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c DMA   SETBIT(DMA1_Channel1-&gt;CCR, DMA_CCR1_EN);   } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">adcdirector.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;adc.h&quot;              \/\/\u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 cAdc #define MEASUR_NUMBER       (tU8) 3 class cAdcDirector  {   public:     explicit  cAdcDirector(void);     void startConversion(void);     __IO uint16_t channelValue[MEASUR_NUMBER];   \/\/ \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439   private:     cAdc *pAdc;     }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">adcdirector.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;adcdirector.h&quot;  \/\/\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430  \/******************************************************************************* * Function:  constructor * Description: \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0410\u0426\u041f, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 RAM, \u043a\u0443\u0434\u0430 \u0410\u0426\u041f \u0441  *              \u043f\u043e\u043c\u043e\u0449\u044c\u044e DMA \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u043b\u0434\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439.  ******************************************************************************\/ cAdcDirector::cAdcDirector(void) {   this-&gt;pAdc = new cAdc((tU32)&channelValue[0], MEASUR_NUMBER);   this-&gt;pAdc-&gt;switchOn();    } \/******************************************************************************* * Function:  startConversion * Description: \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0410\u0426\u041f \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u044b\u043f\u043b\u044f\u0442\u0441\u044f \u043f\u043e DMA \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 *              channelValue * Threading usage and Assumptions:  ******************************************************************************\/ void cAdcDirector::startConversion(void) {   this-&gt;pAdc-&gt;startConversion();      } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u043e\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 \u0438\u043d\u0434\u0438\u043a\u0442\u043e\u0440 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043a\u0430 \u043d\u0435\u0442. \u041d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u044d\u043a\u0437\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 main()  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">main()<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">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];   cAdcDirector *pAdcDirector = new cAdcDirector();   pAdcDirector-&gt;startConversion();   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\u0442\u0438\u043b \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443: \u041a\u0430\u043a \u0440\u0430\u0437 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 3 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 channelValue[] \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u0442\u0430\u043b, \u043d\u043e \u043d\u0430 \u0432\u0441\u043a\u0438\u0434\u043a\u0443 \u2014 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/33f\/f87\/037\/33ff87037544473fbd680327068aaea6.png\" alt=\"image\"\/> <\/p>\n<p>  \u041f\u043e \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d \u0442\u0443\u0442: <a href=\"https:\/\/yadi.sk\/d\/IVlBn5REhfvaY\">\u0410\u0426\u041f, \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b \u0432 IAR 6.50<\/a><\/p>\n<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/h4>\n<p>  \u0418 \u0442\u0430\u043a \u0410\u0426\u041f \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0433\u0440\u0443\u0434\u0443 \u044d\u0442\u0438\u0445 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043d\u043e\u043b\u0438\u043a\u043e\u0432 \u0432 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u043b\u044e\u0434\u044f\u043c, \u0430 \u0438\u043c\u0435\u0435\u043d\u043e \u0432 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0438 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435:<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043b, \u0435\u0434\u0438\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 \u0441\u043e\u0431\u0442\u0441\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0447\u0435\u0442 \u0438 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/072\/96d\/ed7\/07296ded78804a07a5d6f406bf1d1757.png\" alt=\"image\"\/><\/p>\n<p>  \u0410 \u0434\u0430\u043b\u0435\u0435 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043a\u0430\u043a \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/756\/074\/fe6\/756074fe636d4965be8fc481a868658d.png\" alt=\"image\"\/><\/p>\n<p>  \u0410 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b \u0435\u0449\u0435 \u0438\u043c\u0435\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u0437\u043c\u0440\u0435\u043d\u0438\u0439. \u0410 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0443\u0436\u0435\u043d \u0432\u0441\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0446\u0435\u043f\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fb3\/226\/8c6\/fb32268c66af4d7e910a089f64099634.png\" alt=\"image\"\/><\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0440\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041d\u043e \u0442\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043c\u0430\u0440\u043a\u0443, \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0437\u0430\u0432\u043e\u0434\u0441\u043a\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0437\u0430\u0448\u0438\u0442\u044b\u0435 \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u0438 \u043f\u043e \u0438\u0434\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043d\u0430\u0434\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044d\u0442\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043d\u0443\u0436\u043d\u044b, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435. \u041d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0443 \u043c\u0435\u043d\u044f \u0432 \u043e\u0431\u0440\u0435\u0437 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0433\u043e\u0440\u043e\u0434\u0443\u043b\u044c\u043a\u0443 \u0438\u0437-\u0437\u0430 \u0442\u0440\u0435\u0445 \u043a\u043e\u044d\u0444\u0444\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0441\u044f\u043a \u043d\u0430 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432 \u0443\u043c\u0435, \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u043e\u0440\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442(\u043d\u0443 \u0438 \u043b\u0430\u0434\u043d\u043e :)). \u0420\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ivariable.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 #include &quot;adcdirector.h&quot;      \/\/\u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 cAdcdirector class iVariable  {   public:     explicit  iVariable(const cAdcDirector *pAdcDirector);     virtual tF32 calculate(void) = 0;     tF32 getValue(void) const {return value;};     protected:     const cAdcDirector *pAdcDirector;     tF32 value;    }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ivariable.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;ivariable.h&quot;      \/\/\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430  #include &quot;susuassert.h&quot;     \/\/ for ASSERT \/******************************************************************************* * Function:  constructor * Description:  ******************************************************************************\/ iVariable::iVariable(const cAdcDirector *pAdcDirector) {   ASSERT(pAdcDirector != NULL);   this-&gt;pAdcDirector = pAdcDirector;   this-&gt;value = 0.0F; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ifilter.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 iFilter  {   public:     explicit iFilter(void);     virtual tF32 filter(const tF32 previousValue,                          const tF32 currentValue, tF32 filterConst); }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ifilter.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;susuassert.h&quot;       \/\/ for ASSERT #include &quot;types.h&quot;            \/\/ \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 #include &quot;ifilter.h&quot;          \/\/ \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \/******************************************************************************* * Function:  constructor * Description: \u0417\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u0440\u0442\u044b \u0438 \u043f\u0438\u043d\u044b \u0434\u043b\u044f 4-\u0435\u0445 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 ******************************************************************************\/ iFilter::iFilter(void)   { } \/******************************************************************************* * Function:  filter * Description: \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 ******************************************************************************\/ tF32 iFilter::filter(const tF32 previousValue, const tF32 currentValue, tF32 filterConst) {   ASSERT(filterConst != 0);   tF32 filteredValue = previousValue;   filteredValue = filteredValue + (currentValue - filteredValue) \/ filterConst;   return filteredValue; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">temperature.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 #include &quot;adcdirector.h&quot;      \/\/\u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 cAdcdirector #include &quot;ifilter.h&quot;          \/\/\u0434\u043b\u044f \u0438\u043d\u0442\u0440\u0435\u0444\u0435\u0439\u0441\u0430 iFilter #include &quot;iVariable.h&quot;        \/\/\u0434\u043b\u044f \u0438\u043d\u0442\u0440\u0435\u0444\u0435\u0439\u0441\u0430 iVariable class cTemperature : public iVariable, private iFilter  {   public:     explicit cTemperature(cAdcDirector *pAdcDirector);       tF32 calculate(void); }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">temperature.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;temperature.h&quot;  \/\/\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430  \/\/\u0420\u0430\u0437\u043d\u0438\u0446\u0430 110\u0421 - 30\u0421 (\u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432 \u0442\u043e\u0447\u043a\u0430\u0445 \u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0438), \u0441\u043c \u0441\u0442\u0440 289 #define DELTA_110_30  80.0F  \/\/\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0430\u0433\u0440\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u043d\u0430 28 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432, \u0430 \u043d\u0435 \u043d\u0430 30 :) #define DEGREE_30     28.0F   \/\/\u0410\u0434\u0440\u0435\u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0435\u043d\u0442\u0430 \u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0438 2 \u0441\u0442\u0440 102 CD00277537.pdf #define TS_CAL2_ADDR   0x1FF8007C   \/\/\u0410\u0434\u0440\u0435\u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0435\u043d\u0442\u0430 \u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0438 1 \u0441\u0442\u0440 102 CD00277537.pdf #define TS_CAL1_ADDR   0x1FF8007A   \/\/\u0410\u0434\u0440\u0435\u0441 \u043a\u043e\u0434\u0430 VDDA \u043f\u0440\u0438 3.0 \u0412 #define VDDA_CAL_ADDR  0x1FF80076   #define FILTER_CONST   20.0F  \/******************************************************************************* * Function:  constructor * Description:  ******************************************************************************\/ cTemperature::cTemperature(cAdcDirector *pAdcDirector) : iVariable(pAdcDirector)   { } \/******************************************************************************* * Function:  calculate * Description: \u0420\u0430\u0441\u0447\u0435\u0442 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b ******************************************************************************\/ tF32 cTemperature::calculate(void) {   tF32 temperature = 0.0F; \/\/\u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043e\u0442\u0441\u0447\u0435\u0442\u0443 \u0410\u0426\u041f    tF32 vdda = 0.0F;   \/\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 vdda   \/\/\u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0441\u0435\u043d\u0441\u043e\u0440\u0430, \u0441\u043c \u0441\u0442\u0440 289 CD00240193.pdf \u0438   \/\/\u0441\u0442\u0440 102 CD00277537.pdf   tF32 tsCal2 = (tF32)(*((tU32 *)(TS_CAL2_ADDR)) &gt;&gt; 16);    tF32 tsCal1 = (tF32) (*((tU32 *)(TS_CAL1_ADDR )));   tF32 vddaCal = (tF32)(*((tU32 *)(VDDA_CAL_ADDR)) &gt;&gt; 16);   temperature = (tF32)this-&gt;pAdcDirector-&gt;channelValue[SENSORTEMPERATURE_CHANNEL];   vdda = (tF32)this-&gt;pAdcDirector-&gt;channelValue[VDDA_CHANNEL];   \/\/\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0432\u0435 \u043f\u0440\u0438 3.0 \u0412 VDDA,    \/\/\u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044e \u043d\u0430 \u043d\u0430\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 vdda, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435   \/\/\u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0441\u043e \u0441\u043c \u0441\u0442\u0440 289 CD00240193.pdf    temperature = DELTA_110_30 * ((temperature * vddaCal)\/vdda -  tsCal1) \/                                  (tsCal2 - tsCal1) + DEGREE_30;   this-&gt;value = this-&gt;filter(this-&gt;value, temperature, FILTER_CONST);    return  this-&gt;value;        } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u0447\u0435\u0442 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b. \u0414\u0430 \u0438\u0432\u043e\u043e\u0431\u0449\u0435 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043f\u0435\u0440\u043c\u0435\u043d\u043d\u044b\u0445, \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c. \u0425\u043e\u043b\u0441\u0442-\u043a\u0438\u0441\u0442\u044c \u0438 \u0432\u0443\u0430\u043b\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cc2\/d38\/40d\/cc2d3840d51e42b280ab6b96d6206095.png\" alt=\"image\"\/><\/p>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0430 \u0434\u043e \u0431\u0435\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">variablesdirector.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;iActiveObject.h&quot;    \/\/\u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 iActiveObject #include &quot;temperature.h&quot;      \/\/\u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 cTemperature class cVariablesDirector : public iActiveObject {   public:     explicit cVariablesDirector(cAdcDirector* pAdcDirector);     void run(void);     cTemperature *pTemperature;     }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">variablesdirector.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;variablesdirector.h&quot;  \/\/ \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430  #include &quot;frtoswrapper.h&quot;       \/\/ \u0434\u043b\u044f oRTOS #include &quot;susuassert.h&quot;         \/\/ \u0434\u043b\u044f ASSERT #define VARIABLESDIRECTOR_DELAY (tU32)40\/portTICK_PERIOD_MS \/******************************************************************************* * Function:  constructor * Description: \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0410\u0426\u041f ******************************************************************************\/ cVariablesDirector::cVariablesDirector(cAdcDirector* pAdcDirector) {   ASSERT(pAdcDirector != NULL);   this-&gt;pTemperature = new cTemperature(pAdcDirector); } \/******************************************************************************* * Function:  run * Description: \u0417\u0430\u0434\u0430\u0447\u0430  \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b ******************************************************************************\/ void cVariablesDirector::run(void) {   for(;;)   {     this-&gt;pTemperature-&gt;calculate();     oRTOS.taskDelay(VARIABLESDIRECTOR_DELAY);   } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0441\u0430\u043c\u043e\u0435 \u043c\u0430\u043b\u043e\u0435 \u2014 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c. \u041f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 main()  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">main()<\/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 #include &quot;variablesdirector.h&quot;  \/\/ \u0414\u043b\u044f cVariablesDirector #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 #define VARIABLESDIRECTOR_STACK_SIZE (tU16) configMINIMAL_STACK_SIZE #define VARIABLESDIRECTOR_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 ) {     \/\/\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];   cAdcDirector *pAdcDirector = new cAdcDirector();   pAdcDirector-&gt;startConversion();   cVariablesDirector *pVariablesDirector = new cVariablesDirector(pAdcDirector);    oRTOS.taskCreate(pVariablesDirector, VARIABLESDIRECTOR_STACK_SIZE, VARIABLESDIRECTOR_PRIORITY, &quot;Var&quot;);   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>  \u0418 \u043e\u043f\u044f\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u043e\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435\u043a\u0443\u0434\u0430. \u0418 \u0432\u043e\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u043c \u0442\u043e\u0447\u043a\u0443 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u0435\u0440\u0435\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0436\u043c\u0435\u043c \u0440\u0430\u0437 40 F5(Run), \u0447\u0442\u043e\u0431\u044b \u0444\u0438\u043b\u044c\u0442\u0440 \u0443\u0441\u0442\u0430\u043a\u0430\u043d\u0438\u043b\u0441\u044f \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u2014 \u0432\u044b\u0434\u0435\u043b\u043d\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u043c 23.68 \u0421, \u043d\u0443 \u043f\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c \u0442\u0430\u043a \u0435\u0441\u0442\u044c, \u043d\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e 23.62 \u0421 \ud83d\ude42 <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fa0\/9a0\/3f6\/fa09a03f645e4fe28db521cb1f96f034.png\" alt=\"image\"\/> <\/p>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c: <a href=\"https:\/\/yadi.sk\/d\/9uUq_YRzhfzXk\">\u041a\u043d\u043e\u043f\u043a\u0438, \u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b, \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043d\u0430 IAR 6.50<\/a><br \/>  \u0422\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0444\u043e\u043a\u0443\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 Vdda \u0438 Trimmer (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440). \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 cTemeperature.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/430\/e6c\/ebf\/430e6cebfa174b43a4e002b995683719.png\" alt=\"image\"\/><\/p>\n<p>  \u0410 \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0435\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u2014 cVariableDirector \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a1a\/526\/cfa\/a1a526cfac8f4f259da5758f2caaf5ee.png\" alt=\"image\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0439 \u0432 cVariableDirector   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">VariableDirector.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &quot;variablesdirector.h&quot;  \/\/ \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430  #include &quot;frtoswrapper.h&quot;       \/\/ \u0434\u043b\u044f oRTOS #include &quot;susuassert.h&quot;         \/\/ \u0434\u043b\u044f ASSERT #define VARIABLESDIRECTOR_DELAY (tU32)40\/portTICK_PERIOD_MS \/******************************************************************************* * Function:  constructor * Description: \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0410\u0426\u041f ******************************************************************************\/ cVariablesDirector::cVariablesDirector(cAdcDirector* pAdcDirector) {   ASSERT(pAdcDirector != NULL);   this-&gt;pTemperature = new cTemperature(pAdcDirector);   this-&gt;pVdda =  new cVdda(pAdcDirector);   this-&gt;pTrimmer =  new cTrimmer(pAdcDirector); } \/******************************************************************************* * Function:  run * Description: \u0417\u0430\u0434\u0430\u0447\u0430  \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b ******************************************************************************\/ void cVariablesDirector::run(void) {   for(;;)   {     this-&gt;pTemperature-&gt;calculate();     this-&gt;pVdda-&gt;calculate();     this-&gt;pTrimmer-&gt;calculate();     oRTOS.taskDelay(VARIABLESDIRECTOR_DELAY);   } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442(\u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0446\u0438\u0444\u0435\u0440\u043a\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 value): \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 23.5\u0421, Vdda \u043a\u0430\u043a \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 2.72, \u0430 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440\u0435 2.52 (\u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c, \u043f\u043e\u0432\u0435\u0440\u0432\u043d\u0443\u0442 \u0440\u043e\u043b\u0438\u043a \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0430)<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0b8\/249\/617\/0b8249617492459bb8680091588467cf.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0432\u043e\u0437\u0438\u043b\u0441\u044f \u044f \u0441 \u043d\u0438\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u2014 \u043f\u043e\u0447\u0442\u0438 7 \u0434\u043d\u0435\u0439. \u041d\u043e \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043e\u043a \u0441 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0430, \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e \u0442\u0443\u043f\u0438\u043b, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0438\u0447\u0435\u0433\u043e. \u0425\u043e\u0440\u043e\u0448\u043e \u0434\u043e\u0434\u0443\u043c\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043b\u0430\u0442\u044b Olimex \ud83d\ude42 \u041e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u043e\u0434\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440. \u042f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u043e\u0442 \u043c\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 8-\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0431\u044b\u043b \u043d\u0430 PIC16 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430, \u0438 \u0443\u0436 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u043e \u043c\u043d\u0435 \u0434\u0430\u0441\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u0410 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<br \/>  \u0414\u0430 \u0437\u0430\u0431\u044b\u043b \u0441\u043e\u0432\u0441\u0435\u043c \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u0436\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0443\u0442:<br \/>  <a href=\"https:\/\/yadi.sk\/d\/Wb5kpy6dhg5Vq\">\u041a\u043d\u043e\u043f\u043a\u0438, C\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b, \u0438 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 IAR 6.50<\/a>     \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\/261823\/\"> http:\/\/habrahabr.ru\/post\/261823\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/261807\/\">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<\/a> \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, <s>\u043a\u0430\u043a \u0443\u0435\u0445\u0430\u043b \u043d\u0430 \u043e\u0437\u0435\u0440\u043e<\/s> \u043a\u0430\u043a \u0431\u044b\u043b\u0438 \u0440\u0435\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f SR7, SR4 \u0438 SR6. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<br \/>  SR0: \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<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u0410\u0426\u041f<\/h4>\n<p>  \u0420\u0435\u0448\u0438\u0432 \u0447\u0442\u043e \u044f \u043f\u043e\u0441\u0442\u0438\u0433 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0443\u0434\u0440\u043e\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u044f\u0442\u044c \u0441\u0430\u043c\u043e\u0435 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 SR0 \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u2014 \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c 3 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0410\u0426\u041f. \u0420\u0435\u0448\u0438\u0432 \u0432\u0437\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0441 \u043b\u0435\u0442\u0443, \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0432\u043e\u043e\u043e\u0440\u0443\u0436\u0438\u0432\u0448\u0438\u0441\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0443\u043b\u043e\u043c Crt-C \u0438 Ctr-V, \u044f \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043a\u043e\u043f\u0438\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438 \u0438 \u043a\u043d\u043e\u043f\u043e\u043a.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e5d\/dc2\/b60\/e5ddc2b607fc4bff88befde4aed96ce6.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u043e \u043d\u0430\u0447\u0430\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0439 \u0447\u0443\u0434\u043d\u044b\u0439 \u0440\u0438\u0441\u0443\u043d\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439, \u0443\u0432\u043b\u0435\u043a\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0430\u043d\u0430\u043b DMA. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439, \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0431\u043b\u043e\u043a, \u043d\u043e \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/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-260723","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260723","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=260723"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260723\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}