Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraWright committed Mar 17, 2016
1 parent 078fce4 commit 6dfb331
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ INCLUDES := include source/fatfs source/fatfs/sdmmc
ARCH := -mthumb -mthumb-interwork

CFLAGS := -g -Wall -O2\
-march=armv5te -mtune=arm946e-s -fomit-frame-pointer\
-march=armv5te -mtune=arm946e-s\
-ffast-math -Wno-main -std=c99\
$(ARCH)

Expand Down
2 changes: 1 addition & 1 deletion loader/source/fatfs/diskio.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ DRESULT disk_read (
DRESULT disk_write (
__attribute__((unused))
BYTE pdrv, /* Physical drive nmuber to identify the drive */
const BYTE *buff, /* Data to be written */
const BYTE *buff, /* Data to be written */
DWORD sector, /* Sector address in LBA */
UINT count /* Number of sectors to write */
)
Expand Down
6 changes: 3 additions & 3 deletions loader/source/fatfs/ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ FRESULT sync_fs ( /* FR_OK: successful, FR_DISK_ERR: failed */
/*-----------------------------------------------------------------------*/
/* Hidden API for hacks and disk tools */

DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
static DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
FATFS* fs, /* File system object */
DWORD clst /* Cluster# to be converted */
)
Expand All @@ -829,7 +829,7 @@ DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
/*-----------------------------------------------------------------------*/
/* Hidden API for hacks and disk tools */

DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluster status */
static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluster status */
FATFS* fs, /* File system object */
DWORD clst /* FAT index number (cluster number) to get the value */
)
Expand Down Expand Up @@ -884,7 +884,7 @@ DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluste
/* Hidden API for hacks and disk tools */

#if !_FS_READONLY
FRESULT put_fat (
static FRESULT put_fat (
FATFS* fs, /* File system object */
DWORD clst, /* FAT index number (cluster number) to be changed */
DWORD val /* New value to be set to the entry */
Expand Down
1 change: 0 additions & 1 deletion loader/source/fatfs/sdmmc/common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#pragma once

#include <stdbool.h>
#include "../../types.h"
2 changes: 0 additions & 2 deletions loader/source/fatfs/sdmmc/sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#include "common.h"

#include "sdmmc.h"
#include "delay.h"

Expand Down
2 changes: 1 addition & 1 deletion loader/source/i2c.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "common.h"
#include "types.h"

#define I2C1_REG_OFF 0x10161000
#define I2C2_REG_OFF 0x10144000
Expand Down
4 changes: 2 additions & 2 deletions loader/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define PAYLOAD_ADDRESS 0x23F00000

u32 loadPayload(const char *path){
static u32 loadPayload(const char *path){
FIL payload;
unsigned int br;
if(f_open(&payload, path, FA_READ) == FR_OK)
Expand All @@ -19,7 +19,7 @@ u32 loadPayload(const char *path){
return 0;
}

void main(){
void main(void){
FATFS fs;
f_mount(&fs, "0:", 1);

Expand Down
6 changes: 2 additions & 4 deletions loader/source/screeninit.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#include "screeninit.h"
#include "i2c.h"

void initLCD()
{
void initLCD(void){
vu32 *const arm11 = (u32 *)0x1FFFFFF8;

void __attribute__((naked)) ARM11()
{
void __attribute__((naked)) ARM11(void){
*(vu32 *)0x10141200 = 0x1007F;
*(vu32 *)0x10202014 = 0x00000001;
*(vu32 *)0x1020200C &= 0xFFFEFFFE;
Expand Down
2 changes: 1 addition & 1 deletion loader/source/screeninit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

#include "types.h"

void initLCD();
void initLCD(void);
1 change: 1 addition & 0 deletions loader/source/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

Expand Down
2 changes: 1 addition & 1 deletion source/fatfs/diskio.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ DRESULT disk_read (
DRESULT disk_write (
__attribute__((unused))
BYTE pdrv, /* Physical drive nmuber to identify the drive */
const BYTE *buff, /* Data to be written */
const BYTE *buff, /* Data to be written */
DWORD sector, /* Sector address in LBA */
UINT count /* Number of sectors to write */
)
Expand Down
6 changes: 3 additions & 3 deletions source/fatfs/ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ FRESULT sync_fs ( /* FR_OK: successful, FR_DISK_ERR: failed */
/*-----------------------------------------------------------------------*/
/* Hidden API for hacks and disk tools */

DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
static DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
FATFS* fs, /* File system object */
DWORD clst /* Cluster# to be converted */
)
Expand All @@ -829,7 +829,7 @@ DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
/*-----------------------------------------------------------------------*/
/* Hidden API for hacks and disk tools */

DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluster status */
static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluster status */
FATFS* fs, /* File system object */
DWORD clst /* FAT index number (cluster number) to get the value */
)
Expand Down Expand Up @@ -884,7 +884,7 @@ DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluste
/* Hidden API for hacks and disk tools */

#if !_FS_READONLY
FRESULT put_fat (
static FRESULT put_fat (
FATFS* fs, /* File system object */
DWORD clst, /* FAT index number (cluster number) to be changed */
DWORD val /* New value to be set to the entry */
Expand Down
2 changes: 0 additions & 2 deletions source/fatfs/sdmmc/sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#include "common.h"

#include "sdmmc.h"
#include "delay.h"

Expand Down
4 changes: 2 additions & 2 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "fs.h"
#include "firm.h"

void main(){
void main(void){
mountSD();
setupCFW();
}

void startCFW(){
void startCFW(void){
if(!loadFirm()) return;
if(!patchFirm()) return;
launchFirm();
Expand Down

0 comments on commit 6dfb331

Please sign in to comment.