[X9D] SD card write error fixed, DMA enabled (thanks Adela), SPORT debug code

This commit is contained in:
bernet.andre@gmail.com
2013-03-20 22:39:21 +00:00
parent 8760bae8a6
commit 781b3c6188
9 changed files with 204 additions and 188 deletions
+15 -3
View File
@@ -36,6 +36,8 @@
#include "../open9x.h"
uint16_t tmp=0; // Debug - received bytes counter
void sportInit(void)
{
USART_InitTypeDef USART_InitStructure;
@@ -89,10 +91,20 @@ void sportPutc(const char c)
extern "C" void USART2_IRQHandler()
{
uint16_t data;
while(USART_GetFlagStatus(SPORT, USART_FLAG_RXNE)){
tmp++; // Debug - received bytes counter
if(USART_GetFlagStatus(SPORT, USART_FLAG_RXNE))
data = USART_ReceiveData(SPORT);
processSerialData((uint8_t) data);
USART_ClearFlag(SPORT,USART_FLAG_RXNE); // Just in case, should be cleared automatically by the read above, and we shouldn't enter the interrupt if no char received - doesn't help
if(SPORT->SR & USART_FLAG_ORE) // Debug - never happened once yet
{
data = (int8_t)(SPORT->SR & (uint8_t)0xFF);
tmp=0;
}
processSerialData((uint8_t) data);
}
#endif