- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# memory.c File Reference

`#include "config.h"`
`#include "memory.h"`

Include dependency graph for memory.c:

Go to the source code of this file.

## Functions
void | code2data (U8 _CONST_TYPE_ *src, U8 _MEM_TYPE_SLOW_ *dest, U8 nb_data)
int | memcmp_code (U8 *ram, U8 _CONST_TYPE_ *rom, U16 n)

## Detailed Description

This file manages memory copy needed for previous C51 fat module.

- Compiler: IAR EWAVR and GNU GCC for AVR

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file memory.c.

## Function Documentation

void code2data | ( | U8 _CONST_TYPE_ * | src,
|  | U8 _MEM_TYPE_SLOW_ * | dest,
|  | U8 | nb_data |
| ) |  |  |

Definition at line 55 of file memory.c.

    00056 {
    00057    U8 _CONST_TYPE_ *ptr_code=src;
    00058    U8 *ptr_ram=dest;
    00059    U8 i=nb_data;
    00060    do
    00061    {
    00062       *ptr_ram=*ptr_code;
    00063       ptr_ram++;
    00064       ptr_code++;
    00065       i--;
    00066    } while(i);
    00067 }

int memcmp_code | ( | U8 * | ram,
|  | U8 _CONST_TYPE_ * | rom,
|  | U16 | n |
| ) |  |  |

Definition at line 69 of file memory.c.

    00070 {
    00071    U16 i;
    00072
    00073    for(i=0;i<n;i++)
    00074    {
    00075       if(ram[i]!=rom[i])
    00076       {
    00077          return -1;
    00078       }
    00079    }
    00080    return 0;
    00081 }