// (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
}
pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS