Skip to content

Dinamical modification of hour format #104

@slavendam

Description

@slavendam

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions