Skip to content

Cascading timers need to be enabled to count #2812

Closed
@LunarLambda

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.

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