Skip to content

Cascading timers need to be enabled to count #2812

Closed

Description

@LunarLambda
bool sioWait()
{
    // 50 ms timeout
    REG_TM0CNT = TIMER_FREQ_16KHZ;
    REG_TM0VAL = 65536 - 819;
    REG_TM1CNT = TIMER_FREQ_CASCADE;
    REG_TM1VAL = 0;
    REG_TM0CNT |= TIMER_ENABLE;

    while (!REG_TM1VAL);

    return hadTrans;
}

Had this code hang on hardware, despite working fine in mGBA. Turns out hardware demands the TIMER_ENABLE flag be set on both TM0 and TM1 for TM1 to count up.

Activity

  1. added this to the mGBA 0.10.2 milestone on Feb 3, 2023
  2. endrift commented on Feb 3, 2023

    @endrift
    Member

    This sounds like a simple oversight on my part.

  3. endrift commented on Feb 3, 2023

    @endrift
    Member

    image
    I really should look for more of these TODOs in my code.

  4. LunarLambda commented on Feb 3, 2023

    @LunarLambda
    ContributorAuthor

    😅

  5. added a commit that references this issue on Feb 4, 2023
    4738e55
  6. added a commit that references this issue on Jan 28, 2024
    e470795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:GBAGame Boy Advance-related issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions