/*!
 * @file        main.c
 *
 * @brief       Main program body
 *
 * @version     V2.5
 *
 * @date        2024-08-08
 *
 * @attention
 *
 *  Copyright (C) 2020-2022 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
 *  and limitations under the License.
 */
#include "include.h"
#include "internal_flash.h"

/*!
 * @brief       Main program,Internal_Flash
 *  read:       os_spiflash_read()
 *  write:      os_spiflash_program()
 *  erase:      os_spiflash_erase()
 *
 * @param       None
 *
 * @retval      None
 *
 */
int main(void)
{
    printf("Hello GW3323 Internal Flash!\n");

    bsp_sys_init();                     /*System initialization*/

    set_bluetooth_name(); //设置蓝牙名称
//    read_bluetooth_name();  //读取flash的蓝牙名称

    bt_init();          /*Open Bluetooth module*/
    bsp_bt_init();      /*Bluetooth system configuration*/
    set_sys_clk(SYS_160M);

    internal_flash_examples();

    while (1)
    {

        #if FOT_EN
            bsp_fot_process();
        #endif // FOT_EN
    }
    return 0;
}
