|
@@ -188,7 +188,7 @@ void fsensor_init(void)
|
|
|
{
|
|
|
#ifdef PAT9125
|
|
|
uint8_t pat9125 = pat9125_init();
|
|
|
- printf_P(PSTR("PAT9125_init:%hhu\n"), pat9125);
|
|
|
+ printf_P(PSTR("PAT9125_init:%u\n"), pat9125);
|
|
|
#endif //PAT9125
|
|
|
uint8_t fsensor_enabled = eeprom_read_byte((uint8_t*)EEPROM_FSENSOR);
|
|
|
fsensor_autoload_enabled=eeprom_read_byte((uint8_t*)EEPROM_FSENS_AUTOLOAD_ENABLED);
|
|
@@ -237,7 +237,7 @@ bool fsensor_enable(bool bUpdateEEPROM)
|
|
|
|
|
|
if (mmu_enabled == false) { //filament sensor is pat9125, enable only if it is working
|
|
|
uint8_t pat9125 = pat9125_init();
|
|
|
- printf_P(PSTR("PAT9125_init:%hhu\n"), pat9125);
|
|
|
+ printf_P(PSTR("PAT9125_init:%u\n"), pat9125);
|
|
|
if (pat9125)
|
|
|
fsensor_not_responding = false;
|
|
|
else
|
|
@@ -435,8 +435,8 @@ void fsensor_oq_meassure_stop(void)
|
|
|
{
|
|
|
if (!fsensor_enabled) return;
|
|
|
if (!fsensor_oq_meassure_enabled) return;
|
|
|
- printf_P(PSTR("fsensor_oq_meassure_stop, %hhu samples\n"), fsensor_oq_samples);
|
|
|
- printf_P(_N(" st_sum=%u yd_sum=%u er_sum=%u er_max=%hhu\n"), fsensor_oq_st_sum, fsensor_oq_yd_sum, fsensor_oq_er_sum, fsensor_oq_er_max);
|
|
|
+ printf_P(PSTR("fsensor_oq_meassure_stop, %u samples\n"), fsensor_oq_samples);
|
|
|
+ printf_P(_N(" st_sum=%u yd_sum=%u er_sum=%u er_max=%u\n"), fsensor_oq_st_sum, fsensor_oq_yd_sum, fsensor_oq_er_sum, fsensor_oq_er_max);
|
|
|
printf_P(_N(" yd_min=%u yd_max=%u yd_avg=%u sh_avg=%u\n"), fsensor_oq_yd_min, fsensor_oq_yd_max, (uint16_t)((uint32_t)fsensor_oq_yd_sum * fsensor_chunk_len / fsensor_oq_st_sum), (uint16_t)(fsensor_oq_sh_sum / fsensor_oq_samples));
|
|
|
fsensor_oq_meassure = false;
|
|
|
}
|
|
@@ -453,10 +453,10 @@ bool fsensor_oq_result(void)
|
|
|
bool res_er_sum = (fsensor_oq_er_sum <= FSENSOR_OQ_MAX_ES);
|
|
|
printf_P(_N(" er_sum = %u %S\n"), fsensor_oq_er_sum, (res_er_sum?_OK:_NG));
|
|
|
bool res_er_max = (fsensor_oq_er_max <= FSENSOR_OQ_MAX_EM);
|
|
|
- printf_P(_N(" er_max = %hhu %S\n"), fsensor_oq_er_max, (res_er_max?_OK:_NG));
|
|
|
+ printf_P(_N(" er_max = %u %S\n"), fsensor_oq_er_max, (res_er_max?_OK:_NG));
|
|
|
uint8_t yd_avg = ((uint32_t)fsensor_oq_yd_sum * fsensor_chunk_len / fsensor_oq_st_sum);
|
|
|
bool res_yd_avg = (yd_avg >= FSENSOR_OQ_MIN_YD) && (yd_avg <= FSENSOR_OQ_MAX_YD);
|
|
|
- printf_P(_N(" yd_avg = %hhu %S\n"), yd_avg, (res_yd_avg?_OK:_NG));
|
|
|
+ printf_P(_N(" yd_avg = %u %S\n"), yd_avg, (res_yd_avg?_OK:_NG));
|
|
|
bool res_yd_max = (fsensor_oq_yd_max <= (yd_avg * FSENSOR_OQ_MAX_PD));
|
|
|
printf_P(_N(" yd_max = %u %S\n"), fsensor_oq_yd_max, (res_yd_max?_OK:_NG));
|
|
|
bool res_yd_min = (fsensor_oq_yd_min >= (yd_avg / FSENSOR_OQ_MAX_ND));
|
|
@@ -472,7 +472,7 @@ bool fsensor_oq_result(void)
|
|
|
bool res_sh_avg = (sh_avg <= FSENSOR_OQ_MAX_SH);
|
|
|
if (yd_qua >= 8) res_sh_avg = true;
|
|
|
|
|
|
- printf_P(_N(" sh_avg = %hhu %S\n"), sh_avg, (res_sh_avg?_OK:_NG));
|
|
|
+ printf_P(_N(" sh_avg = %u %S\n"), sh_avg, (res_sh_avg?_OK:_NG));
|
|
|
bool res = res_er_sum && res_er_max && res_yd_avg && res_yd_max && res_yd_min && res_sh_avg;
|
|
|
printf_P(_N("fsensor_oq_result %S\n"), (res?_OK:_NG));
|
|
|
return res;
|
|
@@ -559,8 +559,8 @@ FORCE_INLINE static void fsensor_isr(int st_cnt)
|
|
|
#ifdef DEBUG_FSENSOR_LOG
|
|
|
if (fsensor_log)
|
|
|
{
|
|
|
- printf_P(_N("FSENSOR cnt=%d dy=%d err=%hhu %S\n"), st_cnt, pat9125_y, fsensor_err_cnt, (fsensor_err_cnt > old_err_cnt)?_N("NG!"):_N("OK"));
|
|
|
- if (fsensor_oq_meassure) printf_P(_N("FSENSOR st_sum=%u yd_sum=%u er_sum=%u er_max=%hhu yd_max=%u\n"), fsensor_oq_st_sum, fsensor_oq_yd_sum, fsensor_oq_er_sum, fsensor_oq_er_max, fsensor_oq_yd_max);
|
|
|
+ printf_P(_N("FSENSOR cnt=%d dy=%d err=%u %S\n"), st_cnt, pat9125_y, fsensor_err_cnt, (fsensor_err_cnt > old_err_cnt)?_N("NG!"):_N("OK"));
|
|
|
+ if (fsensor_oq_meassure) printf_P(_N("FSENSOR st_sum=%u yd_sum=%u er_sum=%u er_max=%u yd_max=%u\n"), fsensor_oq_st_sum, fsensor_oq_yd_sum, fsensor_oq_er_sum, fsensor_oq_er_max, fsensor_oq_yd_max);
|
|
|
}
|
|
|
#endif //DEBUG_FSENSOR_LOG
|
|
|
|