修复mico-sdk错误

This commit is contained in:
nhkefus
2025-03-11 15:54:45 +08:00
parent 3422912129
commit 2ccb892a1c
2152 changed files with 664341 additions and 702636 deletions

View File

@@ -1,85 +1,85 @@
/**
******************************************************************************
* @file spi_flash_platform.c
* @author William Xu
* @version V1.0.0
* @date 16-Sep-2014
* @brief This file provides all the headers of flash operation functions.
******************************************************************************
* UNPUBLISHED PROPRIETARY SOURCE CODE
* Copyright (c) 2016 MXCHIP Inc.
*
* The contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of MXCHIP Corporation.
******************************************************************************
*/
#include "spi_flash_platform_interface.h"
#include "mico_platform.h"
#if defined ( USE_MICO_SPI_FLASH )
int sflash_platform_init ( /*@shared@*/ void* peripheral_id, /*@out@*/ void** platform_peripheral_out )
{
UNUSED_PARAMETER( peripheral_id ); /* Unused due to single SPI Flash */
if ( kNoErr != MicoSpiInitialize( &mico_spi_flash ) )
{
/*@-mustdefine@*/ /* Lint: failed - do not define platform peripheral */
return -1;
/*@+mustdefine@*/
}
if( platform_peripheral_out != NULL)
*platform_peripheral_out = NULL;
return 0;
}
extern int sflash_platform_send_recv ( const void* platform_peripheral, /*@in@*/ /*@out@*/ sflash_platform_message_segment_t* segments, unsigned int num_segments )
{
UNUSED_PARAMETER( platform_peripheral );
if ( kNoErr != MicoSpiTransfer( &mico_spi_flash, (mico_spi_message_segment_t*) segments, (uint16_t) num_segments ) )
{
return -1;
}
return 0;
}
int sflash_platform_deinit( void )
{
if ( kNoErr != MicoSpiFinalize( &mico_spi_flash ) )
{
/*@-mustdefine@*/ /* Lint: failed - do not define platform peripheral */
return -1;
/*@+mustdefine@*/
}
return 0;
}
#else
int sflash_platform_init( /*@shared@*/ void* peripheral_id, /*@out@*/ void** platform_peripheral_out )
{
UNUSED_PARAMETER( peripheral_id );
UNUSED_PARAMETER( platform_peripheral_out );
return -1;
}
extern int sflash_platform_send_recv( const void* platform_peripheral, /*@in@*//*@out@*/sflash_platform_message_segment_t* segments, unsigned int num_segments )
{
UNUSED_PARAMETER( platform_peripheral );
UNUSED_PARAMETER( segments );
UNUSED_PARAMETER( num_segments );
return -1;
}
int sflash_platform_deinit( void )
{
return -1;
}
#endif
/**
******************************************************************************
* @file spi_flash_platform.c
* @author William Xu
* @version V1.0.0
* @date 16-Sep-2014
* @brief This file provides all the headers of flash operation functions.
******************************************************************************
* UNPUBLISHED PROPRIETARY SOURCE CODE
* Copyright (c) 2016 MXCHIP Inc.
*
* The contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of MXCHIP Corporation.
******************************************************************************
*/
#include "spi_flash_platform_interface.h"
#include "mico_platform.h"
#if defined ( USE_MICO_SPI_FLASH )
int sflash_platform_init ( /*@shared@*/ void* peripheral_id, /*@out@*/ void** platform_peripheral_out )
{
UNUSED_PARAMETER( peripheral_id ); /* Unused due to single SPI Flash */
if ( kNoErr != MicoSpiInitialize( &mico_spi_flash ) )
{
/*@-mustdefine@*/ /* Lint: failed - do not define platform peripheral */
return -1;
/*@+mustdefine@*/
}
if( platform_peripheral_out != NULL)
*platform_peripheral_out = NULL;
return 0;
}
extern int sflash_platform_send_recv ( const void* platform_peripheral, /*@in@*/ /*@out@*/ sflash_platform_message_segment_t* segments, unsigned int num_segments )
{
UNUSED_PARAMETER( platform_peripheral );
if ( kNoErr != MicoSpiTransfer( &mico_spi_flash, (mico_spi_message_segment_t*) segments, (uint16_t) num_segments ) )
{
return -1;
}
return 0;
}
int sflash_platform_deinit( void )
{
if ( kNoErr != MicoSpiFinalize( &mico_spi_flash ) )
{
/*@-mustdefine@*/ /* Lint: failed - do not define platform peripheral */
return -1;
/*@+mustdefine@*/
}
return 0;
}
#else
int sflash_platform_init( /*@shared@*/ void* peripheral_id, /*@out@*/ void** platform_peripheral_out )
{
UNUSED_PARAMETER( peripheral_id );
UNUSED_PARAMETER( platform_peripheral_out );
return -1;
}
extern int sflash_platform_send_recv( const void* platform_peripheral, /*@in@*//*@out@*/sflash_platform_message_segment_t* segments, unsigned int num_segments )
{
UNUSED_PARAMETER( platform_peripheral );
UNUSED_PARAMETER( segments );
UNUSED_PARAMETER( num_segments );
return -1;
}
int sflash_platform_deinit( void )
{
return -1;
}
#endif