Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software for White Rabbit PTP Core
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Software for White Rabbit PTP Core
Commits
d12367e6
Commit
d12367e6
authored
12 years ago
by
Grzegorz Daniluk
Browse files
Options
Downloads
Patches
Plain Diff
eeprom: commented out unused function to save some memory
parent
cfe9208d
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev/eeprom.c
+29
-29
29 additions, 29 deletions
dev/eeprom.c
with
29 additions
and
29 deletions
dev/eeprom.c
+
29
−
29
View file @
d12367e6
...
...
@@ -61,35 +61,35 @@ int eeprom_read(uint8_t i2cif, uint8_t i2c_addr, uint32_t offset, uint8_t *buf,
return
size
;
}
int
eeprom_write
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint32_t
offset
,
uint8_t
*
buf
,
size_t
size
)
{
int
i
,
busy
;
for
(
i
=
0
;
i
<
size
;
i
++
)
{
mi2c_start
(
i2cif
);
if
(
mi2c_put_byte
(
i2cif
,
i2c_addr
<<
1
)
<
0
)
{
mi2c_stop
(
i2cif
);
return
-
1
;
}
mi2c_put_byte
(
i2cif
,
(
offset
>>
8
)
&
0xff
);
mi2c_put_byte
(
i2cif
,
offset
&
0xff
);
mi2c_put_byte
(
i2cif
,
*
buf
++
);
offset
++
;
mi2c_stop
(
i2cif
);
do
/* wait until the chip becomes ready */
{
mi2c_start
(
i2cif
);
busy
=
mi2c_put_byte
(
i2cif
,
i2c_addr
<<
1
);
mi2c_stop
(
i2cif
);
}
while
(
busy
);
}
return
size
;
}
//
int eeprom_write(uint8_t i2cif, uint8_t i2c_addr, uint32_t offset, uint8_t *buf, size_t size)
//
{
//
int i, busy;
//
//
for(i=0;i<size;i++)
//
{
//
mi2c_start(i2cif);
//
//
if(mi2c_put_byte(i2cif, i2c_addr << 1) < 0)
//
{
//
mi2c_stop(i2cif);
//
return -1;
//
}
//
mi2c_put_byte(i2cif, (offset >> 8) & 0xff);
//
mi2c_put_byte(i2cif, offset & 0xff);
//
mi2c_put_byte(i2cif, *buf++);
//
offset++;
//
mi2c_stop(i2cif);
//
//
do /* wait until the chip becomes ready */
//
{
//
mi2c_start(i2cif);
//
busy = mi2c_put_byte(i2cif, i2c_addr << 1);
//
mi2c_stop(i2cif);
//
} while(busy);
//
//
}
//
return size;
//
}
int32_t
eeprom_sfp_section
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
size_t
size
,
uint16_t
*
section_sz
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment