teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Committer:
MasashiNomura
Date:
Wed Jan 16 10:51:07 2019 +0000
Revision:
36:2cc739c7e4cb
Parent:
35:3779201b4c73
Child:
38:24ee50452755
2019/01/16 modify for 45inc Alfa HB / no debug, no checking

Who changed what in which revision?

UserRevisionLine numberNew 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;
takeru0x1103 17:f9610f3cfa1b 8 }
takeru0x1103 17:f9610f3cfa1b 9
takeru0x1103 17:f9610f3cfa1b 10
takeru0x1103 17:f9610f3cfa1b 11 UINT16 HbEngine::getRpm(){
takeru0x1103 17:f9610f3cfa1b 12 UINT16 rpm;
takeru0x1103 17:f9610f3cfa1b 13 //エンジン回転数読み出し
takeru0x1103 17:f9610f3cfa1b 14 rpm = fpgaGetRpm(true);//前
takeru0x1103 17:f9610f3cfa1b 15 return rpm;
takeru0x1103 17:f9610f3cfa1b 16 }
takeru0x1103 17:f9610f3cfa1b 17
takeru0x1103 17:f9610f3cfa1b 18 //アクセル設定
MasashiNomura 35:3779201b4c73 19 void HbEngine::setAccel(UINT16 iVal){
takeru0x1103 17:f9610f3cfa1b 20 fpgaEngine(id,iVal);
MasashiNomura 23:79e20be4bc5b 21 }
MasashiNomura 23:79e20be4bc5b 22
MasashiNomura 36:2cc739c7e4cb 23 void HbEngine::setHoverAccel(INT16 val){
MasashiNomura 36:2cc739c7e4cb 24 hvAxl = val;
MasashiNomura 36:2cc739c7e4cb 25 bSetHvAxl = true;
MasashiNomura 36:2cc739c7e4cb 26 }
MasashiNomura 36:2cc739c7e4cb 27
MasashiNomura 36:2cc739c7e4cb 28 void HbEngine::clearHoverAccel(){
MasashiNomura 36:2cc739c7e4cb 29 hvAxl = 0;
MasashiNomura 36:2cc739c7e4cb 30 bSetHvAxl = false;
MasashiNomura 36:2cc739c7e4cb 31 }
MasashiNomura 36:2cc739c7e4cb 32
MasashiNomura 36:2cc739c7e4cb 33 bool HbEngine::chkSetHoverAccel(){
MasashiNomura 36:2cc739c7e4cb 34 return bSetHvAxl;
MasashiNomura 36:2cc739c7e4cb 35 }
MasashiNomura 36:2cc739c7e4cb 36
MasashiNomura 23:79e20be4bc5b 37 bool HbEngine::chkOverIDLECycle(){
MasashiNomura 23:79e20be4bc5b 38 return rpm > IDLE_HI;
MasashiNomura 23:79e20be4bc5b 39 }
MasashiNomura 23:79e20be4bc5b 40
MasashiNomura 23:79e20be4bc5b 41 bool HbEngine::chkInRangeIDLE(){
MasashiNomura 23:79e20be4bc5b 42 return rpm > IDLE_LOW && rpm < IDLE_HI;
MasashiNomura 23:79e20be4bc5b 43 }