[HD Mini General] munjeni:
I have idea for level compute. It is bassed on voltage and level_table. What you think?

buffer->level = level_table[ buffer->batt_vol ];

Array
(
[3420] => 0
[3421] => 0
[3422] => 0
[3423] => 1
[3424] => 1
[3425] => 1
[3426] => 1
[3427] => 1
[3428] => 1
[3429] => 1
[3430] => 1
[3431] => 2
[3432] => 2
[3433] => 2
[3434] => 2
[3435] => 2
[3436] => 2
[3437] => 2
[3438] => 2
[3439] => 3
[3440] => 3
[3441] => 3
[3442] => 3
[3443] => 3
[3444] => 3
[3445] => 3
[3446] => 3
[3447] => 4
[3448] => 4
[3449] => 4
[3450] => 4
[3451] => 4
[3452] => 4
[3453] => 4
[3454] => 4
[3455] => 5
[3456] => 5
[3457] => 5
[3458] => 5
[3459] => 5
[3460] => 5
[3461] => 5
[3462] => 6
[3463] => 6
[3464] => 6
[3465] => 6
[3466] => 6
[3467] => 6
[3468] => 6
[3469] => 6
[3470] => 7
[3471] => 7
[3472] => 7
[3473] => 7
[3474] => 7
[3475] => 7
[3476] => 7
[3477] => 7
[3478] => 8
[3479] => 8
[3480] => 8
[3481] => 8
[3482] => 8
[3483] => 8
[3484] => 8
[3485] => 8
[3486] => 9
[3487] => 9
[3488] => 9
[3489] => 9
[3490] => 9
[3491] => 9
[3492] => 9
[3493] => 9
[3494] => 10
[3495] => 10
[3496] => 10
[3497] => 10
[3498] => 10
[3499] => 10
[3500] => 10
[3501] => 11
[3502] => 11
[3503] => 11
[3504] => 11
[3505] => 11
[3506] => 11
[3507] => 11
[3508] => 11
[3509] => 12
[3510] => 12
[3511] => 12
[3512] => 12
[3513] => 12
[3514] => 12
[3515] => 12
[3516] => 12
[3517] => 13
[3518] => 13
[3519] => 13
[3520] => 13
[3521] => 13
[3522] => 13
[3523] => 13
[3524] => 13
[3525] => 14
[3526] => 14
[3527] => 14
[3528] => 14
[3529] => 14
[3530] => 14
[3531] => 14
[3532] => 14
[3533] => 15
[3534] => 15
[3535] => 15
[3536] => 15
[3537] => 15
[3538] => 15
[3539] => 15
[3540] => 16
[3541] => 16
[3542] => 16
[3543] => 16
[3544] => 16
[3545] => 16
[3546] => 16
[3547] => 16
[3548] => 17
[3549] => 17
[3550] => 17
[3551] => 17
[3552] => 17
[3553] => 17
[3554] => 17
[3555] => 17
[3556] => 18
[3557] => 18
[3558] => 18
[3559] => 18
[3560] => 18
[3561] => 18
[3562] => 18
[3563] => 18
[3564] => 19
[3565] => 19
[3566] => 19
[3567] => 19
[3568] => 19
[3569] => 19
[3570] => 19
[3571] => 19
[3572] => 20
[3573] => 20
[3574] => 20
[3575] => 20
[3576] => 20
[3577] => 20
[3578] => 20
[3579] => 21
[3580] => 21
[3581] => 21
[3582] => 21
[3583] => 21
[3584] => 21
[3585] => 21
[3586] => 21
[3587] => 22
[3588] => 22
[3589] => 22
[3590] => 22
[3591] => 22
[3592] => 22
[3593] => 22
[3594] => 22
[3595] => 23
[3596] => 23
[3597] => 23
[3598] => 23
[3599] => 23
[3600] => 23
[3601] => 23
[3602] => 23
[3603] => 24
[3604] => 24
[3605] => 24
[3606] => 24
[3607] => 24
[3608] => 24
[3609] => 24
[3610] => 24
[3611] => 25
[3612] => 25
[3613] => 25
[3614] => 25
[3615] => 25
[3616] => 25
[3617] => 25
[3618] => 26
[3619] => 26
[3620] => 26
[3621] => 26
[3622] => 26
[3623] => 26
[3624] => 26
[3625] => 26
[3626] => 27
[3627] => 27
[3628] => 27
[3629] => 27
[3630] => 27
[3631] => 27
[3632] => 27
[3633] => 27
[3634] => 28
[3635] => 28
[3636] => 28
[3637] => 28
[3638] => 28
[3639] => 28
[3640] => 28
[3641] => 28
[3642] => 29
[3643] => 29
[3644] => 29
[3645] => 29
[3646] => 29
[3647] => 29
[3648] => 29
[3649] => 29
[3650] => 30
[3651] => 30
[3652] => 30
[3653] => 30
[3654] => 30
[3655] => 30
[3656] => 30
[3657] => 31
[3658] => 31
[3659] => 31
[3660] => 31
[3661] => 31
[3662] => 31
[3663] => 31
[3664] => 31
[3665] => 32
[3666] => 32
[3667] => 32
[3668] => 32
[3669] => 32
[3670] => 32
[3671] => 32
[3672] => 32
[3673] => 33
[3674] => 33
[3675] => 33
[3676] => 33
[3677] => 33
[3678] => 33
[3679] => 33
[3680] => 33
[3681] => 34
[3682] => 34
[3683] => 34
[3684] => 34
[3685] => 34
[3686] => 34
[3687] => 34
[3688] => 34
[3689] => 35
[3690] => 35
[3691] => 35
[3692] => 35
[3693] => 35
[3694] => 35
[3695] => 35
[3696] => 36
[3697] => 36
[3698] => 36
[3699] => 36
[3700] => 36
[3701] => 36
[3702] => 36
[3703] => 36
[3704] => 37
[3705] => 37
[3706] => 37
[3707] => 37
[3708] => 37
[3709] => 37
[3710] => 37
[3711] => 37
[3712] => 38
[3713] => 38
[3714] => 38
[3715] => 38
[3716] => 38
[3717] => 38
[3718] => 38
[3719] => 38
[3720] => 39
[3721] => 39
[3722] => 39
[3723] => 39
[3724] => 39
[3725] => 39
[3726] => 39
[3727] => 39
[3728] => 40
[3729] => 40
[3730] => 40
[3731] => 40
[3732] => 40
[3733] => 40
[3734] => 40
[3735] => 41
[3736] => 41
[3737] => 41
[3738] => 41
[3739] => 41
[3740] => 41
[3741] => 41
[3742] => 41
[3743] => 42
[3744] => 42
[3745] => 42
[3746] => 42
[3747] => 42
[3748] => 42
[3749] => 42
[3750] => 42
[3751] => 43
[3752] => 43
[3753] => 43
[3754] => 43
[3755] => 43
[3756] => 43
[3757] => 43
[3758] => 43
[3759] => 44
[3760] => 44
[3761] => 44
[3762] => 44
[3763] => 44
[3764] => 44
[3765] => 44
[3766] => 44
[3767] => 45
[3768] => 45
[3769] => 45
[3770] => 45
[3771] => 45
[3772] => 45
[3773] => 45
[3774] => 46
[3775] => 46
[3776] => 46
[3777] => 46
[3778] => 46
[3779] => 46
[3780] => 46
[3781] => 46
[3782] => 47
[3783] => 47
[3784] => 47
[3785] => 47
[3786] => 47
[3787] => 47
[3788] => 47
[3789] => 47
[3790] => 48
[3791] => 48
[3792] => 48
[3793] => 48
[3794] => 48
[3795] => 48
[3796] => 48
[3797] => 48
[3798] => 49
[3799] => 49
[3800] => 49
[3801] => 49
[3802] => 49
[3803] => 49
[3804] => 49
[3805] => 49
[3806] => 50
[3807] => 50
[3808] => 50
[3809] => 50
[3810] => 50
[3811] => 50
[3812] => 50
[3813] => 51
[3814] => 51
[3815] => 51
[3816] => 51
[3817] => 51
[3818] => 51
[3819] => 51
[3820] => 51
[3821] => 52
[3822] => 52
[3823] => 52
[3824] => 52
[3825] => 52
[3826] => 52
[3827] => 52
[3828] => 52
[3829] => 53
[3830] => 53
[3831] => 53
[3832] => 53
[3833] => 53
[3834] => 53
[3835] => 53
[3836] => 53
[3837] => 54
[3838] => 54
[3839] => 54
[3840] => 54
[3841] => 54
[3842] => 54
[3843] => 54
[3844] => 54
[3845] => 55
[3846] => 55
[3847] => 55
[3848] => 55
[3849] => 55
[3850] => 55
[3851] => 55
[3852] => 56
[3853] => 56
[3854] => 56
[3855] => 56
[3856] => 56
[3857] => 56
[3858] => 56
[3859] => 56
[3860] => 57
[3861] => 57
[3862] => 57
[3863] => 57
[3864] => 57
[3865] => 57
[3866] => 57
[3867] => 57
[3868] => 58
[3869] => 58
[3870] => 58
[3871] => 58
[3872] => 58
[3873] => 58
[3874] => 58
[3875] => 58
[3876] => 59
[3877] => 59
[3878] => 59
[3879] => 59
[3880] => 59
[3881] => 59
[3882] => 59
[3883] => 59
[3884] => 60
[3885] => 60
[3886] => 60
[3887] => 60
[3888] => 60
[3889] => 60
[3890] => 60
[3891] => 61
[3892] => 61
[3893] => 61
[3894] => 61
[3895] => 61
[3896] => 61
[3897] => 61
[3898] => 61
[3899] => 62
[3900] => 62
[3901] => 62
[3902] => 62
[3903] => 62
[3904] => 62
[3905] => 62
[3906] => 62
[3907] => 63
[3908] => 63
[3909] => 63
[3910] => 63
[3911] => 63
[3912] => 63
[3913] => 63
[3914] => 63
[3915] => 64
[3916] => 64
[3917] => 64
[3918] => 64
[3919] => 64
[3920] => 64
[3921] => 64
[3922] => 64
[3923] => 65
[3924] => 65
[3925] => 65
[3926] => 65
[3927] => 65
[3928] => 65
[3929] => 65
[3930] => 66
[3931] => 66
[3932] => 66
[3933] => 66
[3934] => 66
[3935] => 66
[3936] => 66
[3937] => 66
[3938] => 67
[3939] => 67
[3940] => 67
[3941] => 67
[3942] => 67
[3943] => 67
[3944] => 67
[3945] => 67
[3946] => 68
[3947] => 68
[3948] => 68
[3949] => 68
[3950] => 68
[3951] => 68
[3952] => 68
[3953] => 68
[3954] => 69
[3955] => 69
[3956] => 69
[3957] => 69
[3958] => 69
[3959] => 69
[3960] => 69
[3961] => 69
[3962] => 70
[3963] => 70
[3964] => 70
[3965] => 70
[3966] => 70
[3967] => 70
[3968] => 70
[3969] => 71
[3970] => 71
[3971] => 71
[3972] => 71
[3973] => 71
[3974] => 71
[3975] => 71
[3976] => 71
[3977] => 72
[3978] => 72
[3979] => 72
[3980] => 72
[3981] => 72
[3982] => 72
[3983] => 72
[3984] => 72
[3985] => 73
[3986] => 73
[3987] => 73
[3988] => 73
[3989] => 73
[3990] => 73
[3991] => 73
[3992] => 73
[3993] => 74
[3994] => 74
[3995] => 74
[3996] => 74
[3997] => 74
[3998] => 74
[3999] => 74
[4000] => 74
[4001] => 75
[4002] => 75
[4003] => 75
[4004] => 75
[4005] => 75
[4006] => 75
[4007] => 75
[4008] => 76
[4009] => 76
[4010] => 76
[4011] => 76
[4012] => 76
[4013] => 76
[4014] => 76
[4015] => 76
[4016] => 77
[4017] => 77
[4018] => 77
[4019] => 77
[4020] => 77
[4021] => 77
[4022] => 77
[4023] => 77
[4024] => 78
[4025] => 78
[4026] => 78
[4027] => 78
[4028] => 78
[4029] => 78
[4030] => 78
[4031] => 78
[4032] => 79
[4033] => 79
[4034] => 79
[4035] => 79
[4036] => 79
[4037] => 79
[4038] => 79
[4039] => 79
[4040] => 80
[4041] => 80
[4042] => 80
[4043] => 80
[4044] => 80
[4045] => 80
[4046] => 80
[4047] => 81
[4048] => 81
[4049] => 81
[4050] => 81
[4051] => 81
[4052] => 81
[4053] => 81
[4054] => 81
[4055] => 82
[4056] => 82
[4057] => 82
[4058] => 82
[4059] => 82
[4060] => 82
[4061] => 82
[4062] => 82
[4063] => 83
[4064] => 83
[4065] => 83
[4066] => 83
[4067] => 83
[4068] => 83
[4069] => 83
[4070] => 83
[4071] => 84
[4072] => 84
[4073] => 84
[4074] => 84
[4075] => 84
[4076] => 84
[4077] => 84
[4078] => 84
[4079] => 85
[4080] => 85
[4081] => 85
[4082] => 85
[4083] => 85
[4084] => 85
[4085] => 85
[4086] => 86
[4087] => 86
[4088] => 86
[4089] => 86
[4090] => 86
[4091] => 86
[4092] => 86
[4093] => 86
[4094] => 87
[4095] => 87
[4096] => 87
[4097] => 87
[4098] => 87
[4099] => 87
[4100] => 87
[4101] => 87
[4102] => 88
[4103] => 88
[4104] => 88
[4105] => 88
[4106] => 88
[4107] => 88
[4108] => 88
[4109] => 88
[4110] => 89
[4111] => 89
[4112] => 89
[4113] => 89
[4114] => 89
[4115] => 89
[4116] => 89
[4117] => 89
[4118] => 90
[4119] => 90
[4120] => 90
[4121] => 90
[4122] => 90
[4123] => 90
[4124] => 90
[4125] => 91
[4126] => 91
[4127] => 91
[4128] => 91
[4129] => 91
[4130] => 91
[4131] => 91
[4132] => 91
[4133] => 92
[4134] => 92
[4135] => 92
[4136] => 92
[4137] => 92
[4138] => 92
[4139] => 92
[4140] => 92
[4141] => 93
[4142] => 93
[4143] => 93
[4144] => 93
[4145] => 93
[4146] => 93
[4147] => 93
[4148] => 93
[4149] => 94
[4150] => 94
[4151] => 94
[4152] => 94
[4153] => 94
[4154] => 94
[4155] => 94
[4156] => 94
[4157] => 95
[4158] => 95
[4159] => 95
[4160] => 95
[4161] => 95
[4162] => 95
[4163] => 95
[4164] => 96
[4165] => 96
[4166] => 96
[4167] => 96
[4168] => 96
[4169] => 96
[4170] => 96
[4171] => 96
[4172] => 97
[4173] => 97
[4174] => 97
[4175] => 97
[4176] => 97
[4177] => 97
[4178] => 97
[4179] => 97
[4180] => 98
[4181] => 98
[4182] => 98
[4183] => 98
[4184] => 98
[4185] => 98
[4186] => 98
[4187] => 98
[4188] => 99
[4189] => 99
[4190] => 99
[4191] => 99
[4192] => 99
[4193] => 99
[4194] => 99
[4195] => 99
[4196] => 100
[4197] => 100
[4198] => 100
[4199] => 100
[4200] => 100
)