[style] format files by clang-format

This commit is contained in:
jzlv 2021-06-20 12:25:46 +08:00
parent 47ce9f871c
commit d427e7fdda
1131 changed files with 7338846 additions and 422042 deletions

View file

@ -1,24 +1,24 @@
/**
* @file main.c
* @brief
*
* @brief
*
* Copyright (c) 2021 Bouffalolab team
*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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 "drv_mmheap.h"
#include "hal_uart.h"
@ -29,9 +29,9 @@ static uint8_t dma_tc_flag0 = 0;
void dma_ch2_irq_callback(struct device *dev, void *args, uint32_t size, uint32_t state)
{
if (!state)
{
if (!state) {
dma_tc_flag0 = 1;
MSG("dma transfer success\r\n");
}
}
@ -53,28 +53,28 @@ int main(void)
uart_register(UART1_INDEX, "uart1", DEVICE_OFLAG_RDWR);
struct device *uart = device_find("uart1");
if (uart)
{
device_open(uart, DEVICE_OFLAG_DMA_TX);
if (uart) {
device_open(uart, DEVICE_OFLAG_DMA_TX);
}
dma_register(DMA0_CH2_INDEX, "ch2", DEVICE_OFLAG_RDWR);
struct device* dma_ch2 = device_find("ch2");
if (dma_ch2)
{
struct device *dma_ch2 = device_find("ch2");
if (dma_ch2) {
device_open(dma_ch2, 0);
device_set_callback(dma_ch2, dma_ch2_irq_callback);
device_control(dma_ch2, DEVICE_CTRL_SET_INT, NULL);
}
device_control(uart,DEVICE_CTRL_ATTACH_TX_DMA,dma_ch2);
while (1)
{
device_write(uart,0,src_buffer,4100);
while (dma_tc_flag0 == 0)
{
device_control(uart, DEVICE_CTRL_ATTACH_TX_DMA, dma_ch2);
while (1) {
device_write(uart, 0, src_buffer, 4100);
while (dma_tc_flag0 == 0) {
bflb_platform_delay_ms(1);
}
bflb_platform_delay_ms(1000);
}
}