Subversion Repositories freemyipod

Rev

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

Rev 427 Rev 557
Line 23... Line 23...
23
 
23
 
24
#include "global.h"
24
#include "global.h"
25
#include "s5l8701.h"
25
#include "s5l8701.h"
26
 
26
 
27
 
27
 
-
 
28
bool clockgate_get_state(int gate)
-
 
29
{
-
 
30
    return !(PWRCON(gate >> 5) & (1 << (gate & 0x1f)));
-
 
31
}
-
 
32
 
28
void clockgate_enable(int gate, bool enable)
33
void clockgate_enable(int gate, bool enable)
29
{
34
{
30
    uint32_t mode = enter_critical_section();
35
    uint32_t mode = enter_critical_section();
31
    if (enable) PWRCON(gate >> 5) &= ~(1 << (gate & 0x1f));
36
    if (enable) PWRCON(gate >> 5) &= ~(1 << (gate & 0x1f));
32
    else PWRCON(gate >> 5) |= 1 << (gate & 0x1f);
37
    else PWRCON(gate >> 5) |= 1 << (gate & 0x1f);