Skip to content

Commit

Permalink
butano: real time clock (rtc) string added
Browse files Browse the repository at this point in the history
  • Loading branch information
GValiente committed Oct 10, 2024
1 parent 3b5a0d8 commit 019548b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions butano/hw/include/bn_hw_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace
}
}

[[nodiscard]] const char* init();

[[nodiscard]] inline bool init_rtc()
{
return __agbabi_rtc_init() == 0;
Expand Down
21 changes: 21 additions & 0 deletions butano/hw/src/bn_hw_gpio.bn_noflto.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2020-2024 Gustavo Valiente [email protected]
* zlib License, see LICENSE file.
*/

#include "../include/bn_hw_gpio.h"

namespace bn::hw::gpio
{

namespace
{
alignas(int) const char rtc_string[] = "SIIRTC_V001";
}

const char* init()
{
return rtc_string;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* bn::sprite_affine_mat_ptr::set_rotation_angle_safe, bn::sprite_builder::set_rotation_angle_safe
* and bn::sprite_ptr::set_rotation_angle_safe added.
* * Position in `create` methods is now optional.
* * Real time clock (RTC) string added.
* * SRAM string with link-time optimization fixed.
* * @ref faq_bg_top_left and @ref faq_sprites_top_left questions added to the @ref faq page.
* * @ref faq_flash_carts_sram question improved.
Expand Down
6 changes: 5 additions & 1 deletion butano/src/bn_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "bn_hblank_effects_manager.h"
#include "../hw/include/bn_hw_irq.h"
#include "../hw/include/bn_hw_core.h"
#include "../hw/include/bn_hw_gpio.h"
#include "../hw/include/bn_hw_sram.h"
#include "../hw/include/bn_hw_timer.h"
#include "../hw/include/bn_hw_memory.h"
Expand Down Expand Up @@ -355,7 +356,10 @@ void init(const optional<color>& transparent_color, const string_view& keypad_co
data.slow_game_pak = hw::game_pak::init();
hw::memory::init();

[[maybe_unused]] const char* sram_type = hw::sram::init();
[[maybe_unused]] const char* sram_string = hw::sram::init();

// Init gpio:
[[maybe_unused]] const char* rtc_string = hw::gpio::init();

// Init display:
display_manager::init();
Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.html

Large diffs are not rendered by default.

0 comments on commit 019548b

Please sign in to comment.