From 8f47a50abe4cbae953724ea4769fbd629ee9b801 Mon Sep 17 00:00:00 2001
From: Uros Majstorovic <majstor@majstor.org>
Date: Sun, 4 Sep 2022 18:20:12 +0200
Subject: moved critical functions to itim

---
 fw/fe310/eos/soc/spi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fw/fe310/eos/soc/spi.c b/fw/fe310/eos/soc/spi.c
index 2c36109..b722c7e 100644
--- a/fw/fe310/eos/soc/spi.c
+++ b/fw/fe310/eos/soc/spi.c
@@ -117,6 +117,7 @@ void eos_spi_set_handler(unsigned char evt, eos_evt_handler_t handler) {
     if (evt && (evt <= EOS_SPI_MAX_EVT)) evt_handler[evt - 1] = handler;
 }
 
+__attribute__ ((section (".itim")))
 void _eos_spi_xchg_init(unsigned char *buffer, uint16_t len, uint8_t flags) {
     spi_state_flags &= 0xF0;
     spi_state_flags |= (SPI_FLAG_XCHG | flags);
@@ -149,6 +150,7 @@ void eos_spi_xchg(unsigned char *buffer, uint16_t len, uint8_t flags) {
     SPI1_REG(SPI_REG_IE) = SPI_IP_TXWM;
 }
 
+__attribute__ ((section (".itim")))
 void eos_spi_handle_xchg(void) {
     int i;
     uint16_t sz_chunk = MIN(spi_state_len - spi_state_idx_tx, SPI_SIZE_CHUNK);
@@ -180,6 +182,7 @@ void eos_spi_handle_xchg(void) {
     }
 }
 
+__attribute__ ((section (".itim")))
 void eos_spi_cs_set(void) {
 	/* cs low */
     if (SPI1_REG(SPI_REG_CSMODE) == SPI_CSMODE_OFF) {
@@ -189,6 +192,7 @@ void eos_spi_cs_set(void) {
     }
 }
 
+__attribute__ ((section (".itim")))
 void eos_spi_cs_clear(void) {
 	/* cs high */
     if (SPI1_REG(SPI_REG_CSMODE) == SPI_CSMODE_OFF) {
-- 
cgit v1.2.3