забыл добавить файлы новые
This commit is contained in:
parent
d13327347e
commit
105cad443b
21
Projects/mem_test/src/ExternalEEPROM/Arr.c
Normal file
21
Projects/mem_test/src/ExternalEEPROM/Arr.c
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Arr.c
|
||||
*
|
||||
* Created on: 21 íîÿá. 2023 ã.
|
||||
* Author: seklyuts
|
||||
*/
|
||||
|
||||
#include "f28x_project.h"
|
||||
|
||||
void copy16_to_8(uint16_t *Arr16, uint16_t *Arr8, uint16_t N)
|
||||
{
|
||||
uint16_t j=0;
|
||||
for(j = 0; j < N; j+=1) {Arr8[2*j] = 0xFF & Arr16[j]; Arr8[2*j+1] = (Arr16[j]>>8);}
|
||||
}
|
||||
|
||||
|
||||
void copy8_to_16(uint16_t *Arr8, uint16_t *Arr16, uint16_t N)
|
||||
{
|
||||
uint16_t j=0;
|
||||
for(j = 0; j < N; j+=1) Arr16[j] = (0xFF & (uint16_t)Arr8[2*j]) + ((uint16_t)Arr8[2*j+1]<<8);
|
||||
}
|
16
Projects/mem_test/src/ExternalEEPROM/Arr.h
Normal file
16
Projects/mem_test/src/ExternalEEPROM/Arr.h
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Arr.h
|
||||
*
|
||||
* Created on: 21 íîÿá. 2023 ã.
|
||||
* Author: seklyuts
|
||||
*/
|
||||
|
||||
#ifndef SRC_EXTERNALEEPROM_ARR_H_
|
||||
#define SRC_EXTERNALEEPROM_ARR_H_
|
||||
|
||||
void copy16_to_8(uint16_t *Arr16, uint16_t *Arr8, uint16_t N);
|
||||
void copy8_to_16(uint16_t *Arr8, uint16_t *Arr16, uint16_t N);
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_EXTERNALEEPROM_ARR_H_ */
|
Loading…
Reference in New Issue
Block a user