Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
HbEngine.cpp@38:24ee50452755, 2019-01-18 (annotated)
- Committer:
- MasashiNomura
- Date:
- Fri Jan 18 11:52:00 2019 +0000
- Revision:
- 38:24ee50452755
- Parent:
- 36:2cc739c7e4cb
- Child:
- 39:1b76f7df8804
20190118 Modify for 45inc. check User SW (include analogIn)
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| takeru0x1103 | 17:f9610f3cfa1b | 1 | #include "HbEngine.h" | 
| takeru0x1103 | 17:f9610f3cfa1b | 2 | #include "fpga.h" | 
| takeru0x1103 | 17:f9610f3cfa1b | 3 | //====================================================== | 
| takeru0x1103 | 17:f9610f3cfa1b | 4 | //コンストラクタ | 
| takeru0x1103 | 17:f9610f3cfa1b | 5 | //====================================================== | 
| takeru0x1103 | 17:f9610f3cfa1b | 6 | HbEngine::HbEngine(UCHAR iID){ | 
| takeru0x1103 | 17:f9610f3cfa1b | 7 | id = iID; | 
| MasashiNomura | 38:24ee50452755 | 8 | hvAxl = 0; | 
| MasashiNomura | 38:24ee50452755 | 9 | bSetHvAxl = 0; | 
| takeru0x1103 | 17:f9610f3cfa1b | 10 | } | 
| takeru0x1103 | 17:f9610f3cfa1b | 11 | |
| takeru0x1103 | 17:f9610f3cfa1b | 12 | |
| takeru0x1103 | 17:f9610f3cfa1b | 13 | UINT16 HbEngine::getRpm(){ | 
| takeru0x1103 | 17:f9610f3cfa1b | 14 | UINT16 rpm; | 
| takeru0x1103 | 17:f9610f3cfa1b | 15 | //エンジン回転数読み出し | 
| MasashiNomura | 38:24ee50452755 | 16 | //if(id<0||id>1)return 0;//現在の使用状況では不要 | 
| MasashiNomura | 38:24ee50452755 | 17 | if(id == 0){ | 
| MasashiNomura | 38:24ee50452755 | 18 | rpm = fpgaGetRpm(true);//前 | 
| MasashiNomura | 38:24ee50452755 | 19 | }else/*if(id == 1)*/{ | 
| MasashiNomura | 38:24ee50452755 | 20 | rpm = fpgaGetRpm(false);//後 | 
| MasashiNomura | 38:24ee50452755 | 21 | } | 
| takeru0x1103 | 17:f9610f3cfa1b | 22 | return rpm; | 
| takeru0x1103 | 17:f9610f3cfa1b | 23 | } | 
| takeru0x1103 | 17:f9610f3cfa1b | 24 | |
| takeru0x1103 | 17:f9610f3cfa1b | 25 | //アクセル設定 | 
| MasashiNomura | 35:3779201b4c73 | 26 | void HbEngine::setAccel(UINT16 iVal){ | 
| takeru0x1103 | 17:f9610f3cfa1b | 27 | fpgaEngine(id,iVal); | 
| MasashiNomura | 23:79e20be4bc5b | 28 | } | 
| MasashiNomura | 23:79e20be4bc5b | 29 | |
| MasashiNomura | 36:2cc739c7e4cb | 30 | void HbEngine::setHoverAccel(INT16 val){ | 
| MasashiNomura | 36:2cc739c7e4cb | 31 | hvAxl = val; | 
| MasashiNomura | 36:2cc739c7e4cb | 32 | bSetHvAxl = true; | 
| MasashiNomura | 36:2cc739c7e4cb | 33 | } | 
| MasashiNomura | 36:2cc739c7e4cb | 34 | |
| MasashiNomura | 36:2cc739c7e4cb | 35 | void HbEngine::clearHoverAccel(){ | 
| MasashiNomura | 36:2cc739c7e4cb | 36 | hvAxl = 0; | 
| MasashiNomura | 36:2cc739c7e4cb | 37 | bSetHvAxl = false; | 
| MasashiNomura | 36:2cc739c7e4cb | 38 | } | 
| MasashiNomura | 36:2cc739c7e4cb | 39 | |
| MasashiNomura | 38:24ee50452755 | 40 | INT16 HbEngine::getHoverAccelVal(){ | 
| MasashiNomura | 38:24ee50452755 | 41 | return hvAxl; | 
| MasashiNomura | 38:24ee50452755 | 42 | } | 
| MasashiNomura | 38:24ee50452755 | 43 | |
| MasashiNomura | 36:2cc739c7e4cb | 44 | bool HbEngine::chkSetHoverAccel(){ | 
| MasashiNomura | 36:2cc739c7e4cb | 45 | return bSetHvAxl; | 
| MasashiNomura | 36:2cc739c7e4cb | 46 | } | 
| MasashiNomura | 36:2cc739c7e4cb | 47 | |
| MasashiNomura | 23:79e20be4bc5b | 48 | bool HbEngine::chkOverIDLECycle(){ | 
| MasashiNomura | 23:79e20be4bc5b | 49 | return rpm > IDLE_HI; | 
| MasashiNomura | 23:79e20be4bc5b | 50 | } | 
| MasashiNomura | 23:79e20be4bc5b | 51 | |
| MasashiNomura | 23:79e20be4bc5b | 52 | bool HbEngine::chkInRangeIDLE(){ | 
| MasashiNomura | 23:79e20be4bc5b | 53 | return rpm > IDLE_LOW && rpm < IDLE_HI; | 
| MasashiNomura | 23:79e20be4bc5b | 54 | } |