36 #include <avr/pgmspace.h>
38 #include "loader/symbols.h"
40 #define SYMTAB_CONF_BINARY_SEARCH 0
44 symtab_lookup(
const char *name)
49 for(name_addr = (
void*)pgm_read_word(&symbols[0].name);
51 name_addr = (
void*)pgm_read_word(&symbols[++i].name)) {
53 if(strcmp_P (name, (
const char*)name_addr) == 0) {
54 return (
void*)pgm_read_word(&symbols[i].value);
63 #define SYMTAB_PRINT_BUFFER_SIZE 30
68 const char* name_addr;
69 char buf[SYMTAB_PRINT_BUFFER_SIZE];
71 for(name_addr = (
const char*)pgm_read_word(&symbols[0].name);
73 name_addr = pgm_read_word(&symbols[++i].name)) {
75 strncpy_P (buf, (
const char*)name_addr, SYMTAB_PRINT_BUFFER_SIZE);
76 buf [SYMTAB_PRINT_BUFFER_SIZE - 1] =
'\0';
77 uint16_t value = pgm_read_word(&symbols[i].value);
78 printf (
"%s -> 0x%x\n", buf, value);