{"id":198672,"date":"2013-10-23T15:30:03","date_gmt":"2013-10-23T11:30:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=198672"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=198672","title":{"rendered":"<span class=\"post_title\">\u041a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043b\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c \u0441 \u043d\u0443\u043b\u044f<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c \u0441 \u043d\u0443\u043b\u044f.<br \/>  \u041f\u043e\u0437\u0432\u043e\u043b\u044c\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u0430 \u0438\u0434\u0435\u044f \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0439.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u0442\u0430\u0440\u0435\u043d\u044c\u043a\u0430\u044f \u041a\u0438\u0430 \u041f\u0440\u0430\u0439\u0434. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0443 \u043d\u0435\u0451 \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432 \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u0440\u043f\u0443\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u043e\u0434\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0432\u0430\u043b\u0430 \u0438 \u043a\u0430\u0442\u0443\u0448\u043a\u0430 \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/e8e\/4b7\/493\/e8e4b7493852d121def28cbdc6da7e98.jpg\"\/><\/p>\n<p>  \u041d\u0430\u0441 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0430\u043b\u0430. \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0447\u043d\u0451\u043c \u044d\u0442\u043e\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c, \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/728\/924\/f6e\/728924f6e1b606320256ea93d5d16d66.jpg\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0442\u044b \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043a\u043e\u043b\u0435\u0441\u043e, \u0438 \u0441\u0430\u043c\u0438 \u0434\u0430\u0442\u0447\u0438\u043a\u0438. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/867\/a5a\/3d9\/867a5a3d940a3c2abb150d5bcfe13a5b.jpg\"\/><\/p>\n<p>  \u042d\u0442\u0438 \u0434\u0432\u0430 \u0436\u0435\u0441\u0442\u044f\u043d\u044b\u0445 \u043a\u043e\u043b\u0435\u0441\u0430 \u0441\u0438\u0434\u044f\u0442 \u043d\u0430 \u0432\u0430\u043b\u0443, \u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u2014 \u0438, \u043e \u0447\u0443\u0434\u043e, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442 \u0432 \u0434\u0432\u0443\u0445 \u0442\u043e\u0440\u0447\u0430\u0449\u0438\u0445 \u043d\u0430\u0440\u0443\u0436\u0443 \u043f\u0440\u043e\u0432\u043e\u0434\u0430\u0445 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/98c\/1a6\/372\/98c1a637277d2951745b47aa8d49e466.jpg\"\/><\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0435 \u0432\u0435\u0437\u0435\u043d\u0438\u0435 \u043d\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f: \u0445\u043e\u0442\u044f \u043c\u044b \u0438 \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0432 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0432\u0435\u043d\u0430\u0434\u0446\u0430\u0442\u0438\u0432\u043e\u043b\u044c\u0442\u043e\u0432\u044b\u0439 \u2014 \u0441\u0438\u0433\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u043f\u044f\u0442\u0438 \u0432\u043e\u043b\u044c\u0442\u0430\u0445! \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043a\u0430\u043a \u043e\u043d \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 stm32f4discovery \u2014 \u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u0441 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0446\u0435\u043d\u0430 \u043c\u0435\u043d\u0435\u0435 \u0442\u044b\u0441\u044f\u0447\u0438 \u0440\u0443\u0431\u043b\u0435\u0439 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 32\u044b\u0445 \u0431\u0438\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 168 \u041c\u0413\u0446 \u0438 \u0434\u0430\u0436\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/38d\/341\/9ec\/38d3419ecd803f972052e6347c7de4f2.jpg\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0447\u0443\u0434\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ChibiOS\/RT, \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0435\u0439, \u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0442\u0430\u0445\u043e\u043c\u0435\u0442\u0440.<\/p>\n<table border=\"1\">\n<tr>\n<td>\n<pre>volatile int rpm = 0; int lastInputEventTime = -10 * CH_FREQUENCY;  void icuWidthCallback(ICUDriver *driver) {     int now = chTimeNow();     int diff = now - lastInputEventTime;     rpm = 60000 * TICKS_IN_MS * 2 \/ 4 \/ diff;     lastInputEventTime = now; }  ICUConfig wave_icucfg = { ICU_INPUT_ACTIVE_LOW, 100000, icuWidthCallback, NULL };  int main(void) {     halInit();     chSysInit();      \/\/ this thread would blink one of the LEDs, that would look cool     chThdCreateStatic(blinkingThreadStack, sizeof(blinkingThreadStack), NORMALPRIO, blinkingThread, NULL);      \/\/ serial-over-usb initialization     usb_serial_start();      \/\/ configure input signal pin     palSetPadMode(CRANK_INPUT_PORT, CRANK_INPUT_PIN, PAL_MODE_ALTERNATE(GPIO_AF_TIM2));      \/\/ start input capture - we will handle input events and calculate RPM based on the timestamps     icuStart(&CRANK_DRIVER, &wave_icucfg);     icuEnable(&CRANK_DRIVER);      while (TRUE) {         \/\/ RPM value is updated by the input event handler         chprintf(&SDU1, &quot;rpm: %d\\r\\n&quot;, rpm);         chThdSleep(100);     }      return 0; }<\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<p>  \u041f\u043e-\u043c\u043e\u0435\u043c\u0443, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u041d\u043e, \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043e\u0434\u043d\u043e \u0434\u0435\u043b\u043e \u2014 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e \u2014 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b.<br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043a\u0430\u043a \u0436\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u043e\u0440\u0441\u0443\u043d\u043a\u0438?<\/p>\n<p>  \u0427\u0442\u043e\u0431 \u043d\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0438 \u0436\u0435\u043b\u0435\u0437\u043d\u044b\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0431\u043b\u043e\u043a\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u2014 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0435\u0433\u043e \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u044e \u043f\u043b\u0430\u0442\u0443 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e<br \/>  \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0448\u0438\u0440\u0438\u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0444\u043e\u0440\u0441\u0443\u043d\u043a\u0430\u043c\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0431\u0435\u0440\u0451\u043c \u0431\u043b\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043a\u043b\u0430\u0434\u0451\u043c \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u043e\u043b.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/51d\/31a\/d26\/51d31ad26edda3be4ff9f0e156072273.jpg\"\/><\/p>\n<p>  \u0410\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0443 \u043d\u0430\u0441 \u0432 \u043c\u0430\u0448\u0438\u043d\u0435 \u043d\u0430 12 \u0432\u043e\u043b\u044c\u0442? \u0442\u0430\u043a \u0438 \u0441\u0442\u0430\u0440\u044b\u0439 ATX \u0431\u043b\u043e\u043a \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u2014 \u0442\u043e\u0436\u0435 \u043d\u0430 12 \u0432\u043e\u043b\u044c\u0442, \u0435\u0433\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u043a\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/8c2\/e42\/c9d\/8c2e42c9d3648687f1f42a44581e274a.jpg\"\/><\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b\u0438\u0441\u044c \u043a \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0435, \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0442\u0430\u043c \u043f\u044f\u0442\u0438\u0432\u043e\u043b\u044c\u0442\u043e\u0432\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u2014 \u043d\u043e \u0441\u0430\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0435\u043d\u0432\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440 \u2014 \u0442.\u0435. \u043f\u0440\u043e\u0432\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043b\u0438\u0431\u043e \u0437\u0430\u0437\u0435\u043c\u043b\u0451\u043d, \u043b\u0438\u0431\u043e \u043d\u0438 \u043a \u0447\u0435\u043c\u0443 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d. \u0427\u0442\u043e\u0431 \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0434\u0430\u0442\u0447\u0438\u043a, \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/6ab\/bde\/911\/6abbde911aa5a64c4ab5a892d110b7ee.gif\"\/><\/p>\n<p>  \u0418 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0430.<\/p>\n<table border=\"1\">\n<tr>\n<td>\n<pre>static PWMConfig pwmcfg_slow = { 10000, 1000, NULL, { { PWM_OUTPUT_DISABLED, NULL }, { PWM_OUTPUT_ACTIVE_LOW, NULL }, { PWM_OUTPUT_DISABLED, NULL }, { PWM_OUTPUT_DISABLED, NULL } }, \/* HW dependent part.*\/ 0 };  int main(void) {     halInit();     chSysInit();      \/\/ this thread would blink one of the LEDs, that would look cool     chThdCreateStatic(blinkingThreadStack, sizeof(blinkingThreadStack), NORMALPRIO, blinkingThread, NULL);      \/\/ serial-over-usb initialization     usb_serial_start();      pwmStart(PWM_SLOW, &pwmcfg_slow);     palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(2));     pwmEnableChannel(PWM_SLOW, 1, 600);      while (TRUE)         chThdSleep(100);      return 0; }<\/pre>\n<p>  <\/td>\n<\/tr>\n<\/table>\n<p>  \u0424\u043e\u0440\u0441\u0443\u043d\u043a\u0438 \u0432\u043f\u0440\u044b\u0441\u043a\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u0437\u0435\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u0438\u0434\u0443\u0449\u0435\u0433\u043e \u043a \u043d\u0438\u043c \u043e\u0442 \u0431\u043b\u043e\u043a\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u0430. \u0427\u0442\u043e\u0431 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u0442 \u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u043e\u043b\u0435 \u0431\u043b\u043e\u043a\u0430, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0434\u0438\u043e\u0434 \u0438 \u043e\u0434\u0438\u043d \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/755\/3e6\/b8c\/7553e6b8c5e4956399e6c27927ac372e.gif\"\/><\/p>\n<p>  \u0421\u043e\u0431\u0435\u0440\u0451\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c. \u0418, \u043e\u043f\u044f\u0442\u044c \u0447\u0443\u0434\u043e! \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u0432\u0435\u0440\u0438\u043b, \u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u2014 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0432\u0430\u043b\u0430 \u2014 \u043d\u0430\u0447\u0430\u043b \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u043e\u0440\u0441\u0443\u043d\u043a\u0430\u043c\u0438!<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/0c6\/304\/f3d\/0c6304f3d9397bf04fdf3b68a28b3862.jpg\"\/><\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u0434\u0430\u0447\u0438 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u0438 \u0434\u0430\u0442\u0447\u0438\u043a \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0432\u043e\u0437\u0434\u0443\u0445\u0430. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0430\u0447\u043d\u0451\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c\u0438 \u0444\u043e\u0440\u0441\u0443\u043d\u043a\u0430\u043c\u0438, \u043d\u0430\u043c \u0443\u0436\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0437\u0430\u0437\u0435\u043c\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u043d\u043e\u0430\u043c\u043f\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u043e\u043b\u0435\u043d\u043e\u0438\u0434\u0430 \u2014 \u043d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0434\u0435\u0442\u0430\u043b\u0438. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043b\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c \u0441 \u043d\u0443\u043b\u044f \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u2014 \u0442\u0430\u043a \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u044d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <a href=\"https:\/\/www.youtube.com\/watch?v=GcxLY697WwM\">www.youtube.com\/watch?v=GcxLY697WwM<\/a><br \/>  <video>https:\/\/www.youtube.com\/watch?v=GcxLY697WwM<\/video> \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/198672\/\"> http:\/\/habrahabr.ru\/post\/198672\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c \u0441 \u043d\u0443\u043b\u044f.<br \/>  \u041f\u043e\u0437\u0432\u043e\u043b\u044c\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u0430 \u0438\u0434\u0435\u044f \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0439.  <\/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-198672","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198672","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=198672"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198672\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}