#define
Добавлено: Пн июл 25, 2016 17:46:36
Прочитал инфу про #define. Так же прочитал про использование совместно #ifndef, #define и #endif для исключения повторов кода и вывода ошибки компилятором. Но ни как не могу понять что значит этот #define например в заголовочных файлах.
Например в alcd.h файле все логично и понятно
Но например в файле mega8.h просто стоит #define и какое-то значение. Привел на картинке.

Например в alcd.h файле все логично и понятно
Код: Выделить всё
/**************************************************
CodeVisionAVR C Compiler V2.04.9+
(C) 1998-2010 Pavel Haiduc, HP InfoTech S.R.L.
Universal alphanumeric LCD driver library
for the HD44780 LCD controller
Supports both ATxmega and non-ATxmega devices
**************************************************/
#ifndef _LCDX_INCLUDED_
#define _LCDX_INCLUDED_
void _lcd_write_data(unsigned char data);
/* read a byte from the LCD character generator or display RAM */
unsigned char lcd_read_byte(unsigned char addr);
/* write a byte to the LCD character generator or display RAM */
void lcd_write_byte(unsigned char addr, unsigned char data);
// set the LCD display position x=0..39 y=0..3
void lcd_gotoxy(unsigned char x, unsigned char y);
// clear the LCD
void lcd_clear(void);
void lcd_putchar(char c);
// write the string str located in SRAM to the LCD
void lcd_puts(char *str);
// write the string str located in FLASH to the LCD
void lcd_putsf(char flash *str);
// write the string str located in EEPROM to the LCD
void lcd_putse(char eeprom *str);
// initialize the LCD controller
void lcd_init(unsigned char lcd_columns);
#pragma library alcd.lib
#endif