refine codes.
This commit is contained in:
parent
6a80e9415f
commit
98f07e1def
@ -834,25 +834,7 @@ void Uart::DealWave() {
|
||||
float Uart::Calcoe(int ran, int iChannel, std::string &product, int range) {
|
||||
float coe = 0.0f;
|
||||
if (product == "01") {
|
||||
switch (ran) {
|
||||
case 0: {
|
||||
range = 8;
|
||||
coe = 8 * 1.0f / 32767;
|
||||
} break;
|
||||
case 1: {
|
||||
range = 16;
|
||||
coe = 16 * 1.0f / 32767;
|
||||
} break;
|
||||
case 2: {
|
||||
range = 32;
|
||||
coe = 32 * 1.0f / 32767;
|
||||
} break;
|
||||
case 3: {
|
||||
range = 64;
|
||||
coe = 64 * 1.0f / 32767;
|
||||
} break;
|
||||
}
|
||||
|
||||
coe = pow(2, ran) * 8.0f / 32767;
|
||||
} else if (product == "02") {
|
||||
if (iChannel == WAVE_X || iChannel == WAVE_Y) {
|
||||
coe = 0.00048828125f;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user