traceswo: Move (now-constant) traceswo.c to platforms/stm32
This commit is contained in:
parent
09715e1db8
commit
15d7077115
|
@ -26,4 +26,3 @@ void traceswo_init(void);
|
||||||
void trace_buf_drain(usbd_device *dev, uint8_t ep);
|
void trace_buf_drain(usbd_device *dev, uint8_t ep);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#if defined(PLATFORM_HAS_TRACESWO)
|
#if defined(PLATFORM_HAS_TRACESWO)
|
||||||
#include "traceswo.h"
|
#include <traceswo.h>
|
||||||
#endif
|
#endif
|
||||||
#include <usbuart.h>
|
#include <usbuart.h>
|
||||||
|
|
||||||
|
|
|
@ -130,19 +130,19 @@ void trace_isr(void)
|
||||||
duty = TIM_CCR2(TRACE_TIM);
|
duty = TIM_CCR2(TRACE_TIM);
|
||||||
|
|
||||||
/* Reset decoder state if crazy shit happened */
|
/* 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;
|
goto flush_and_reset;
|
||||||
|
|
||||||
if(!(sr & TIM_SR_CC1IF)) notstart = 1;
|
if(!(sr & TIM_SR_CC1IF)) notstart = 1;
|
||||||
|
|
||||||
if (!bt) {
|
if (!bt) {
|
||||||
if (notstart) {
|
if (notstart) {
|
||||||
notstart = 0;
|
notstart = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* First bit, sync decoder */
|
/* First bit, sync decoder */
|
||||||
duty -= ALLOWED_DUTY_ERROR;
|
duty -= ALLOWED_DUTY_ERROR;
|
||||||
if (((cycle / duty) != 2) &&
|
if (((cycle / duty) != 2) &&
|
||||||
((cycle / duty) != 3))
|
((cycle / duty) != 3))
|
||||||
return;
|
return;
|
||||||
bt = duty;
|
bt = duty;
|
||||||
|
@ -176,7 +176,7 @@ void trace_isr(void)
|
||||||
decbuf_pos++;
|
decbuf_pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decbuf_pos < 128)
|
if (decbuf_pos < 128)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flush_and_reset:
|
flush_and_reset:
|
||||||
|
@ -187,5 +187,3 @@ flush_and_reset:
|
||||||
decbuf_pos = 0;
|
decbuf_pos = 0;
|
||||||
memset(decbuf, 0, sizeof(decbuf));
|
memset(decbuf, 0, sizeof(decbuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue