X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-lib.git/blobdiff_plain/ac673c08dbe7667ad75ba5c44db851956b953ba0..7ce3175474253d2a0b887267c9645d5c68a53a21:/rpp/src/drv/hbridge.c diff --git a/rpp/src/drv/hbridge.c b/rpp/src/drv/hbridge.c index cc12697..c5da440 100644 --- a/rpp/src/drv/hbridge.c +++ b/rpp/src/drv/hbridge.c @@ -22,7 +22,7 @@ // PWM is available for HBR control. #include "drv/drv.h" #include -#include "drv/spi.h" +#include "drv/spi_tms570.h" #include "drv/gio_tab.h" //Flag variable if pwm was initialized and is ready to start. @@ -81,7 +81,7 @@ int drv_hbr_spi_wdg_callback(struct spi_drv *ifc, int code, // SPI message format definition for watchdog reset command spi_msg_t hbr_spi_wdg = { .flags = 0, - .addr = 0, + .dev = SPIDEV_L99H01, .rq_len = 2, .tx_buf = (uint8_t *)&hbr_spi_wdg_tx_shd, .rx_buf = (uint8_t *)&hbr_spi_wdg_rx_shd, @@ -100,15 +100,6 @@ spi_msg_t hbr_spi_wdg = { */ void drv_hbr_wdg_task(void *p) { - spi_drv_t *ifc; - - ifc = spi_find_drv(NULL, 4); - - if (ifc == NULL) { - wdg_start = FALSE; - vTaskDelete(NULL); - } - portTickType xLastWakeTime; xLastWakeTime = xTaskGetTickCount(); @@ -120,7 +111,7 @@ void drv_hbr_wdg_task(void *p) wdg_start = FALSE; } else - spi_msg_rq_ins(ifc, &hbr_spi_wdg); + spi_msg_rq_ins(&hbr_spi_wdg); xSemaphoreGive(wdg_sync); } }