Revisions.

This commit is contained in:
Brad Nelson
2021-04-11 19:03:47 -07:00
parent d72ee1834d
commit 3efea84e03
2 changed files with 11 additions and 1 deletions

View File

@ -106,6 +106,12 @@ transfer{
}transfer
0 constant ESP_INTR_FLAG_DEFAULT
: ESP_INTR_FLAG_LEVELn ( n=1-6 -- n ) 1 swap lshift ;
1 7 lshift constant ESP_INTR_FLAG_NMI
1 8 lshift constant ESP_INTR_FLAG_SHARED
1 9 lshift constant ESP_INTR_FLAG_EDGE
1 10 lshift constant ESP_INTR_FLAG_IRAM
1 11 lshift constant ESP_INTR_FLAG_INTRDISABLED
0 constant GPIO_INTR_DISABLE
1 constant GPIO_INTR_POSEDGE

View File

@ -42,6 +42,10 @@ $3ff5f000 constant TIMG_BASE
: alarm-enable! ( v t ) >r 10 $400 r> t>nx TIMGn_TxCONFIG_REG m! ;
: alarm-enable@ ( v t ) >r 10 $400 r> t>nx TIMGn_TxCONFIG_REG m@ ;
: onalarm ( xt t ) swap >r t>nx r> 0 0 0 timer_isr_register throw ;
: int-enable! ( f t -- )
t>nx swap >r dup 1 swap lshift r> TIMGn_Tx_INT_ENA_REG m! ;
: onalarm ( xt t ) swap >r t>nx r> 0 ESP_INTR_FLAG_IRAM 0
timer_isr_register throw ;
only forth definitions