Skip to content

Commit 60401d4

Browse files
committed
stmhal/rtc: Fix indentation to use spaces rather than tabs.
1 parent b106532 commit 60401d4

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

stmhal/rtc.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -507,34 +507,34 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_rtc_wakeup_obj, 2, 4, pyb_rtc_wakeup);
507507
mp_obj_t pyb_rtc_calibration(mp_uint_t n_args, const mp_obj_t *args) {
508508
mp_int_t cal;
509509
if (n_args == 2) {
510-
cal = mp_obj_get_int(args[1]);
511-
mp_uint_t cal_p, cal_m;
512-
if (cal < -511 || cal > 512) {
513-
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError,
514-
"calibration value out of range"));
515-
}
516-
if (cal > 0) {
517-
cal_p = RTC_SMOOTHCALIB_PLUSPULSES_SET;
518-
cal_m = 512 - cal;
519-
} else {
520-
cal_p = RTC_SMOOTHCALIB_PLUSPULSES_RESET;
521-
cal_m = -cal;
522-
}
523-
HAL_RTCEx_SetSmoothCalib(&RTCHandle, RTC_SMOOTHCALIB_PERIOD_32SEC, cal_p, cal_m);
524-
return mp_const_none;
510+
cal = mp_obj_get_int(args[1]);
511+
mp_uint_t cal_p, cal_m;
512+
if (cal < -511 || cal > 512) {
513+
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError,
514+
"calibration value out of range"));
515+
}
516+
if (cal > 0) {
517+
cal_p = RTC_SMOOTHCALIB_PLUSPULSES_SET;
518+
cal_m = 512 - cal;
519+
} else {
520+
cal_p = RTC_SMOOTHCALIB_PLUSPULSES_RESET;
521+
cal_m = -cal;
522+
}
523+
HAL_RTCEx_SetSmoothCalib(&RTCHandle, RTC_SMOOTHCALIB_PERIOD_32SEC, cal_p, cal_m);
524+
return mp_const_none;
525525
} else {
526526
// printf("CALR = 0x%x\n", (mp_uint_t) RTCHandle.Instance->CALR); // DEBUG
527-
// Test if CALP bit is set in CALR:
528-
if (RTCHandle.Instance->CALR & 0x8000) {
529-
cal = 512 - (RTCHandle.Instance->CALR & 0x1ff);
530-
} else {
531-
cal = -(RTCHandle.Instance->CALR & 0x1ff);
532-
}
533-
return mp_obj_new_int(cal);
527+
// Test if CALP bit is set in CALR:
528+
if (RTCHandle.Instance->CALR & 0x8000) {
529+
cal = 512 - (RTCHandle.Instance->CALR & 0x1ff);
530+
} else {
531+
cal = -(RTCHandle.Instance->CALR & 0x1ff);
532+
}
533+
return mp_obj_new_int(cal);
534534
}
535535
}
536536
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_rtc_calibration_obj, 1, 2, pyb_rtc_calibration);
537-
537+
538538
STATIC const mp_map_elem_t pyb_rtc_locals_dict_table[] = {
539539
{ MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_rtc_info_obj },
540540
{ MP_OBJ_NEW_QSTR(MP_QSTR_datetime), (mp_obj_t)&pyb_rtc_datetime_obj },

0 commit comments

Comments
 (0)