Useless casts again
This commit is contained in:
parent
56e0157d64
commit
9b1df43687
@ -50,7 +50,7 @@ void setupCFW(void){
|
||||
//Attempt to read the configuration file
|
||||
const char configPath[] = "aurei/config.bin";
|
||||
u16 config = 0;
|
||||
u32 needConfig = fileRead((u8 *)&config, configPath, 2) ? 1 : 2;
|
||||
u32 needConfig = fileRead(&config, configPath, 2) ? 1 : 2;
|
||||
|
||||
//Determine if A9LH is installed
|
||||
if(a9lhBoot || (config >> 2) & 0x1){
|
||||
@ -116,7 +116,7 @@ void setupCFW(void){
|
||||
if(bootConfig != (config & 0xFF00)){
|
||||
//Preserve user settings (first byte)
|
||||
u16 tempConfig = ((config & 0xFF) | bootConfig);
|
||||
fileWrite((u8 *)&tempConfig, configPath, 2);
|
||||
fileWrite(&tempConfig, configPath, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ void loadFirm(void){
|
||||
(mode ? "/aurei/firmware.bin" : "/aurei/firmware90.bin");
|
||||
firmSize = fileSize(path);
|
||||
if(!firmSize) error("aurei/firmware(90).bin doesn't exist");
|
||||
fileRead((u8 *)firmLocation, path, firmSize);
|
||||
fileRead(firmLocation, path, firmSize);
|
||||
}
|
||||
|
||||
section = firmLocation->section;
|
||||
@ -255,7 +255,7 @@ void patchFirm(void){
|
||||
|
||||
//Write patched FIRM to SD if needed
|
||||
if(selectedFirm)
|
||||
if(!fileWrite((u8 *)firmLocation, patchedFirms[selectedFirm - 1], firmSize))
|
||||
if(!fileWrite(firmLocation, patchedFirms[selectedFirm - 1], firmSize))
|
||||
error("Couldn't write the patched FIRM (no free space?)");
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ u32 mountSD(void){
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 fileRead(u8 *dest, const char *path, u32 size){
|
||||
u32 fileRead(void *dest, const char *path, u32 size){
|
||||
FRESULT fr;
|
||||
FIL fp;
|
||||
unsigned int br = 0;
|
||||
@ -29,7 +29,7 @@ u32 fileRead(u8 *dest, const char *path, u32 size){
|
||||
return fr ? 0 : 1;
|
||||
}
|
||||
|
||||
u32 fileWrite(const u8 *buffer, const char *path, u32 size){
|
||||
u32 fileWrite(const void *buffer, const char *path, u32 size){
|
||||
FRESULT fr;
|
||||
FIL fp;
|
||||
unsigned int br = 0;
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include "types.h"
|
||||
|
||||
u32 mountSD(void);
|
||||
u32 fileRead(u8 *dest, const char *path, u32 size);
|
||||
u32 fileWrite(const u8 *buffer, const char *path, u32 size);
|
||||
u32 fileRead(void *dest, const char *path, u32 size);
|
||||
u32 fileWrite(const void *buffer, const char *path, u32 size);
|
||||
u32 fileSize(const char *path);
|
||||
u32 fileExists(const char *path);
|
||||
void fileDelete(const char *path);
|
@ -63,7 +63,7 @@ void configureCFW(const char *configPath){
|
||||
|
||||
//Read and parse the existing configuration
|
||||
u16 tempConfig = 0;
|
||||
fileRead((u8 *)&tempConfig, configPath, 2);
|
||||
fileRead(&tempConfig, configPath, 2);
|
||||
for(u32 i = 0; i < OPTIONS; i++)
|
||||
options.enabled[i] = (tempConfig >> i) & 0x1;
|
||||
|
||||
@ -94,7 +94,7 @@ void configureCFW(const char *configPath){
|
||||
//Parse and write the selected options
|
||||
for(u32 i = 0; i < OPTIONS; i++)
|
||||
tempConfig |= options.enabled[i] << i;
|
||||
fileWrite((u8 *)&tempConfig, configPath, 2);
|
||||
fileWrite(&tempConfig, configPath, 2);
|
||||
|
||||
//Reboot
|
||||
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 2);
|
||||
|
Reference in New Issue
Block a user