Hello ESP_Sprite,
I just tried the following code, without testing it yet, but it seems the compiler can live with that, means its compiling
References for this minimal code can be found in [1] and [2] at the end of this post (scroll down...)
Here is the minimal example code:
Assembly File:
Code: Select all
.section .iram1,"ax"
.global xt_highint5
.type xt_highint5,@function
.align 4
.literal .GPIO_STATUS_W1TC_REG, 0x3FF4404C
.literal .GPIO_NUM_4, (1<<4)
xt_highint5:
/* clearing the interrupt status of GPIO_NUM_4 */
l32r a14, .GPIO_STATUS_W1TC_REG
l32r a15, .GPIO_NUM_4
s32i a15, a14, 0
/* increment here the global variable "highlevel_intr_cntr"
movi a14, highlevel_intr_cntr
l32i a15, a14, 0
addi a15, a15, 1
s32i a15, a14, 0
memw
rsr a0, EXCSAVE_5
rfi 5
C-File
Note: the code lines for allocating the high level interrupt like: intr_matrix(....) etc....can be found in [1] or [2].
Code: Select all
volatile uint32_t highlevel_intr_cntr = 0;
void app_main(){
while(1){
vTaskDelay(1000);
printf("HIGH LEVEL INTERRUPT COUNTER: %d\n:, highlevel_intr_cntr);
}
}
Now:
(A): I did not use any .global command inside the assembly file like it would be in this case:
(B): I did not use "extern" keyword for the global variable in the c-File like it would be in this case:
Code: Select all
extern volatile uint32_t high_level_intr_cntr;
(C): I did not use a .global command at the end of the assembly file to help the "LINKER" (LD), like it was used in the example [2].
Even I did not use (A), (B) and (C) the files were compiled. Why is that ? What should it look like in a "clean" way ESP_SPRITE ?
Thank you very much !
Best regards,
opcode_x64
References:
[1] To implement the High-Level Interrupt I used just my own post here one year before discussed with you ESP_Sprite (thank you btw!!)
https://esp32.com/viewtopic.php?f=13&t=8826
[2] To access on a variable in the high level interrupt handler, I used the post of user "darthcloud". He provides also an example for implementing a high level interrupt on GitHub.
Link to the post:
viewtopic.php?t=11970
Link to the GitHub:
https://github.com/darthcloud/esp32_highint5_gpio