remove whitespaces and tabs

This commit is contained in:
dehanj 2023-11-14 09:33:02 +01:00 committed by Michael Cardell Widerkrantz
parent 2014923966
commit 7019cd9048
No known key found for this signature in database
GPG key ID: D3DB3DDF57E704E5
3 changed files with 20 additions and 20 deletions

View file

@ -7,7 +7,7 @@
CH554 main frequency modification, delay function definition CH554 main frequency modification, delay function definition
                     Serial port 0 and serial port 1 initialization                      Serial port 0 and serial port 1 initialization
                     Serial port 0 and serial port 1 transceiver subfunctions                      Serial port 0 and serial port 1 transceiver subfunctions
                     Watchdog initialization                      Watchdog initialization
*******************************************************************************/ *******************************************************************************/
#include <stdint.h> #include <stdint.h>
@ -20,8 +20,8 @@
* Description : CH554 clock selection and configuration function, Fsys 6MHz is used by default, FREQ_SYS can be passed * Description : CH554 clock selection and configuration function, Fsys 6MHz is used by default, FREQ_SYS can be passed
                 CLOCK_CFG configuration, the formula is as follows:                  CLOCK_CFG configuration, the formula is as follows:
                 Fsys = (Fosc * 4 / (CLOCK_CFG & MASK_SYS_CK_SEL); the specific clock needs to be configured by yourself                  Fsys = (Fosc * 4 / (CLOCK_CFG & MASK_SYS_CK_SEL); the specific clock needs to be configured by yourself
*******************************************************************************/ *******************************************************************************/
void CfgFsys( ) void CfgFsys( )
{ {
SAFE_MOD = 0x55; SAFE_MOD = 0x55;
SAFE_MOD = 0xAA; SAFE_MOD = 0xAA;
@ -31,19 +31,19 @@ void CfgFsys( )
#if FREQ_SYS == 32000000 #if FREQ_SYS == 32000000
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x07; // 32MHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x07; // 32MHz
#elif FREQ_SYS == 24000000 #elif FREQ_SYS == 24000000
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x06; // 24MHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x06; // 24MHz
#elif FREQ_SYS == 16000000 #elif FREQ_SYS == 16000000
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x05; // 16MHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x05; // 16MHz
#elif FREQ_SYS == 12000000 #elif FREQ_SYS == 12000000
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x04; // 12MHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x04; // 12MHz
#elif FREQ_SYS == 6000000 #elif FREQ_SYS == 6000000
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x03; // 6MHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x03; // 6MHz
#elif FREQ_SYS == 3000000 #elif FREQ_SYS == 3000000
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x02; // 3MHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x02; // 3MHz
#elif FREQ_SYS == 750000 #elif FREQ_SYS == 750000
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x01; // 750KHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x01; // 750KHz
#elif FREQ_SYS == 187500 #elif FREQ_SYS == 187500
CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x00; // 187.5MHz CLOCK_CFG = CLOCK_CFG & ~ MASK_SYS_CK_SEL | 0x00; // 187.5MHz
#else #else
#warning FREQ_SYS invalid or not set #warning FREQ_SYS invalid or not set
#endif #endif
@ -59,7 +59,7 @@ void CfgFsys( )
* Input : UNIT16 n * Input : UNIT16 n
* Output : None * Output : None
* Return : None * Return : None
*******************************************************************************/ *******************************************************************************/
void mDelayuS( uint16_t n ) // Delay in uS void mDelayuS( uint16_t n ) // Delay in uS
{ {
#ifdef FREQ_SYS #ifdef FREQ_SYS
@ -129,7 +129,7 @@ void mDelaymS( uint16_t n ) //
#endif #endif
-- n; -- n;
} }
} }
#if SDCC < 370 #if SDCC < 370
void putchar(char c) void putchar(char c)
@ -200,4 +200,4 @@ void gpio_unset(uint8_t pin) {
break; break;
} }
} }

View file

@ -102,7 +102,7 @@ inline void UART1Setup()
U1SM0 = 0; //UART1选择8位数据位 U1SM0 = 0; //UART1选择8位数据位
U1SMOD = 1; //快速模式 U1SMOD = 1; //快速模式
U1REN = 1; //使能接收 U1REN = 1; //使能接收
// should correct for rounding in SBAUD1 calculation // should correct for rounding in SBAUD1 calculation
SBAUD1 = 256 - FREQ_SYS/16/UART1_BAUD; SBAUD1 = 256 - FREQ_SYS/16/UART1_BAUD;
} }
@ -181,4 +181,4 @@ inline void CH554WDTFeed(uint8_t tim)
// Set pin p1.4 and p1.5 to GPIO output mode. // Set pin p1.4 and p1.5 to GPIO output mode.
void gpio_init(); void gpio_init();
void gpio_set(uint8_t pin); void gpio_set(uint8_t pin);
void gpio_unset(uint8_t pin); void gpio_unset(uint8_t pin);

View file

@ -645,15 +645,15 @@ main()
UpPoint2_Busy = 1; UpPoint2_Busy = 1;
// Should according to the USB-spec check if // Should according to the USB-spec check if
// length == 64, if so we should send a // length == 64, if so we should send a
// zero-length USB packet. This is very // zero-length USB packet. This is very
// unlikley to happen. // unlikley to happen.
} }
} }
} }
// Should have a timeout if the transfer for some reason // Should have a timeout if the transfer for some reason
// fails to reset UpPoint2_Busy. But does not seem to // fails to reset UpPoint2_Busy. But does not seem to
// happen. // happen.
} }
} }
} }