Skip to content

Commit

Permalink
pico_rand() is now a weak symbol to allow alternative implementations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Lacamera committed Nov 27, 2014
1 parent 48041c7 commit c692099
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/pico_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
# define PACKED_STRUCT_DEF __packed struct
# define PEDANTIC_STRUCT_DEF __packed struct
# define PACKED_UNION_DEF __packed union
# define WEAK
#else
# define PACKED_STRUCT_DEF struct __attribute__((packed))
# define PEDANTIC_STRUCT_DEF struct
# define PACKED_UNION_DEF union /* Sane compilers do not require packed unions */
# define WEAK __attribute__((weak))
#endif


Expand Down
2 changes: 1 addition & 1 deletion stack/pico_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void pico_rand_feed(uint32_t feed)
_rand_seed ^= ~(feed);
}

uint32_t pico_rand(void)
uint32_t WEAK pico_rand(void)
{
pico_rand_feed((uint32_t)pico_tick);
return _rand_seed;
Expand Down

0 comments on commit c692099

Please sign in to comment.