mirror of
https://github.com/juribeparada/MMDVM_HS.git
synced 2025-12-06 07:12:08 +01:00
Some minor changes in delay functions
This commit is contained in:
parent
587fe63a47
commit
66fe701251
15
ADF7021.cpp
15
ADF7021.cpp
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM
|
||||
* Copyright (C) 2016, 2017 by Andy Uribe CA6JAU
|
||||
*
|
||||
* Some of the code is based on work of Guus Van Dooren PE1PLM:
|
||||
* https://github.com/ki6zum/gmsk-dstar/blob/master/firmware/dvmega/dvmega.ino
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -29,12 +32,6 @@
|
|||
volatile uint32_t AD7021_control_byte;
|
||||
volatile int AD7021_counter;
|
||||
|
||||
void dlybit(void)
|
||||
{
|
||||
volatile unsigned int delay;
|
||||
for(delay = 0;delay<5;delay++);
|
||||
}
|
||||
|
||||
void Send_AD7021_control()
|
||||
{
|
||||
for(AD7021_counter = 31; AD7021_counter >= 0; AD7021_counter--) {
|
||||
|
|
@ -43,14 +40,14 @@ void Send_AD7021_control()
|
|||
else
|
||||
io.SDATA_pin(LOW);
|
||||
|
||||
io.dlybit();
|
||||
io.SCLK_pin(HIGH);
|
||||
dlybit();
|
||||
io.dlybit();
|
||||
io.SCLK_pin(LOW);
|
||||
dlybit();
|
||||
}
|
||||
|
||||
io.SLE_pin(HIGH);
|
||||
dlybit();
|
||||
io.dlybit();
|
||||
io.SLE_pin(LOW);
|
||||
io.SDATA_pin(LOW);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
|
||||
|
||||
void dlybit(void);
|
||||
void Send_AD7021_control(void);
|
||||
void Send_REG0_RX(void);
|
||||
void Send_REG0_TX(void);
|
||||
|
|
|
|||
6
IO.h
6
IO.h
|
|
@ -73,13 +73,15 @@ public:
|
|||
void ifConf();
|
||||
void ifInit();
|
||||
|
||||
// Misc functions
|
||||
void dlybit(void);
|
||||
void delay_rx(void);
|
||||
|
||||
private:
|
||||
bool m_started;
|
||||
CBitRB m_rxBuffer;
|
||||
CBitRB m_txBuffer;
|
||||
|
||||
void delay_rx(void);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,6 +73,12 @@ void CIO::delay_rx() {
|
|||
delayMicroseconds(1);
|
||||
}
|
||||
|
||||
void CIO::dlybit(void)
|
||||
{
|
||||
volatile unsigned int delay;
|
||||
delayMicroseconds(1);
|
||||
}
|
||||
|
||||
void CIO::Init()
|
||||
{
|
||||
#if defined (__STM32F1__)
|
||||
|
|
|
|||
Loading…
Reference in a new issue