aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/Source/d_lowspeed.r
diff options
context:
space:
mode:
authorNicolas Schodet2011-07-04 01:23:24 +0200
committerNicolas Schodet2011-07-04 01:27:42 +0200
commitc331530002825a86f12151266a9772167a3a49ce (patch)
tree9a4bb16c6a87e30629da039e82cbf026dc361009 /AT91SAM7S256/Source/d_lowspeed.r
parent0cb650f1cf6f446bbb0186300a198b5936f49bb4 (diff)
parentb0472321014e8fcb110f4cecad734bb6a7e27ae0 (diff)
Merge branch 'jch-import' into jch-merge
Conflicts: AT91SAM7S256/Source/BtTest.inc AT91SAM7S256/Source/Functions.inl AT91SAM7S256/Source/Ui.txt AT91SAM7S256/Source/c_cmd.c AT91SAM7S256/Source/c_input.c AT91SAM7S256/Source/c_output.c AT91SAM7S256/Source/c_ui.c AT91SAM7S256/Source/c_ui.h AT91SAM7S256/Source/d_loader.h AT91SAM7S256/Source/d_lowspeed.r AT91SAM7S256/Source/d_output.c AT91SAM7S256/Source/d_output.h
Diffstat (limited to 'AT91SAM7S256/Source/d_lowspeed.r')
-rw-r--r--AT91SAM7S256/Source/d_lowspeed.r23
1 files changed, 12 insertions, 11 deletions
diff --git a/AT91SAM7S256/Source/d_lowspeed.r b/AT91SAM7S256/Source/d_lowspeed.r
index 279c10e..9741f0c 100644
--- a/AT91SAM7S256/Source/d_lowspeed.r
+++ b/AT91SAM7S256/Source/d_lowspeed.r
@@ -173,12 +173,12 @@ ULONG CLK_PINS[4] = {CHANNEL_ONE_CLK, CHANNEL_TWO_CLK, CHANNEL_THREE_CLK, CHANNE
#define GetClkPinLevel(ChannelNr) (*AT91C_PIOA_PDSR & CLK_PINS[ChannelNr])
#define GetDataPinLevel(ChannelNr) (*AT91C_PIOA_PDSR & DATA_PINS[ChannelNr])
-#define ENABLEPWMTimerForLowCom {\
- *AT91C_PWMC_ENA = AT91C_PWMC_CHID0; /* Enable PWM output channel 0 */\
+#define ENABLEPWMTimerForLowCom {\
+ *AT91C_PWMC_ENA = AT91C_PWMC_CHID0; /* Enable PWM output channel 0 */\
}
-#define DISABLEPWMTimerForLowCom {\
- *AT91C_PWMC_DIS = AT91C_PWMC_CHID0; /* Disable PWM output channel 0 */\
+#define DISABLEPWMTimerForLowCom {\
+ *AT91C_PWMC_DIS = AT91C_PWMC_CHID0; /* Disable PWM output channel 0 */\
}
#define OLD_DISABLEPWMTimerForLowCom {\
@@ -231,6 +231,7 @@ __ramfunc void LowSpeedPwmIrqHandler(void)
case TX_DATA_CLK_HIGH:
{
SETClkLow(ChannelNr);
+ for (int a=0; a<60; a++); // let the line settle
if (LowSpeedData[ChannelNr].MaskBit == 0) //Is Byte Done, then we need a ack from receiver
{
SETDataToInput(ChannelNr); //Set datapin to input
@@ -530,13 +531,13 @@ __ramfunc void LowSpeedPwmIrqHandler(void)
}\
}
-#define RxData(ChannelNumber, DataInBuffer, RxBytes) {\
- LowSpeedData[ChannelNumber].pComInBuffer = DataInBuffer;\
- LowSpeedData[ChannelNumber].RxBitCnt = 0;\
- LowSpeedData[ChannelNumber].RxByteCnt = RxBytes;\
- LowSpeedData[ChannelNumber].RxState = RX_DATA_CLK_LOW;\
- LowSpeedData[ChannelNumber].ReStartBit = 1;\
- LowSpeedData[ChannelNumber].RxWaitCnt = 0;\
+#define RxData(ChannelNumber, DataInBuffer, RxBytes, NoRestart) {\
+ LowSpeedData[ChannelNumber].pComInBuffer = DataInBuffer;\
+ LowSpeedData[ChannelNumber].RxBitCnt = 0;\
+ LowSpeedData[ChannelNumber].RxByteCnt = RxBytes;\
+ LowSpeedData[ChannelNumber].RxState = RX_DATA_CLK_LOW;\
+ LowSpeedData[ChannelNumber].ReStartBit = (1 - (NoRestart & (1<<ChannelNumber)));\
+ LowSpeedData[ChannelNumber].RxWaitCnt = 0;\
}