Open theIdeviceguy18383 opened 3 years ago
same but there's this example file
tho I got these errors
button_helper.c:53:12: error: incompatible integer to pointer conversion assigning to 'volatile uint32_t *' (aka 'volatile unsigned int *') from 'unsigned long long' [-Wint-conversion]
gpio_base = dt_get_u32_prop("gpio", "reg") + gIOBase;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
button_helper.c:54:34: error: format specifies type 'unsigned long long' but the argument has type 'volatile uint32_t *' (aka 'volatile unsigned int *') [-Werror,-Wformat]
printf("gpio_base: 0x%llx\n\n", gpio_base);
~~~~ ^~~~~~~~~
2 errors generated.
and if I revert back before this commit by git checkout e7f679f
then I get this error
button_helper.c:16:33: error: incompatible integer to pointer conversion initializing 'const volatile uint32_t *const' (aka 'const volatile unsigned int *const') with an expression of type 'long' [-Wint-conversion]
const volatile uint32_t * const gpio_base = 0x20f100000;
still don't know how to solve this lol
ok solved it by using (most likely) bad code from chatgpt
const volatile uint32_t * const gpio_base = (const volatile uint32_t * const) 0x20f100000;
haven't test it yet so idk if it actually works lol (i'll try later)
I am on Linux and I have been trying to compile, but compiling seems to only work on Mac. Can someone send a compiled version of the latest build?