Skip to content

Dinamical modification of hour format #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
slavendam opened this issue Feb 2, 2024 · 1 comment · Fixed by #105
Closed

Dinamical modification of hour format #104

slavendam opened this issue Feb 2, 2024 · 1 comment · Fixed by #105
Assignees
Milestone

Comments

@slavendam
Copy link

In RTC_StartAlarm function

void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, hourAM_PM_t period, uint8_t mask)
it is implemented that user can send 12h hours format, together with AM or PM flag, but that will not be used if 24h format is hardcoded.

If for example user wants to send 14:00h time in 12h format he will send:
RTC_StartAlarm(RTC_ALARM_B, 0, 2, 0, 0, 0, HOUR_PM, 31UL); // old

If 24h format is hardcoded alarm will be set at 2:00 AM and user will not have feedback.

From UX side it would be the best to add additional value to hourAM_PM_t enum:

} hourAM_PM_t;

typedef enum {
  HOUR_AM,
  HOUR_PM,
  HOUR_24H
} hourAM_PM_t;

Modifiying code wherever new hourAM_PM_t is used, will enable user to dinamically set hour format he wants.

@slavendam slavendam added the bug label Feb 2, 2024
@fpistm fpistm removed the bug label Feb 2, 2024
@FRASTM
Copy link
Contributor

FRASTM commented Feb 8, 2024

A proposal could be introduce a rtc.getFormat (or so) that will return HOUR_12 or HOUR_24
So that you can check the format 12 or 24 hours before setting the Alarm (or Time)
Of course when format is 24 hours, HOUR_AM or HOUR_PM are useless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

3 participants