забыл добавить файлы новые

This commit is contained in:
Eugene 2023-11-23 11:01:53 +03:00
parent d13327347e
commit 105cad443b
2 changed files with 37 additions and 0 deletions

View 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);
}

View 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_ */