Skip to content

Commit

Permalink
Renamed *_EVO_HOUR_BEGIN/END to just *_HOUR_BEGIN/END
Browse files Browse the repository at this point in the history
  • Loading branch information
fdeblasio committed Nov 20, 2023
1 parent 3fcafba commit c4870d9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
80 changes: 40 additions & 40 deletions include/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,68 +19,68 @@

//Morning/evening don't exist in Gen 3, so they use Gen 4/5's values
#if OW_TIMES_OF_DAY == GEN_3
#define MORNING_EVO_HOUR_BEGIN 4
#define MORNING_EVO_HOUR_END 10
#define MORNING_HOUR_BEGIN 4
#define MORNING_HOUR_END 10

#define DAY_EVO_HOUR_BEGIN 12
#define DAY_EVO_HOUR_END HOURS_PER_DAY
#define DAY_HOUR_BEGIN 12
#define DAY_HOUR_END HOURS_PER_DAY

#define EVENING_EVO_HOUR_BEGIN 18
#define EVENING_EVO_HOUR_END 21
#define EVENING_HOUR_BEGIN 18
#define EVENING_HOUR_END 21

#define NIGHT_EVO_HOUR_BEGIN 0
#define NIGHT_EVO_HOUR_END 12
#define NIGHT_HOUR_BEGIN 0
#define NIGHT_HOUR_END 12
//Evening doesn't exist in Gen 4 so it uses Gen 5's values
#elif OW_TIMES_OF_DAY == GEN_4
#define MORNING_EVO_HOUR_BEGIN 4
#define MORNING_EVO_HOUR_END 10
#define MORNING_HOUR_BEGIN 4
#define MORNING_HOUR_END 10

#define DAY_EVO_HOUR_BEGIN 10
#define DAY_EVO_HOUR_END 20
#define DAY_HOUR_BEGIN 10
#define DAY_HOUR_END 20

#define EVENING_EVO_HOUR_BEGIN 18
#define EVENING_EVO_HOUR_END 21
#define EVENING_HOUR_BEGIN 18
#define EVENING_HOUR_END 21

#define NIGHT_EVO_HOUR_BEGIN 20
#define NIGHT_EVO_HOUR_END 4
#define NIGHT_HOUR_BEGIN 20
#define NIGHT_HOUR_END 4
//Gen 5 currently not included as the seasons change the times of day
#elif OW_TIMES_OF_DAY <= GEN_6
#define MORNING_EVO_HOUR_BEGIN 4
#define MORNING_EVO_HOUR_END 11
#define MORNING_HOUR_BEGIN 4
#define MORNING_HOUR_END 11

#define DAY_EVO_HOUR_BEGIN 11
#define DAY_EVO_HOUR_END 18
#define DAY_HOUR_BEGIN 11
#define DAY_HOUR_END 18

#define EVENING_EVO_HOUR_BEGIN 18
#define EVENING_EVO_HOUR_END 21
#define EVENING_HOUR_BEGIN 18
#define EVENING_HOUR_END 21

#define NIGHT_EVO_HOUR_BEGIN 21
#define NIGHT_EVO_HOUR_END 4
#define NIGHT_HOUR_BEGIN 21
#define NIGHT_HOUR_END 4
//These are the Sun/Ultra Sun times
#elif OW_TIMES_OF_DAY == GEN_7
#define MORNING_EVO_HOUR_BEGIN 6
#define MORNING_EVO_HOUR_END 10
#define MORNING_HOUR_BEGIN 6
#define MORNING_HOUR_END 10

#define DAY_EVO_HOUR_BEGIN 10
#define DAY_EVO_HOUR_END 17
#define DAY_HOUR_BEGIN 10
#define DAY_HOUR_END 17

#define EVENING_EVO_HOUR_BEGIN 17
#define EVENING_EVO_HOUR_END 18
#define EVENING_HOUR_BEGIN 17
#define EVENING_HOUR_END 18

#define NIGHT_EVO_HOUR_BEGIN 18
#define NIGHT_EVO_HOUR_END 6
#define NIGHT_HOUR_BEGIN 18
#define NIGHT_HOUR_END 6
#elif OW_TIMES_OF_DAY >= GEN_8
#define MORNING_EVO_HOUR_BEGIN 6
#define MORNING_EVO_HOUR_END 10
#define MORNING_HOUR_BEGIN 6
#define MORNING_HOUR_END 10

#define DAY_EVO_HOUR_BEGIN 10
#define DAY_EVO_HOUR_END 19
#define DAY_HOUR_BEGIN 10
#define DAY_HOUR_END 19

#define EVENING_EVO_HOUR_BEGIN 19
#define EVENING_EVO_HOUR_END 20
#define EVENING_HOUR_BEGIN 19
#define EVENING_HOUR_END 20

#define NIGHT_EVO_HOUR_BEGIN 20
#define NIGHT_EVO_HOUR_END 6
#define NIGHT_HOUR_BEGIN 20
#define NIGHT_HOUR_END 6
#endif

#define TIME_MORNING 0
Expand Down
6 changes: 3 additions & 3 deletions src/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ bool8 IsBetweenHours(s32 hours, s32 begin, s32 end)
u8 GetTimeOfDay(void)
{
RtcCalcLocalTime();
if (IsBetweenHours(gLocalTime.hours, MORNING_EVO_HOUR_BEGIN, MORNING_EVO_HOUR_END))
if (IsBetweenHours(gLocalTime.hours, MORNING_HOUR_BEGIN, MORNING_HOUR_END))
return TIME_MORNING;
else if (IsBetweenHours(gLocalTime.hours, EVENING_EVO_HOUR_BEGIN, EVENING_EVO_HOUR_END))
else if (IsBetweenHours(gLocalTime.hours, EVENING_HOUR_BEGIN, EVENING_HOUR_END))
return TIME_EVENING;
else if (IsBetweenHours(gLocalTime.hours, NIGHT_EVO_HOUR_BEGIN, NIGHT_EVO_HOUR_END))
else if (IsBetweenHours(gLocalTime.hours, NIGHT_HOUR_BEGIN, NIGHT_HOUR_END))
return TIME_NIGHT;
return TIME_DAY;
}
Expand Down

0 comments on commit c4870d9

Please sign in to comment.