Skip to content

Commit 787cedd

Browse files
committed
1. fix bug
1 parent 2373c0f commit 787cedd

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

AvrEeprom.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <ina90.h>
88
#include "AvrEeprom.h"
99
/*********************************************************************************/
10-
#if(AVR_EEPROM_REVISION_DATE != 20161226)
10+
#if(AVR_EEPROM_REVISION_DATE != 20180921)
1111
#error wrong include file. (AvrEeprom.h)
1212
#endif
1313
/*********************************************************************************/
@@ -32,7 +32,7 @@ char InitEepControl(tag_EepControl *Eep, const unsigned char *DataBase, unsigned
3232
- Length : 관리할 대상의 크기
3333
3434
2) 반환
35-
- 초기화 성공 여부
35+
- 초기화 성공 여부
3636
3737
3) 설명
3838
- tag_EepControl 인스턴스를 초기화한다.
@@ -64,7 +64,7 @@ void DoEepReadControl(tag_EepControl *Eep)
6464
- Eep : tag_EepControl 인스턴스의 주소
6565
6666
2) 반환
67-
- 없음.
67+
- 없음.
6868
6969
3) 설명
7070
- 해당 인스턴스의 eeprom으로 부터 데이터를 읽어와 대상 버퍼에 값을 대입.
@@ -115,7 +115,7 @@ char DoEepWriteControl(tag_EepControl *Eep)
115115
- Eep : tag_EepControl 인스턴스의 주소
116116
117117
2) 반환
118-
- 쓰기동작 중일 때 true, 그외 상황일 때 false.
118+
- 쓰기동작 중일 때 true, 그외 상황일 때 false.
119119
120120
3) 설명
121121
- 해당 인스턴스의 eeprom 영역에 관리할 대상 데이터를 쓰기를 진행한다.
@@ -141,7 +141,7 @@ char DoEepWriteControl(tag_EepControl *Eep)
141141
/* check valid data */
142142
}
143143

144-
if(++(*pIndex) > Eep->Length)
144+
if(++(*pIndex) >= Eep->Length)
145145
{
146146
pBit = (tag_EepBitField *) &Eep->Bit;
147147
pBit->Write = false;

AvrEeprom.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
#ifndef __AVR_EEPROM_H__
88
#define __AVR_EEPROM_H__
99
/*********************************************************************************/
10-
#define AVR_EEPROM_REVISION_DATE 20161226
10+
#define AVR_EEPROM_REVISION_DATE 20180921
1111
/*********************************************************************************/
1212
/** REVISION HISTORY **/
1313
/*
14+
2018. 09. 21. - DoEepWriteControl() 함수에서 Length 보다 1바이트 더 쓰던 현상 수정.
15+
Jeong Hyun Gu
16+
1417
2016. 12. 26. - Eeprom_Write(), Eeprom_Read() 함수에서 WDT RESET 추가.
1518
Jeong Hyun Gu
1619
@@ -33,7 +36,7 @@
3336
#define false 0
3437

3538

36-
#define __AVR_ATMEGA64__
39+
#define __AVR_ATMEGA128__
3740

3841

3942
#ifdef __AVR_ATMEGA8__

0 commit comments

Comments
 (0)