// (c) Inne 14-07-2021
extern "C" void sqArray(uint32_t *inpArray, size_t l);
void setup() {
// put your setup code here, to run once:
Serial1.begin(115200);
Serial1.println("Hello, Raspberry Pi Pico!");
uint32_t lArray = 4; //length of array nums
uint32_t nums[lArray] = {1,2,3,4};
// Me figuring how pointers worked again
/*
uint32_t *ptr;
ptr = &t1[0];
Serial1.println(*ptr);
//*ptr = 7;
Serial1.println(t1[0]);
*/
Serial1.println("input array number are:");
for(uint32_t i = 0; i < lArray; i++){
Serial1.println(nums[i]);
delay(100);
}
sqArray(&nums[0], lArray);
Serial1.println("Squared numbers are:"); //Weird Bug: without this arbritraty print I get a RP2040: NextJS 55 error (solved went out array by changing in assembly part the lArray to last calculation (picked r5 randomly as temp register))
for(uint32_t i = 0; i < lArray; i++){
Serial1.println(nums[i]);
delay(100);
}
}
void loop() {
// put your main code here, to run repeatedly:
delay(5); // this speeds up the simulation
}