Fix all the remaining warnings

This commit is contained in:
Sateallia 2023-10-28 23:32:47 +03:00
parent 508e23714c
commit eb1157ff08
3 changed files with 12 additions and 8 deletions

View File

@ -49,7 +49,7 @@ typedef int int32_t;
typedef unsigned int uint32_t;
typedef long int64_t;
typedef unsigned long uint64_t;
typedef void intptr_t;
typedef void uintptr_t;
typedef long intptr_t;
typedef unsigned long uintptr_t;
#endif

View File

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <bits/alltypes.h>
#include <hal.h>
void hcf() {
@ -28,9 +29,12 @@ void delay(int32_t count) {
}
uint32_t mmio_read(uint32_t reg) {
return *(volatile uint32_t*)reg;
return (uintptr_t)reg;
}
void mmio_write(uint32_t reg, uint32_t data) {
*(volatile uint32_t*)(reg) = data;
void mmio_write(uint64_t reg, uint32_t data) {
uint32_t *p_reg = (uint32_t*)reg;
*p_reg = data;
}

View File

@ -27,6 +27,6 @@
void hcf();
void delay(int32_t);
uint32_t mmio_read(uint32_t);
void mmio_write(uint32_t, uint32_t);
void mmio_write(uint64_t, uint32_t);
#endif