GD32-MCU commented on code in PR #7884: URL: https://github.com/apache/nuttx/pull/7884#discussion_r1049403130
########## boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_at24.c: ########## @@ -0,0 +1,156 @@ +/**************************************************************************** + * boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_at24.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <stdbool.h> +#include <stdio.h> +#include <errno.h> +#include <debug.h> + +#include <nuttx/i2c/i2c_master.h> +#include <nuttx/mtd/mtd.h> +#include <nuttx/kmalloc.h> + +#include "gd32f4xx.h" +#include "gd32f450z_eval.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: gd32_at24_wr_test + * + * Description: + * Write and read the AT24 serial EEPROM test. + * + ****************************************************************************/ + +#ifdef HAVE_AT24 + +#define BUFFSIZE 16 +#define START_BLOCK 0 + +#if BUFFSIZE>=CONFIG_AT24XX_MTD_BLOCKSIZE +# define NBLOCK (BUFFSIZE/CONFIG_AT24XX_MTD_BLOCKSIZE) +#else +# error "BUFFSIZE should bigger than CONFIG_AT24XX_MTD_BLOCKSIZE" +#endif + +const uint8_t write_buf[BUFFSIZE] = + { Review Comment: Could you prompt me how to delete the intermediate patch? When use git rebase, there is a status of "Your branch and 'origin/GD32F4' have diverged" Should i delete all submissions and recommit again. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org