MateoConLechuga wrote:
You need to call ti_CloseAll() before trying to open other file handles, as documented:
http://ce-programming.github.io/toolchain/fileioc_8h.html#a2a9a88c6c2200809894fdab31ffef226
http://ce-programming.github.io/toolchain/fileioc_8h.html#a2a9a88c6c2200809894fdab31ffef226
Code:
/* Keep these headers */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tice.h>
/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <debug.h>
//libraries
#include <fileioc.h>
#include <keypadc.h>
#include <graphx.h>
#include <intce.h>
//includes
#include "main.h"
#include "access.h"
#include "menus.h"
//defines
//functions
//variables
uint8_t key, markProgInvalid;
void main(void) {
gfx_Begin(gfx_8bpp);
gfx_SetDraw(gfx_buffer);
closeAll();
openProg(createMain, blank);
gfx_SetMonospaceFont(8);
mainMenu();
gfx_SetMonospaceFont(0);
//end
writeVar(saveMain, slotVars.main);
closeAll();
gfx_End();
}
The closeAll() function called above calls ti_CloseAll() (found in my last post's code).