Subversion Repositories freemyipod

Rev

Rev 560 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 560 Rev 961
Line 30... Line 30...
30
bool clockgate_get_state(int gate)
30
bool clockgate_get_state(int gate)
31
{
31
{
32
    return !(PWRCON(gate >> 5) & (1 << (gate & 0x1f)));
32
    return !(PWRCON(gate >> 5) & (1 << (gate & 0x1f)));
33
}
33
}
34
 
34
 
-
 
35
void clockgate_enable(int gate, bool enable) ICODE_ATTR;
35
void clockgate_enable(int gate, bool enable)
36
void clockgate_enable(int gate, bool enable)
36
{
37
{
37
    uint32_t mode = enter_critical_section();
38
    uint32_t mode = enter_critical_section();
38
    if (enable) PWRCON(gate >> 5) &= ~(1 << (gate & 0x1f));
39
    if (enable) PWRCON(gate >> 5) &= ~(1 << (gate & 0x1f));
39
    else PWRCON(gate >> 5) |= 1 << (gate & 0x1f);
40
    else PWRCON(gate >> 5) |= 1 << (gate & 0x1f);