diff --git a/demo/uart/uart1_timer1_tx.c b/demo/uart/uart1_timer1_tx.c new file mode 100644 index 0000000..f9971d2 --- /dev/null +++ b/demo/uart/uart1_timer1_tx.c @@ -0,0 +1,30 @@ +// Copyright 2021 IOsetting +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "fw_hal.h" + +void main(void) +{ + SYS_SetClock(); + // UART1, baud 115200, baud source Timer1, 1T mode, no interrupt + UART1_ConfigMode1Dyn8bitUart(UART1_BaudSource_Timer1, HAL_State_ON, 115200); + while(1) + { + UART1_TxChar('T'); + UART1_TxHex(0x41); + UART1_TxString("U"); + UART1_TxString(" string\r\n"); + SYS_Delay(1000); + } +} \ No newline at end of file diff --git a/demo/uart/uart1_interrupt_tx_rx.c b/demo/uart/uart1_timer2_interrupt_tx_rx.c similarity index 100% rename from demo/uart/uart1_interrupt_tx_rx.c rename to demo/uart/uart1_timer2_interrupt_tx_rx.c diff --git a/demo/uart/uart1_tx.c b/demo/uart/uart1_timer2_tx.c similarity index 100% rename from demo/uart/uart1_tx.c rename to demo/uart/uart1_timer2_tx.c diff --git a/demo/uart/uart2_tx.c b/demo/uart/uart2_timer2_tx.c similarity index 100% rename from demo/uart/uart2_tx.c rename to demo/uart/uart2_timer2_tx.c diff --git a/include/fw_mem.h b/include/fw_mem.h index 3847eb4..6fdfd6a 100644 --- a/include/fw_mem.h +++ b/include/fw_mem.h @@ -32,6 +32,9 @@ typedef enum void MEM_SelectWorkRegGroup(MEM_WorkRegGroup_t WorkRegGroup); void MEM_SetOnchipExtRAM(HAL_State_t HAL_State); + +#if (__CONF_MCU_TYPE == 3 ) void MEM_ReadChipID(uint8_t *buff); +#endif #endif diff --git a/src/fw_mem.c b/src/fw_mem.c index 7f56c20..e5d3446 100644 --- a/src/fw_mem.c +++ b/src/fw_mem.c @@ -25,6 +25,7 @@ void MEM_SetOnchipExtRAM(HAL_State_t HAL_State) AUXR = AUXR & ~B00000010 | (HAL_State << 1); } +#if (__CONF_MCU_TYPE == 3 ) void MEM_ReadChipID(uint8_t *buff) { uint8_t i; @@ -34,4 +35,5 @@ void MEM_ReadChipID(uint8_t *buff) *(buff + i) = MEM_ReadXDATA(CHIPIDxx + i); } P_SW2 = 0x00; -} \ No newline at end of file +} +#endif diff --git a/src/fw_util.c b/src/fw_util.c index 06a847d..97173d0 100644 --- a/src/fw_util.c +++ b/src/fw_util.c @@ -101,28 +101,27 @@ void UTIL_Uart1_36M864_115200_Init(void) } /* -void UTIL_ItrimScan(uint8_t ircband, uint8_t *str) +void UTIL_ItrimScan(uint8_t ircband, uint8_t vrtrim, uint8_t irtrim_limit, uint8_t *str) { - uint8_t i = 0xFF, j; - if (ircband & 0x01 > 0) - { - i = 0xDE; - } + uint8_t i = irtrim_limit, j; do { j = 3; do { - SYS_SetFOSC(ircband, 0, i, j); + SYS_SetFOSC(ircband, vrtrim, i, j); SYS_Delay(1); - UTIL_PrintHex(IRCBAND); - UTIL_PrintChar(' '); - UTIL_PrintHex(IRTRIM); - UTIL_PrintChar(0x20); - UTIL_PrintHex(LIRTRIM); - UTIL_PrintChar(0x20); - UTIL_PrintString(str); - SYS_Delay(5); + UART1_TxHex(IRCBAND); + UART1_TxChar(' '); + UART1_TxHex(VRTRIM); + UART1_TxChar(' '); + UART1_TxHex(IRTRIM); + UART1_TxChar(0x20); + UART1_TxHex(LIRTRIM); + UART1_TxChar(0x20); + UART1_TxString(str); + SYS_Delay(10); } while (j--); } while (i--); -}*/ \ No newline at end of file +} +*/ \ No newline at end of file