diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2016-11-24 21:55:24 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2016-11-24 21:55:24 +0000 |
commit | 6bd06e042da524448dae7e48a7499517948be2b8 (patch) | |
tree | 2631f21fb3f50f9f880e530d37a4cdaecaecf1a3 /setup.c | |
parent | c6419bba0cafa16e925b8bc5e028dba138c853b9 (diff) | |
download | fmk-6bd06e042da524448dae7e48a7499517948be2b8.tar.gz fmk-6bd06e042da524448dae7e48a7499517948be2b8.tar.xz fmk-6bd06e042da524448dae7e48a7499517948be2b8.zip |
don't use memcpy and memset for now
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -31,8 +31,10 @@ void setup(void) UNSET_BIT(WDOG_STCTRLH, STCTRLH_WDOGEN); /* Copy data and clear bss */ - memcpy(_sdata, _ldata, _edata - _sdata); - memset(_sbss, 0, _ebss - _sbss); + for (size_t i = 0; i < (size_t)(_edata - _sdata); i++) + _sdata[i] = _ldata[i]; + for (size_t i = 0; i < (size_t)(_ebss - _sbss); i++) + _sbss[i] = 0; /* Enable port clocks */ SIM_SCGC5 |= BV(SCGC5_PORTE) | BV(SCGC5_PORTD) | BV(SCGC5_PORTC) |