diff --git a/src/platforms/native/traceswo.h b/src/include/traceswo.h similarity index 99% rename from src/platforms/native/traceswo.h rename to src/include/traceswo.h index 9b2cf2c..5566f94 100644 --- a/src/platforms/native/traceswo.h +++ b/src/include/traceswo.h @@ -26,4 +26,3 @@ void traceswo_init(void); void trace_buf_drain(usbd_device *dev, uint8_t ep); #endif - diff --git a/src/platforms/stm32/cdcacm.c b/src/platforms/stm32/cdcacm.c index 2bbdcb6..9799d13 100644 --- a/src/platforms/stm32/cdcacm.c +++ b/src/platforms/stm32/cdcacm.c @@ -37,7 +37,7 @@ #include "platform.h" #if defined(PLATFORM_HAS_TRACESWO) -#include "traceswo.h" +#include #endif #include diff --git a/src/platforms/native/traceswo.c b/src/platforms/stm32/traceswo.c similarity index 98% rename from src/platforms/native/traceswo.c rename to src/platforms/stm32/traceswo.c index 7cd42d1..31fdc4e 100644 --- a/src/platforms/native/traceswo.c +++ b/src/platforms/stm32/traceswo.c @@ -130,19 +130,19 @@ void trace_isr(void) duty = TIM_CCR2(TRACE_TIM); /* Reset decoder state if crazy shit happened */ - if ((bt && (((duty / bt) > 2) || ((duty / bt) == 0))) || (duty == 0)) + if ((bt && (((duty / bt) > 2) || ((duty / bt) == 0))) || (duty == 0)) goto flush_and_reset; if(!(sr & TIM_SR_CC1IF)) notstart = 1; if (!bt) { - if (notstart) { + if (notstart) { notstart = 0; return; } /* First bit, sync decoder */ duty -= ALLOWED_DUTY_ERROR; - if (((cycle / duty) != 2) && + if (((cycle / duty) != 2) && ((cycle / duty) != 3)) return; bt = duty; @@ -176,7 +176,7 @@ void trace_isr(void) decbuf_pos++; } - if (decbuf_pos < 128) + if (decbuf_pos < 128) return; flush_and_reset: @@ -187,5 +187,3 @@ flush_and_reset: decbuf_pos = 0; memset(decbuf, 0, sizeof(decbuf)); } - -