mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 21:52:48 +00:00
added a small 10ms wait before turning on the backlight, thanks to profi for reminding me of that
This commit is contained in:
parent
f5a877d00b
commit
bcff09a389
@ -18,3 +18,12 @@
|
|||||||
#define TIMER_CNT_INT_EN BIT(2)
|
#define TIMER_CNT_INT_EN BIT(2)
|
||||||
#define TIMER_CNT_RELOAD BIT(1)
|
#define TIMER_CNT_RELOAD BIT(1)
|
||||||
#define TIMER_CNT_ENABLE BIT(0)
|
#define TIMER_CNT_ENABLE BIT(0)
|
||||||
|
|
||||||
|
void TIMER_WaitTicks(u32 ticks)
|
||||||
|
{
|
||||||
|
REG_TIMER_IRQ(TIMER_THIS_CPU) = 1;
|
||||||
|
REG_TIMER_CNT(TIMER_THIS_CPU) = 0;
|
||||||
|
REG_TIMER_LOAD(TIMER_THIS_CPU) = ticks;
|
||||||
|
REG_TIMER_CNT(TIMER_THIS_CPU) = TIMER_CNT_ENABLE;
|
||||||
|
while(REG_TIMER_COUNT(TIMER_THIS_CPU));
|
||||||
|
}
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
// therefore
|
// therefore
|
||||||
// Load_value = [(CPU_CLK / 2) * (T / (PRESCALER_value + 1))] - 1
|
// Load_value = [(CPU_CLK / 2) * (T / (PRESCALER_value + 1))] - 1
|
||||||
|
|
||||||
#define BASE_CLKRATE (268111856)
|
#define BASE_CLKRATE (268111856 / 2)
|
||||||
|
|
||||||
#define CLK_FREQ_TO_INTERVAL(f, p) ((BASE_CLKRATE/2) * ((f) / ((p) + 1)) - 1)
|
#define CLK_MS_TO_TICKS(m) (((BASE_CLKRATE / 1000) * (m)) - 1)
|
||||||
|
|
||||||
|
void TIMER_WaitTicks(u32 ticks);
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
#include <pxi.h>
|
#include <pxi.h>
|
||||||
|
|
||||||
#include "arm/gic.h"
|
#include "arm/gic.h"
|
||||||
#include "arm/scu.h"
|
|
||||||
#include "arm/mmu.h"
|
#include "arm/mmu.h"
|
||||||
|
#include "arm/scu.h"
|
||||||
|
#include "arm/timer.h"
|
||||||
|
|
||||||
#include "hw/gpulcd.h"
|
#include "hw/gpulcd.h"
|
||||||
#include "hw/i2c.h"
|
#include "hw/i2c.h"
|
||||||
@ -93,6 +94,8 @@ void SYS_CoreZeroInit(void)
|
|||||||
|
|
||||||
GPU_SetFramebufferMode(0, PDC_RGB24);
|
GPU_SetFramebufferMode(0, PDC_RGB24);
|
||||||
GPU_SetFramebufferMode(1, PDC_RGB24);
|
GPU_SetFramebufferMode(1, PDC_RGB24);
|
||||||
|
|
||||||
|
TIMER_WaitTicks(CLK_MS_TO_TICKS(10));
|
||||||
MCU_WriteReg(0x22, 0x2A);
|
MCU_WriteReg(0x22, 0x2A);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user