[DemoCode下载]

const类型使用演示

[复制链接]
359|1
手机看帖
扫描二维码
随时随地手机跟帖
捉虫天师|  楼主 | 2019-11-29 21:30 | 显示全部楼层 |阅读模式
/*---------------------------------------------------------------------------------------------------------*/
/*                                                                                                         */
/* Copyright(c) 2019 Nuvoton Technology Corp. All rights reserved.                                         */
/*                                                                                                         */
/*---------------------------------------------------------------------------------------------------------*/

//***********************************************************************************************************
//  Website: http://www.nuvoton.com
//  E-Mail : MicroC-8bit@nuvoton.com
//  Date   : Jan/21/2019
//***********************************************************************************************************

//***********************************************************************************************************

//***********************************************************************************************************
#include "ML51.H"

unsigned char code protect [] = {
00,02,05,07
};


void main (void)
{
        ALL_GPIO_QUASI_MODE;                                        // Define in Function_define.h

        while(1)
        {
                P0 = 0x00;
                P2 = 0x00;
                P1 = 0x00;
                Timer0_Delay1ms(30);
                P0 = 0xff;
                P2 = 0xff;
                P1 = 0xff;
                Timer0_Delay1ms(30);
                P0 = 0x00;
                P2 = 0x00;
                P1 = 0x00;
                Timer0_Delay1ms(30);
                P0 = 0xff;
                P2 = 0xff;
                P1 = 0xff;
                Timer0_Delay1ms(30);
                P0 = 0x00;
                P2 = 0x00;
                P1 = 0x00;
                P0 = 0XFF;
       
        }

}





使用特权

评论回复
天灵灵地灵灵| | 2019-11-30 17:45 | 显示全部楼层
unsigned char code
搞不懂,code放第一位还是放类型后,有啥讲究吗

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

174

主题

2992

帖子

7

粉丝