ãŸãã¯ãããªãã£ãŒããå§ããŸããããã¿ã¹ã¯ãå€ãå Žåãã¢ã€ãã«ãµã€ã¯ã«ã§å®è¡ããããã«ããã»ããµãŒæéãç¡é§ã«äœ¿ãå§ããŸãã 以åã®åºçç©ã§ãã§ã«è¿°ã¹ãããã«ãçŸåšäœã®é¢ä¿ããªãïŒæ©åšããã®ããŒã¿ãæ¥ãªãã£ãããŸãã¯ä»ã®çµç¹äžã®çç±ã§ïŒãã¹ãŠã®ã¿ã¹ã¯ããããã¯ããå¿ èŠããããŸãã ããã»ããµã¯ããã¯ã«ã¯åžžã«ãã€ã¯ãã³ã³ãããŒã©ãæèŒãããŠããªããããå®è¡ããã«ã¯ãçŸåšå®è¡ãã¹ãã¿ã¹ã¯ã®ã¿ãèšå®ããå¿ èŠããããŸãã
ããã«ãç¹å®ã®ãªãœãŒã¹ïŒç¹ã«æ©åšïŒã§ã¿ã¹ã¯ãäºãã«ç«¶åããå ŽåããããŸãã ãã«ãã¿ã¹ã¯ã®çš®é¡ãæ€èšããéã«ãSPIããŒãã®ç«¶åã®å žåçãªã±ãŒã¹ãæ¢ã«æ€èšããŸããïŒå調ãã«ãã¿ã¹ã¯ã«åãæ¿ããããšã§éšåçã«è§£æ±ºãããŸããããåžžã«åãæ¿ããããšã¯ã§ããŸããïŒã
ãããŠææªã®å Žåã¯ã¿ã¹ã¯ã®äŸåé¢ä¿ã§ãã å€ãã®å Žåã1ã€ã®ã¿ã¹ã¯ã®çµæã¯å¥ã®ã¿ã¹ã¯ã§äœ¿çšãããŸãã æãããªäŸãšããŠã次ã®ãã®ãæããããšãã§ããŸãïŒæž©åºŠã»ã³ãµãŒããã®ååãªããŒã¿ãåä¿¡ããŠââå¹³ååãããŸã§ã枩床ã³ã³ãããŒã©ãŒã®PIDåºåã®ããŒã¿ãåèšç®ããããšã¯ç¡æå³ã§ããçµç«¯æåïŒè¡çµç«¯èšå·ïŒãåä¿¡ããããŸã§ç«¯æ«ããã ãããŠãæçœãªãã®ã«å ããŠãäŸåçãšããããçæãã人皮ã®å€ãã®æçœã§ãªãã±ãŒã¹ããããŸãã åå¿è ã®éçºè ã¯ãããã°ã©ã ã®ã¢ã«ãŽãªãºã ãçŽæ¥å®è£ ããããããã¬ãŒã¹ãšæŠãã®ã«æéããããå ŽåããããŸãã
ããããã¹ãŠã®å Žåã«ãããŠãåæãªããžã§ã¯ãã¯éçºè ã®å©ãã«ãªããŸãã çŸåšã®åºçç©ã§ãMAX MAX RTOSã§äœ¿çšå¯èœãªåæãªããžã§ã¯ããšé¢æ°ãèããŠã¿ãŸãããã
åã®éšåãèŠãããšããªã人ã®ããã«ããªã³ã¯ïŒ
ããŒã1.äžè¬æ å ±
ããŒã2. RTOS MAXã®ã«ãŒãã«
ããŒã3.æãåçŽãªããã°ã©ã ã®æ§é
ããŒã4.æçšãªçè«
ããŒã5.æåã®ã¢ããªã±ãŒã·ã§ã³
ããŒã6.ã¹ã¬ããåæããŒã«ïŒãã®èšäºïŒ
ããŒã7.ã¿ã¹ã¯éã§ããŒã¿ã亀æããæ段
ããŒã8.å²ã蟌ã¿ã®åŠç
ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³
ãŠã©ãŒã ã¢ããããã«ã¯ãCriticalSectionã¯ã©ã¹ãæ€èšããŸãã ã³ã³ããã¹ãã®åãæ¿ããåãå ¥ããããªãé åããã¬ãŒã åããããã«äœ¿çšãããŸãã
ã¯ã©ã¹ãªããžã§ã¯ããã¹ã³ãŒãã«è¡šç€ºããããšããã«ãåªå 床ãMAX_SYSCALL_INTERRUPT_PRIORITY以äžã®ãã¹ãŠã®å²ã蟌ã¿ããããã¯ãããŸãã çŸåšããã®å®æ°ã¯5ã§ãããããã€ã¹ããã³ã·ã¹ãã ã¿ã€ããŒããã®ãã¹ãŠã®å²ã蟌ã¿ããããã¯ããŸãããäŸå€çãªç¶æ³ããããã¯ããŸããã
ãªããžã§ã¯ããã¹ã³ãŒãããå€ãããšãå²ã蟌ã¿ã¬ãã«ã¯å ¥ååã®ç¶æ ã«æ»ããŸãã åŸè ã§ã¯ããã¹ããããã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®ååŸãå¿é ããå¿ èŠã¯ãããŸãããå®éã«æ©èœããã®ã¯æåã®ã»ã¯ã·ã§ã³ã®ã¿ã§ãã å€éšä»¥å€ã¯ãã¹ãŠäžå¿ èŠãªäœæ¥ãè¡ããŸãã ãŸããèš±å¯ãããé«ã¬ãã«ã®å²ã蟌ã¿ãåãå²ã蟌ã¿ã«çœ®ãæããçµäºãããšãã«å ã®å²ã蟌ã¿ã埩å ãããšãå ã®é«ã®ãŸãŸã«ãªããŸãã åã蟌ãŸããã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®æãå€åŽãçµäºãããšãäœã¬ãã«ã埩å ãããŸãã ãã¡ããããã¹ãã¯é¢æ°ãåŒã³åºããããšãã«æãé »ç¹ã«ååŸãããŸãããã®é¢æ°ã«ã¯ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ããããŸãã
ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã¯å²ã蟌ã¿åªå 床ãå€æŽãããã€ãŸãNVICãããã°ã©ã ãããããç¹æš©ã¢ãŒãã³ãŒãã§ã®ã¿äœ¿çšããå¿ èŠããããŸãã
äŸã«ã€ããŠèããŠã¿ãŸãããïŒãã³ã¯è²ã§åŒ·èª¿è¡šç€ºãããé åã¯ãã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«ãã£ãŠä¿è·ãããŠããŸããããã§ã¯ãã³ã³ãããŒã«ãã¿ã¹ã¯ããåé€ãããªãããšãä¿èšŒãããŠããŸãïŒ
åãããš-ããã¹ã
void ProfEye::Tune() { ProfData::m_empty_call_overhead = 0; ProfData::m_empty_constr_overhead = 0; ProfData::m_embrace_overhead = 0; CriticalSection _cs_; loop ( int, i, 1000 ) { PROF_DECL(PE_EMPTY_CALL, empty_call); PROF_START(empty_call); PROF_STOP(empty_call); { PROF_EYE(PE_EMBRACE, _embrace_); { PROF_EYE(PE_EMPTY_CONSTR, _empty_constr_); } } } ProfData::m_empty_call_overhead = prof_data[PE_EMPTY_CALL].TimeAvg(); ProfData::m_empty_constr_overhead = prof_data[PE_EMPTY_CONSTR].TimeAvg(); ProfData::m_embrace_overhead = prof_data[PE_EMBRACE].TimeAvg() + ProfData::ADJUSTMENT - 2 * ProfData::m_empty_constr_overhead; }
ãã¡ããããªããžã§ã¯ãã®ã¹ã³ãŒãã¯åžžã«äžæ¬åŒ§ã§å¶éã§ããŸãã
ããã¹ã
ProfEye::ProfEye(PROF_EYE eye, bool run) { m_eye = eye; m_lost = 0; m_run = false; if ( run ) { { CriticalSection _cs_; prof_data[m_eye].Lock(true); m_up_eye = m_cur_eye; m_cur_eye = this; } Start(); } else m_up_eye = nullptr; }
ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«ã¯äœãå«ããå¿ èŠããããŸããïŒ ããšãã°ãããšãã°ãããã€ãã®å€æ°ãã¢ãããã¯ã«å€æŽããå¿ èŠãããæäœïŒäžèšã®äŸã¯ãŸãã«ãããè¡ããŸãïŒã 1ã€ã®ã¿ã¹ã¯ãèªã¿åããä»ã®ã¿ã¹ã¯ãæžã蟌ã¿ãè¡ãããŸããŸãªãªã¹ãããã®ä»ã®ãã®ã«ã¯ãã¢ãããã¯ã¢ã¯ã»ã¹ãå¿ èŠã«ãªãå ŽåããããŸãã
ããããããã»ã©æçœãªãã®ã¯ãããŸããã ããã¿ã¹ã¯ã§å¢å ããå¥ã®ã¿ã¹ã¯ã§æžå°ããç¹å®ã®ã«ãŠã³ã¿ãŒããããšããŸãã ããã¯éåžžã«ã¢ãããã¯ãªæäœã®ããã§ã
cnt ++;
ããããé«ã¬ãã«èšèªã®ã¬ãã«ã§ã¯ã¢ãããã¯ã§ãã ã¢ã»ã³ãã©ã¬ãã«ã§ã¯ãèªã¿åã-å€æŽ-æžã蟌ã¿æäœã«åå²ãããŸãã
26: cnt++;
0x08004818 6B60 LDR r0,[r4,#0x34]
0x0800481A 1C40 ADDS r0,r0,#1
0x0800481C 6360 STR r0,[r4,#0x34]
å€ïŒå¿ å®åºŠãããšãã°10ïŒãæ¢ã«ã¬ãžã¹ã¿r0ã«å ¥åãããåŸãã¹ã±ãžã¥ãŒã©ãå¶åŸ¡ãå¥ã®ã¿ã¹ã¯ã«è»¢éãããšããŸãã ãŸãã10ã®å€ãã«ãŠã³ããã9ãå ¥åããŠå€ãæžãããŸãã次ã«ãå¶åŸ¡ãçŸåšã®ã¿ã¹ã¯ã«æ»ã£ããšãã«ãå€æ°ã§ã¯ãªããã¬ãžã¹ã¿ãŒr0ã«ãããã®ã«10ãè¿œå ããŸãã 11ã«ãªããŸããã«ãŠã³ã¿ãŒã®å€ãæªãã§ããŸãã
ããã¯ãã®ãããªç¶æ³ããä¿è·ããããã ãã§ãããã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã¯éåžžã«é©ããŠããŸãã
{ CriticalSection cs; cnt++ }
ãã¡ãããNVICã䜿çšãããªãŒããŒãããã念é ã«çœ®ããŠããå¿ èŠããããŸãã3ã€ã§ã¯ãªããã¯ããã«å€ãã®ã¢ã»ã³ãã©ãŒã³ãã³ãã«ãªãããã§ãã
27: CriticalSection cs;
0x0800481A 4668 MOV r0,sp
0x0800481C F7FEFCE8 BL.W _ZN4maks15CriticalSectionC2Ev (0x080031F0)
28: cnt++;
0x08004820 6B60 LDR r0,[r4,#0x34]
0x08004822 1C40 ADDS r0,r0,#1
29: }
0x08004824 6360 STR r0,[r4,#0x34]
0x08004826 4668 MOV r0,sp
0x08004828 F7FEFDA0 BL.W _ZN4maks19InterruptMaskSetterD2Ev (0x0800336C)
ããã¯ã·ã¹ãã ãµãã«ãŒãã³ã®å 容ãã«ãŠã³ããããã®ã§ã¯ãããŸãã...èªè ããã®è€éããæ³åã§ããããã«ãããã«æåã®1ã€ã ãã瀺ããŸãã
0x080031F0 B510 PUSH {r4,lr}
0x080031F2 2150 MOVS r1,#0x50
0x080031F4 F000F8AE BL.W _ZN4maks19InterruptMaskSetterC2Ej (0x08003354)
0x080031F8 4901 LDR r1,[pc,#4] ; @0x08003200
0x080031FA 6001 STR r1,[r0,#0x00]
0x080031FC BD10 POP {r4,pc}
ããªããèŠãããšãã§ããããã«-ããã¯ãŸã æ倧ã®ãã¹ãã§ã¯ãããŸãã...äžæ¹ãããã¯ãŸã æªã®å°ãªãã§ãã é »ç¹ã«åºå ¥ãããã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«å€¢äžã«ãªããªãã§ãã ããã
ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã¯éåžžã«åŒ·åã§ãããæœåšçã«å±éºãªããŒã«ã§ããã¹ã³ãŒãããå€ãããŸã§ãã«ãã¿ã¹ã¯ããªãã«ãªãããã§ãã çæ³çã«ã¯ãæ°è¡ã®ã¿ãããã¯ããå¿ èŠããããŸãã ãµã€ã¯ã«ã®ååšã¯ãé 延æéãå€§å¹ ã«å¢å ãããé¢æ°ãå ¥åããŸã-ããã«ã¯ïŒããã°ã©ããŒããããã®é¢æ°ã«è²»ããããæéãååã«èªèããŠããªãå ŽåïŒããã«ãããçš®ã®æ©åšã§äœæ¥ããããšã¯éåžžã«æœåšçã«å±éºãªããšã§ãã ããã°ã©ãã«ãåšæ³¢æ°10 MHzã®SPIãã¹ã§ã®2ãã€ãã®éä¿¡äžã«ã³ã³ããã¹ãã¹ã€ããããªãããšãä¿èšŒããããšã決å®ãããŸãã 1ãããã®åšæã¯100 nsã§ãã 16ããã-1.6ÎŒs ããã¯å®å šã«åãå ¥ããããçµæã§ãã 次ã®ã¿ã¹ã¯ã§å€±ãããã®ã¯ãã®ã»ã¯ã·ã§ã³ã ãã§ãïŒäžè¬çã«ãããã¯ã¹ã±ãžã¥ãŒã©ãŒã®æéã«å¹æµããŸãïŒã ãããã250ããããã/ç§ã®é床ã§20æåã®UARTæååãä»ããŠéä¿¡ããå Žåã20 * 10 * 4ÎŒs= 0.8ããªç§ããããŸãã ã€ãŸããã¿ã¹ã¯ã¿ã€ã ã¯ã©ã³ã¿ã ã®çµããè¿ãã§ããã»ã¹ãéå§ãããšã次ã®ã¿ã¹ã¯ã®ã¯ã©ã³ã¿ã å šäœã®ã»ãšãã©ããé£ã¹ããããšã«ãªããŸãã
äžè¬ã«ãã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®ã¡ã«ããºã ã¯éåžžã«åŒ·åã§ãããããã䜿çšããããã°ã©ããŒã¯ããªã¢ã«ã¿ã€ã ã§ã·ã¹ãã ã®åäœãä¿èšŒãããã¹ãŠã®è²¬ä»»ãè² ããŸãã
ç¹°ãè¿ããŸãããä»ã®ãªãœãŒã¹ãåŸ æ©ããŠããæ©èœã䜿çšããŠãã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«ããã¿ã¹ã¯ãå®æ¥œæ»ãããªãã§ãã ããã
æãåçŽãªäŸãèããŠã¿ãŸãããã ããŒãã®ç¶æ ãå€æŽããæ¢ç¥ã®ã¿ã¹ã¯ã§ãããã¯ä»ãã®é 延é¢æ°ãå®æçã«åŒã³åºããŸãã
virtual void Execute() { while (true) { GPIOE->BSRR = (1<<nBit); Delay (5); GPIOE->BSRR = (1<<(nBit+16)); Delay (5); } }
éåžžã®èè¡ãäžããŸãïŒ
ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ãè¿œå
ããã¹ã
virtual void Execute() { CriticalSection cs; while (true) { GPIOE->BSRR = (1<<nBit); Delay (5); GPIOE->BSRR = (1<<(nBit+16)); Delay (5); } }
ãŸã£ããç°ãªãä¿¡å·ãåãåããŸã
ãºãŒã ã€ã³-ä¿¡å·åšæãå®å šã«ééã£ãŠããŸã...
äžè¬ã«ãã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã¯åŒ·åãªããŒã«ã§ãããã¢ã¯ã·ã§ã³ïŒãŸãã¯å°ãªããšããå®è¡ãããã¹ãŠã®ã¹ããããå¶åŸ¡ããïŒãèªèããŠããå Žåã«ã®ã¿äœ¿çšããŠãã ããã
ãŠã©ãŒã ã¢ããã¯äœãšãåŒãããããŸããã æãåçŽãªãã®ã¯ãããããã®ã·ãŒãã«åºãã£ãŠããŸãã ããŠãããžãã¯ãããå°ãè€éã«ãªããŸããããå¿ èŠãªããã¹ãã¯å°ãªããªããŸããããã€ããªã»ããã©ã§ãã
ãã€ããªã»ããã©
ãããããããééã§ã¯ã»ããã©ãç©æ¥µçã«äœ¿çšãããŠããŸããã 圌ãã«ã¯2ã€ã®å·ããããŸããïŒäžãããã-åè»ã¯åãããšãã§ããŸãã åæ¢-åè»ã¯åŸ ããªããã°ãªããŸããã ãŸãããã£ã¹ãããã£ã¯ãããäžãäžãããŸããã ãããŠãããã§ã¯ãããã€ãã®ã¿ã¹ã¯ïŒè€æ°ã®ã¿ã¹ã¯ïŒãããŒããåŒã£åŒµã£ãŠïŒãã£ã¹ãããã£ãšããŠåäœïŒãããã€ãã®ã¿ã¹ã¯ïŒè€æ°ã®ã¿ã¹ã¯ïŒããã¹ãéãããã®ãåŸ ã¡ãŸãã åæã«ãä¿çäžã®ã¿ã¹ã¯ã¯ãããã¯ãããŸããã€ãŸããæéã浪費ããŸããã
ãã®ãããªã»ããã©ã¯ãBinarySemaphoreã¯ã©ã¹ã«ãã£ãŠå®è£ ãããŸãã
ã¯ã©ã¹ã³ã³ã¹ãã©ã¯ã¿ãŒã«ã¯ãã»ããã©ã®åæç¶æ ãèšå®ããå¿ é åŒæ°ãå«ãŸããŠããŸã
æ瀺çãªBinarySemaphoreïŒbool is_empty = trueïŒ
ããã«ããã€ããªã»ããã©ã®æ©èœã®ã¿ãæ€èšããŸãïŒäºå®ã¯ããããåçŽãªã»ããã©ã®çžç¶äººã§ããã以äžã§ãã®æ©èœããã¹ãŠæ€èšããããšã§ãïŒã
ã»ããã©ãééããã¿ã¹ã¯ã¯ã WaitïŒïŒé¢æ°ãåŒã³åºãå¿ èŠããããŸãã ãã®é¢æ°ã®åŒæ°ã¯ããªç§åäœã®ã¿ã€ã ã¢ãŠãã§ãã æå®ããæéå ã«ã¿ã¹ã¯ã®ããã¯ã解é€ãããå Žåãé¢æ°ã¯ResultOkãè¿ããŸã ã ãããã£ãŠãã¿ã€ã ã¢ãŠããçºçããå Žå ãé¢æ°ã®çµæã¯ResultTimeoutã«ãªããŸãã é¢æ°ããåæ¢ããããŸã§åŸ æ©ããå¿ èŠãããå Žåã INFINITE_TIMEOUTã«çããã¿ã€ã ã¢ãŠãå€ãæž¡ãå¿ èŠããããŸãã
é¢æ°ããŒãã®ã¿ã€ã ã¢ãŠãå€ã§åŒã³åºããããšãå³åº§ã«å¶åŸ¡ãè¿ããŸãããçµæïŒ ResultOkãŸãã¯ResultTimeout ïŒ ããã»ããã©ãéããŠãããéããŠãããã¯æããã§ãã
å²ã蟌ã¿ããåŒã³åºãããå Žåãã¿ã¹ã¯ã®ãããã¯ã¯äžå¯èœã§ããããããŒã以å€ã®ã¿ã€ã ã¢ãŠãã§ã¯ãé¢æ°ã®çµæã¯ResultErrorInterruptNotSupportedã«ãªããŸãã ãã ããã¿ã€ã ã¢ãŠãããŒãã®å Žåãé¢æ°ã¯å²ã蟌ã¿ããåŒã³åºãããšãã§ããŸãã
é¢æ°ãResultOkã®çµæãè¿ãå Žåãã»ããã©ã¯èªåçã«éããŸãã
æ¢ã«è¿°ã¹ãããã«ãããã€ãã®ã¿ã¹ã¯ã¯ã»ããã©ãäžåºŠã«åŸ ã€ããšãã§ããŸãã ãã®å Žåãæåã«èŠèœãšããããã©ãããŒãªãã®ãã®éžæã¯ã次ã®ããã«å®è¡ãããŸããåŸ æ©ãªã¹ãå ã®ã¿ã¹ã¯ã¯ãåªå é äœã®éé ã§ãåãåªå é äœã§ã WaitïŒïŒé¢æ°ãåŒã³åºããé çªã«ãªããŸãã
ã»ããã©ãéãã«ã¯ã SignalïŒïŒé¢æ°ã䜿çšãããŸãã ã»ããã©ããã§ã«éããŠããå Žåã¯ã ResultErrorInvalidStateã®çµæãè¿ããŸãããã以å€ã®å Žåã¯-ResultOkã è¿ããŸãã MAX_SYSCALL_INTERRUPT_PRIORITYãããé«ãåªå 床ãæã€å²ã蟌ã¿ããé¢æ°ãåŒã³åºãããšã¯ã§ããŸããã
ã»ããã©
æ£çŽãªãšãããç§ã¯ãã®ååãå«ãã§ãã ãã®åæãªããžã§ã¯ãããZavkhozããšåŒã¶æ¹ãæ£ããã§ãããããäŒçµ±ã«åè«ããããšã¯ã§ããŸããã ã»ããã©ãšåŒã°ãããã¹ãŠã®å Žæã§ãRTOS MAXãäŸå€ã§ã¯ãããŸããã åçŽãªã»ããã©ïŒãŸãã¯ãµãã©ã€ãããŒãžã£ïŒãšãã€ããªã»ããã©ã®éãã¯ãã«ãŠã³ãïŒãªãœãŒã¹ããŠã§ã¢ããŠã¹ã«å ¥ããïŒã§ããããšã§ãã å°ãªããšã1ã€ã®ãªãœãŒã¹ããããŸã-ã¿ã¹ã¯ã¯ãã¹ã§ããŸãïŒãªãœãŒã¹ã®æ°ã¯æžå°ããŸãïŒã ãªãœãŒã¹ãªã-ã¿ã¹ã¯ã¯å°ãªããšã1ã€ã衚瀺ããããŸã§åŸ æ©ããŸãã
ãã®ãããªã»ããã©ã¯ããªãœãŒã¹ãå²ãåœãŠãå¿ èŠããããšãã«åœ¹ç«ã¡ãŸãã ããšãã°ãUSBã«ããŒã¿ãåºåããããã«4ã€ã®ãããã¡ãéå§ããŸããïŒãã®ãã¹ã¯ãã€ãã§ã¯åäœããŸãããããã€ãã®é åã§åäœããããããããã¡ã«ããŒã¿ãæºåããã®ãæã䟿å©ã§ãïŒã ãããã£ãŠãäœæ¥ã¿ã¹ã¯ã¯ç©ºããããã¡ãŒããããã©ãããå€å¥ã§ããŸãã ããå Žåã¯ãèšå ¥ããŠãã ããã ããã-USBã§åäœãããã®ãå°ãªããšã1ã€ãéä¿¡ããŠãªãªãŒã¹ãããŸã§åŸ ã¡ãŸãã äžè¬ã«ã1ã€ã§ã¯ãªãè€æ°ã®ãªãœãŒã¹ãã©ããã«å²ãåœãŠãããŠããå Žåããããã®é åžããµãã©ã€ãããŒãžã£ïŒãŸãã¯ãåŸæ¥ã®åœåæ³ã§ã¯ã»ããã©ïŒã«å²ãåœãŠãã®ãæã䟿å©ã§ãã
ãããã£ãŠããã®ãªããžã§ã¯ãã¯Semaphoreã¯ã©ã¹ã§å®è£ ãããŸãã ãã€ããªã»ããã©ãšã®éããèæ ®ããŠãã ããã ãŸãã圌ã¯ãããã«ç°ãªãã³ã³ã¹ãã©ã¯ã¿ãæã£ãŠããŸã
ã»ããã©ïŒsize_t start_countãsize_t max_countïŒ
æåã®ãã©ã¡ãŒã¿ãŒã¯ãæåã«ããã¯ã¹ã«å ¥ãããã®ã®æ°ã2çªç®ã®ãã©ã¡ãŒã¿ãŒ-ãã®ããã¯ã¹ã®å¯žæ³ã§ãã äœæ¥ã®éå§æã«ãªãœãŒã¹ã®å®å šãªäžè¶³ã宣èšããããããè¿œå ããããšã¯äŸ¿å©ã§ãïŒæãåºãããã«ã SignalïŒïŒé¢æ°ãåŒã³åºããŸãïŒã å Žåã«ãã£ãŠã¯ãéã«ãåæãªãœãŒã¹ãæ倧ã«ããŒããããŠãã䜿çšãããããšããããŸãã ããŒãã¹ãã©ãããäžå®å šãªä»ã®ãªãã·ã§ã³ãå¯èœã§ãããèªè ã¯å¿ èŠãªãšãã«ãããæãä»ãã§ãããã
SignalïŒïŒé¢æ°ã¯ããããããªãœãŒã¹ã«ãŠã³ã¿ãŒãå¢ãããŸãã æ倧å€ã«éãããšã ResultErrorInvalidStateãè¿ããŸãã ç¹°ãè¿ãã«ãªããŸãããMAX_SYSCALL_INTERRUPT_PRIORITYããé«ãåªå 床ã®å²ã蟌ã¿ããé¢æ°ãåŒã³åºãããšã¯ã§ããŸããã
ãªãœãŒã¹ã®æ°ããŒãã«çãããªãå Žåãã«ãŠã³ã¿ãŒãæžãããªããã WaitïŒïŒé¢æ°ã¯ã¿ã¹ã¯ãã¹ãããããŸãã ãªãœãŒã¹ããªãå Žåãã¿ã¹ã¯ã¯SignalïŒïŒé¢æ°ãä»ããŠè¿ããããŸã§ãããã¯ãããŸãã ç¹°ãè¿ããŸãããå²ã蟌ã¿ãããã®é¢æ°ã¯ã¿ã€ã ã¢ãŠããªãã§ããåŒã³åºããªãããšãæãåºããŠãã ããã
次ã«ããã€ããªã®å Žåã«æå³ããªããªãé¢æ°ãèããŸãã
GetCurrentCountïŒïŒã¯ããªãœãŒã¹ã«ãŠã³ã¿ãŒã®çŸåšã®å€ãè¿ããŸã
GetMaxCountïŒïŒã¯ãå¯èœãªæ倧ã«ãŠã³ã¿ãŒå€ãè¿ããŸãïŒã»ããã©ãŒãå¥ã®ã¿ã¹ã¯ãäœæããå Žå-ãã®ç¹æ§ãå€å¥ããã®ã«åœ¹ç«ã€å ŽåããããŸãïŒ
ãã¥ãŒããã¯ã¹
ãã®ãªããžã§ã¯ãã®ååã¯ããçžäºæä»çããšããèšèã«ç±æ¥ããŠããŸãã ã€ãŸããã·ã¹ãã ã¯1ã€ã®ãªãœãŒã¹ãžã®çžäºæä»çã¢ã¯ã»ã¹ãæäŸããŸãã ã»ããã©ã§ããã€ãã®ã¿ã¹ã¯ã解決ãåŸ ã£ãŠããŠãä»ã®ã¿ã¹ã¯ãã»ããã©ãéããŠããå Žåããã®å Žåã誰ãããªãœãŒã¹ããã£ããã£ããããšããŸãããã·ã¹ãã èªäœããããæäŸããŸãã
ç°¡åã«èšãã°ããã¥ãŒããã¯ã¹ã®æ¬è³ªã¯ãæåã«èµ·ããã®ã¯èª°ã§ãã-ãããšã¹ãªããããšãããã¬ãŒãºã§èª¬æã§ããŸãã ä¿è·ããããªããžã§ã¯ã-ãã¹ãªãããããããŸãã 倫ã¯ç®ãèŠãŸãã圌ãã«å°ããŸãã-ã·ã¹ãã ã¯ãããããåå²ãããŠããªã䜿çšã®ããã«åœŒã«äžããŸããã 劻ãšæ¯åãå°ãã-圌ãã¯ãããã¯ãããŸããã 倫ãã·ã¹ãã ã«ã¹ãªãããè¿ããšããã«ã劻ã¯ããããåãåããŸããã 圌女ã¯æ»ã£ã-æ¯åãåãåã£ãã 圌ã¯æ»ããŸãã-ãªããžã§ã¯ãã¯ããªãŒç¶æ ã«ãªãã次ã®ãªã¯ãšã¹ã¿ãŒã¯åŸ æ©ããã«åã³ããããåãåããŸãã
ãã€ã¯ãã³ã³ãããŒã©ã§ã¯ããã®æ¹æ³ã§ä¿è·ããå¿ èŠã®ããçŽ æŽããããªãœãŒã¹ã¯ãããã€ãã®ã¿ã¹ã¯ãããŒããä»ããŠæ©èœããããšããŠããå ŽåãããŒãïŒSPIãI2Cãªã©ïŒã§ãã ããã€ãã®ç°æ©çš®ããã€ã¹ãåãç©çãã£ã³ãã«ã«æ¥ç¶ã§ããããšããã§ã«æ€èšããŠããŸããããšãã°ãã¯ã©ã·ãã¯ãã¬ãã§ã¯ã1ã€ã®I2Cãã¹ã«ãããªããã»ããµããªãŒãã£ãªããã»ããµããã¬ããã¹ãããã»ããµããã¥ãŒããŒãååšããå¯èœæ§ããããŸã-ãããã¯ç°ãªãã¿ã¹ã¯ã«ãã£ãŠåŠçãããå¯èœæ§ããããŸãã ãªãBSYãããã®ãªã»ãããåŸ ã€ããã«CPUæéã浪費ããã®ã§ããïŒ ããã«ããšã«ãããè¡çªãå¯èœã§ãã BSYããŒãã®ããããæä»çã«åæãããããã段éçã«å®è¡ãã3ã€ã®ã¿ã¹ã¯ã®äœæ¥ãæ€èšããŸãã
ã芧ã®ãšãããã¹ããã7ã§ã¯ã2ã€ã®ã¿ã¹ã¯ãããã«ãã¹ãå¶åŸ¡ããããšããŠããŸãã ãã¥ãŒããã¯ã¹ã§ä¿è·ãããŠããã°ãããã¯èµ·ãããŸããã§ããã ããã«ãæ¡ä»¶ä»ãã¹ããã1ïŒå®éãããã¯ã¿ã¹ã¯2ãŸãã¯ã¿ã¹ã¯3ã®ããããããããã¯ããã倧éã®ã¹ãããã§ãïŒã§ãã¿ã¹ã¯ã¯æéã浪費ããŠããŸããã Mutexã¯ãã®åé¡ã解決ããŸã-åŸ æ©äžã®ã¿ã¹ã¯ã¯ãã¹ãŠãããã¯ãããŸãã
éçºè ããã¥ãŒããã¯ã¹ã«å€¢äžã«ãªããããŠãã¿ã¹ã¯ããã¥ãŒããã¯ã¹ãæ°åãã£ããã£ããããšãããå ŽåããããŸãã ãã¡ãããã»ãšãã©ã®å Žåãããã¯ãã¹ããããé¢æ°ã§çºçããŸãã é¢æ°1ã¯ãã¥ãŒããã¯ã¹ããã£ããã£ããå¶åŸ¡ã¯é¢æ°2ããé¢æ°3ã«ãããããé¢æ°4ïŒ1幎åã«èšè¿°ïŒã«æž¡ãããåããã¥ãŒããã¯ã¹ããã£ããã£ããããšããŸãã ãã®ãããªå Žåãããããã³ã°ãåé¿ããããã«ãååž°çãªmutexãäœæããå¿ èŠããããŸãã 1ã€ã®ã¿ã¹ã¯ã§ããããç¹°ãè¿ããã£ããã£ã§ããŸãã 圌ãæãããããåæ°ã ã解æŸããããšãéèŠã§ãã Windows OSã§ã¯ããã¹ãŠã®ãã¥ãŒããã¯ã¹ã¯ååž°çã§ããã匱ããã€ã¯ãã³ã³ãããŒã©ãŒã«å¯Ÿãããã®ãããªã¢ãããŒãã¯ããªãœãŒã¹ã®äžåœãªæ¯åºã«ã€ãªãããããããã©ã«ãã§ã¯ããã¥ãŒããã¯ã¹ã¯MAX MAX RTOSã§ååž°çã§ã¯ãããŸããã
Mutexã¯ã©ã¹ã®äž»ãªæ©èœãæ€èšããŠãã ããã ãŸãããã®ã³ã³ã¹ãã©ã¯ã¿
ãã¥ãŒããã¯ã¹ïŒboolrecursive = falseïŒ;
ã³ã³ã¹ãã©ã¯ã¿ãŒåŒæ°ã¯ãã¿ã€ãã決å®ããŸã-ååž°çãã©ããã
LockïŒïŒé¢æ°ã¯ãã¥ãŒããã¯ã¹ããã£ããã£ããŸãã ã¿ã€ã ã¢ãŠãå€ã¯åŒæ°ãšããŠæž¡ãããŸãã ãã€ãã®ããã«ãç¹å¥ãªå€ãèšå®ã§ããŸã-ãŒãã¿ã€ã ã¢ãŠãïŒåŸ æ©ããã«å³æåºåïŒãŸãã¯INFINITE_TIMEOUT ïŒåå©ãŸã§åŸ æ©ïŒã ãã¥ãŒããã¯ã¹ããã£ããã£ã§ããå ŽåãResultOkãè¿ãããŸãã ã¿ã€ã ã¢ãŠããçµéãããšãçµæResultTimeoutãè¿ãããŸãã éååž°çãªãã¥ãŒããã¯ã¹ããã£ããã£ããããšãããšãçµæã¯ResultErrorInvalidStateã«ãªããŸãã ãã¥ãŒããã¯ã¹ã¯å²ã蟌ã¿ã§ãã£ããã£ã§ããŸããã ãããè¡ãããšãããšãçµæã¯ResultErrorInterruptNotSupportedã«ãªããŸãã
ããã¯è§£é€ïŒïŒé¢æ°-ãã¥ãŒããã¯ã¹ã解æŸããŸãã ãããã£ãŠãä¿è·ãããã»ã¯ã·ã§ã³ã®å®è¡ã®æåŸã«åŒã³åºãå¿ èŠããããŸãã
IsLockedïŒïŒé¢æ°ã䜿çšãããšããã¥ãŒããã¯ã¹ããã£ããã£ãããããã£ããã£ããã«è§£æŸãããã決å®ã§ããŸãã ããªãšã³ããã£ããã«ãã¿ã¹ã¯ã§ã¯ãçµæã¯åæãããåã§ãé¢é£æ§ã倱ãå¯èœæ§ããããŸãããå調ãã«ãã¿ã¹ã¯ã§ã¯ããã®æ©èœã圹ç«ã€å ŽåããããŸãã
ä»ãåªå 床ã®ç¶æ¿ãªã©ã«ã€ããŠè©±ã䟡å€ããããŸãã ã·ã¹ãã ã«éåžžã®åªå 床ãæã€ã¿ã¹ã¯Aãé«åªå 床ãæã€Bãããã³é«åªå 床ãæã€CããããšããŸãã ã¿ã¹ã¯BãšCããããã¯ãããAããã®æç¹ã§ãã¥ãŒããã¯ã¹ããã£ããã£ã§ãããšããŸãã ãããã°ã©ãã£ã«ã«ã«æç»ããŠãã¿ã¹ã¯ãäºãã®äžã«é 眮ããŸãïŒåªå 床ãé«ãã»ã©ãå³ã®ã¿ã¹ã¯ãé«ããªããŸãïŒ
ããã§ãã¿ã¹ã¯Cã®ããã¯ã解é€ãããŸããã ãã¡ãããæé«ã®åªå é äœãæã¡ããããå®çŸãå§ããŸããã ãããŠã圌女ãåããã¥ãŒããã¯ã¹ããã£ããã£ãããšããŸãã
ãããããã¥ãŒããã¯ã¹ã¯ã¿ã¹ã¯AãææããŠããŸãïŒ éåžžã®ããžãã¯ã§ã¯ãããžãŒã«ãªããšãã¿ã¹ã¯Cã¯è§£æŸããããŸã§ãããã¯ãããŸãã ãããŠçªç¶ãã¿ã¹ã¯Bã®ããã¯ã解é€ãããŸããïŒä»ã®ãªãœãŒã¹ãåŸ æ©ããã解æŸãããŸããïŒã ãã®åªå 床ã¯Aã®åªå 床ãããé«ããããæ£ç¢ºã«å®è¡ãããŸãïŒã€ãŸããã¿ã¹ã¯BïŒ
äœããããŸããïŒ åªå 床ã®é«ãã¿ã¹ã¯Cã¯ããã¥ãŒããã¯ã¹ã解æŸãããã®ãåŸ ã£ãŠããããå®è¡ã§ããŸããã ããããçŸåšã®ææè ã¯ãmutexã®ææè ãããåªå 床ã®é«ãã¿ã¹ã¯ã«åã£ãŠä»£ããããŸãããåªå 床ã¯äœããæ¯èŒçäžå ¬å¹³ã«ãããã¯ãããã¿ã¹ã¯ã§ãããããåŸ æ©ã§ããŸããã
ãããé²ãããã«ãæææš©ã®æç¹ã§ãã¥ãŒããã¯ã¹ã®ææè ã«ã¯ãçŸåšåœŒãåŸ ã£ãŠããã¿ã¹ã¯ã®æé«ã¿ã¹ã¯ã®åªå 床ãå²ãåœãŠãããŸãã ãã®ãããªã¡ã«ããºã ïŒåªå 床ç¶æ¿ïŒã«ããããã¥ãŒããã¯ã¹ã解æŸãããç¬éãæŠç®ã§ããŸãã
åªå 床ã®ç¶æ¿äžã«ã¿ã¹ã¯Aãéåžžã®åªå 床ãæã€ã¿ã¹ã¯Eãšãçžäºäœçšãããšããã®çžäºäœçšã倱ãããããããã®äºå®ã¯éåžžã«éèŠã§ãã æ®å¿µãªãããããã§ã¯äœãã§ããŸããïŒRTOSã®æšæºã³ã³ã»ããã®ãã¬ãŒã ã¯ãŒã¯å ã§ïŒãããã¯ãããã°ã©ã ãèšèšãããšãã«åçŽã«èæ ®ãããã¹ãã§ãã
ãã¥ãŒããã¯ã¹ã¬ãŒã
å€å žçãªã¢ã«ãŽãªãºã ããã°ã©ãã³ã°ã«ã¯ãä»»æã®ã¢ã«ãŽãªãºã ã§1ã€ã®å ¥åãš1ã€ã®åºåãå«ãŸããŸãã ãããããã®ååã®çä¿¡çãªèŠå®ã¯ãããã¹ãã®äžåœãªè€éåãšèªã¿ãããã®äœäžã«ã€ãªãããããªå®è·µã§ãã 次ã®æ¬äŒŒã³ãŒããèŠãŠã¿ãŸãããã
m_mutex.Lock(); switch (cond) { case 0x00: .... return ResultCode1; case 0x02: .... return ResultCode2; case 0x0a: .... return ResultCode3; case 0x15: .... return ResultCode4; } .... m_mutex.Unlock();
å®éãããã§é¢æ°ãçµäºããåã«ãmutex.UnlockïŒïŒãäœç³»çã«é 眮ããå¿ èŠããããŸãã ãŸãã倧èŠæš¡ãªã¢ã«ãŽãªãºã ã«ã¯ããã®ãããªã»ã¯ã·ã§ã³ãå€æ°ååšããå ŽåããããŸãã ãããŠãããããè¿œå ã§ããŸãã é ããæ©ãããããã°ã©ãã¯ãã¥ãŒããã¯ã¹ãã©ããã§ããã¯è§£é€ããããšãå¿ããããã°ã©ã ã¯ããªãŒãºããŸãã ãããŠããã¯ã人é¡ãå€ç ããªãã£ããšããäºå®ã«ãããããããäžè¬ã«PLOãçºæããç¹ã«ã¯ã©ã¹ã®ãã¹ãã©ã¯ã¿ãçºæããŸããïŒ
ãã¥ãŒããã¯ã¹ã¬ãŒãã¯ããã¹ãã©ã¯ã¿ã䜿çšããããšã ããè¡ããŸãã ã€ã³ã¿ãŒãã§ãŒã¹éšåã®ãã®ã¯ã©ã¹ã«ã¯ãã³ã³ã¹ãã©ã¯ã¿ãŒãããããŸããã ããã°ã©ããŒã¬ã€ããããã®èª¬æãã³ããŒããŸãã
æ瀺çãªMutexGuardïŒMutexãšmutexãbool only_unlock = falseïŒ;
åŒæ°ïŒ
- mutex-mutexãžã®åç §ã
- only_unlock âå€ãtrueã®å Žåãmutexã¯ã³ã³ã¹ãã©ã¯ã¿ãŒã«ãã£ããã£ãããŸããã ãã¥ãŒããã¯ã¹ã¯ãLockïŒïŒã¡ãœããã®æ瀺çãªåŒã³åºãã«ãã£ãŠãã§ã«ãã£ããã£ãããŠããããšãç解ãããŸãã
ãã¥ãŒããã¯ã¹ã¯ã³ã³ã¹ãã©ã¯ã¿ã«æž¡ãããå¿ èŠããããŸãã 圌ã¯æãããããŸãã ãããŠããã¥ãŒããã¯ã¹ã¬ãŒããèŠçããé¢ããç¬éã«åœŒã¯è§£æŸãããŸãã ãããã£ãŠãåã®äŸã¯æ¬¡ã®ããã«æžãæããå¿ èŠããããŸãã
ããã¹ã
{ MutexGuard (m_mutex); switch (cond) { case 0x00: .... return ResultCode1; case 0x02: .... return ResultCode2; case 0x0a: .... return ResultCode3; case 0x15: .... return ResultCode4; } .... }
ã€ãã³ã
ã»ããã©ãšãã¥ãŒããã¯ã¹ã¯éåžžãç¹å®ã®ãªãœãŒã¹ã䜿çšãããšãã«ã¿ã¹ã¯ã®ç«¶åãæé€ããããã«äœ¿çšãããŸãããããã¯ã解é€ããæ¡ä»¶ãã§ãããŸã§ã¿ã¹ã¯ããããã¯ããå¿ èŠãããå ŽåããããŸãã å žåçãªã·ããªãª-å²ã蟌ã¿ãçºçãããã³ãã©ãŒé¢æ°ãé 延åŠçã®åªå 床ã®é«ãã¿ã¹ã¯ã«ä¿¡å·ãéããäœããã®ã¿ã¹ã¯ãå®è¡ããå¿ èŠãããããšãéç¥ããŸãã ã€ãã³ãã䜿çšãããšããã®ã¡ã«ããºã ãå®è£ ã§ããŸãã
åã®æ®µèœãèªãã åŸãã€ãã³ãã¯åã«ã»ããã©ãè€è£œããŠããããã«èŠãããããããŸããã ããããããã¯ããã§ã¯ãããŸããã éããèŠãŠã¿ãŸãããã
æåã®éãïŒã€ãã³ãã¯ããããåŸ ã£ãŠãã人ã«ã®ã¿åœ±é¿ããŸãã çŸæç¹ã§ã€ãã³ãã«åä¿¡è ãããªãå Žåãã©ãã«ãè¡ããŸããã ã€ãã³ãã®çºçåŸããã«ã誰ãããããåŸ ã¡å§ããŸã-ããã¯ãããã¯ãããŸãã ããã¯è§£é€ã¯ã次ã®ã€ãã³ãã§ã®ã¿çºçããŸãã 誰ãæéããªãã£ã-圌ã¯é ããŠããã ç§ãã¡ãæãåºãããã«ãã»ããã©ã¯ãå察ã«ã誰ãããããåŸ ã£ãŠãããã©ããã«ãããããããšã«ããéããŸãã ãããŠãã»ããã©ãæåã«æž¡ããã®ã¯ã¹ããããããŸãã
2çªç®ã®éãã¯ãè€æ°ã®ã¿ã¹ã¯ãã»ããã©ã®ãªãŒãã³ãåŸ æ©ããŠããå Žåããã®ãã¡ã®1ã€ã ããããã¯è§£é€ãããŸãã æ®ãã¯æ¬¡ã®ãªãŒãã³ãåŸ ã¡ãŸãã ã€ãã³ãã¯ããã®çºçãåŸ æ©ããŠããå šå¡ã®ããã¯ã解é€ãããšãã«ã¢ãŒãã«èšå®ã§ããŸãã ã€ãŸããåŸ æ©äžã®ãã¹ãŠã®ã¿ã¹ã¯ã¯ããããã¯ãç¶æ ãããã¢ã¯ãã£ããç¶æ ã®èª°ãã«è»¢éãããæã幞éãªã¿ã¹ã¯ã¯ãå®è¡äžãç¶æ ã«è»¢éãããŸãã
æ®ã-ã€ãã³ãã®ããžãã¯ã¯ããã€ããªã»ããã©ã®ããžãã¯ã«äŒŒãŠããŸãã
ã¯ã©ã¹ã³ã³ã¹ãã©ã¯ã¿ãŒïŒ
ã€ãã³ãïŒbool broadcast = trueïŒ;
ãããŒããã£ã¹ããã©ã¡ãŒã¿ã¯ãã€ãã³ãã®éç¥ãåŸ ã£ãŠããåä¿¡è ã«éç¥ããã«ãŒã«ãèšå®ããŸãã true âãããåŸ ã£ãŠãããã¹ãŠã®ã¿ã¹ã¯ãããã¯è§£é€ãããfalse â 1ã€ã®ã¿ã¹ã¯ã®ã¿ãããã¯è§£é€ãããŸããããã¯ããã®ã€ãã³ããåŸ ã£ãŠãããã¥ãŒã®æåã®ã¿ã¹ã¯ã§ãã
RaiseïŒïŒé¢æ°ã¯ã€ãã³ãããã£ã¹ãããããŸãã MAX_SYSCALL_INTERRUPT_PRIORITYãããé«ãåªå 床ãæã€å²ã蟌ã¿ããåŒã³åºãããšã¯ã§ããŸããã
WaitïŒïŒé¢æ°ã¯ã以åã«æ€èšãããåæãªããžã§ã¯ããšåãååã®é¢æ°ã«ãã£ãŠãã§ã«ããç¥ãããŠããŸãããŸããã¿ã€ã ã¢ãŠãåŒæ°ããããŸããåæ§ã«ãã¿ã€ã ã¢ãŠãã¯ãŒããŸãã¯INFINITE_TIMEOUTã«ã§ããŸãããã®é¢æ°ã¯ãå²ã蟌ã¿ããåŒã³åºãããšã¯ã§ããŸããã
åæãªããžã§ã¯ãã®äœ¿çšäŸ
æ®å¿µãªãããåæãªããžã§ã¯ãã䜿çšãããåçŽã§çŸããäŸãäœãããšã¯äžå¯èœã§ããã·ã³ãã«ãªãã®ã¯ãã¹ãŠãé¢æ°åŒã³åºãã®äŸã®ãã¢ã³ã¹ãã¬ãŒã·ã§ã³ã«ãªããŸããå®éã«é©çšã§ãããã®ã¯ãããŸãã«ãå€ãã®ããªã¥ãŒã ãå æããŸãããããã説æããã«ã¯é·ãæéãããããèªè ã¯2ããŒãžç®ã®ã¹ã¬ããã倱ããä»ã®28ã®ããŒãžã¯èª°ã«ãèªãŸããŸããããããã£ãŠããã®ãããªäœåãæžãããšã¯æ§ããŸãã
èšç»ããã第3éšã§ã¯ãCNCãã·ã³çšã®å€§èŠæš¡ããã°ã©ã ã®é©å¿ã®èª¬æã衚瀺ãããŸãããã®ããã®äŸãæ®ããŸãããããŠãç·Žç¿ãåæãã人ã«ã¯ãOSã®åäœãã¹ãããå§ãã§ããŸãããããã¯ããã£ã¬ã¯ããª... \ maksRTOS \ Source \ Tests \ Unit testsã«ãããŸãããã¹ããããŠãããã£ã¬ã¯ããªã®ãªã¹ãã¯æ¬¡ã®ãšããã§ã
ãBinarySemaphore
Event
MessageQueue
Mutex
MutexGuard
ã¹ã±ãžã¥ãŒã©
ã»ããã©
ãã¹ããã©ã¯ãã£ã¹ã®äŸã¯æãã€ãã«ããã§ããããªãã®ç 究ã楜ããã§ãã ããïŒãã ãããŸããªèªè ã¯ãã¹ãã®ç¬¬1ååæã®çµããã«å°éãããšã®æèŠããããŸãïŒã